Commit a174f000 authored by Miquel Raynal's avatar Miquel Raynal Committed by Tom Rini
Browse files

tpm2: tis_spi: add the possibility to reset the chip with a gpio

On some designs, the reset line could not be connected to the SoC reset
line, in this case, request the GPIO and ensure the chip gets reset.

Signed-off-by: default avatarMiquel Raynal <>
Reviewed-by: Simon Glass's avatarSimon Glass <>
parent eb46910b
......@@ -23,6 +23,7 @@
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/unaligned/be_byteshift.h>
#include <asm-generic/gpio.h>
#include "tpm_tis.h"
#include "tpm_internal.h"
......@@ -574,6 +575,21 @@ static int tpm_tis_spi_probe(struct udevice *dev)
struct tpm_chip *chip = dev_get_priv(dev);
int ret;
struct gpio_desc reset_gpio;
ret = gpio_request_by_name(dev, "gpio-reset", 0,
&reset_gpio, GPIOD_IS_OUT);
if (ret) {
log(LOGC_NONE, LOGL_NOTICE, "%s: missing reset GPIO\n",
} else {
dm_gpio_set_value(&reset_gpio, 0);
dm_gpio_set_value(&reset_gpio, 1);
/* Ensure a minimum amount of time elapsed since reset of the TPM */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment