[U-Boot] [PATCH v4 26/32] tpm: add the possibility to reset the chip with a gpio

Miquel Raynal miquel.raynal at bootlin.com
Tue May 15 16:32:43 UTC 2018


Simon, Tom,

On Wed, 16 May 2018 02:05:01 +1000, Simon Glass <sjg at chromium.org>
wrote:

> On 15 May 2018 at 19:57, Miquel Raynal <miquel.raynal at bootlin.com> wrote:
> > 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: Miquel Raynal <miquel.raynal at bootlin.com>
> > ---
> >  drivers/tpm/tpm2_tis_spi.c | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)  
> 
> Reviewed-by: Simon Glass <sjg at chromium.org>
> 
> Question below
> 
> >
> > diff --git a/drivers/tpm/tpm2_tis_spi.c b/drivers/tpm/tpm2_tis_spi.c
> > index 6a4d5284c9..1c7f8f3673 100644
> > --- a/drivers/tpm/tpm2_tis_spi.c
> > +++ b/drivers/tpm/tpm2_tis_spi.c
> > @@ -24,6 +24,9 @@
> >  #include <linux/compiler.h>
> >  #include <linux/types.h>
> >  #include <linux/unaligned/be_byteshift.h>
> > +#ifdef CONFIG_DM_GPIO
> > +#include <asm-generic/gpio.h>
> > +#endif
> >
> >  #include "tpm_tis.h"
> >  #include "tpm_internal.h"
> > @@ -574,6 +577,20 @@ static int tpm_tis_spi_probe(struct udevice *dev)
> >         struct tpm_chip_priv *priv = dev_get_uclass_priv(dev);
> >         struct tpm_chip *chip = dev_get_priv(dev);
> >         int ret;
> > +#ifdef CONFIG_DM_GPIO  
> 
> Can this use if (IS_ENABLED(CONFIG_DM_GPIO)) ?
> 
> It helps to improve build coverage.
> 

Sure!

Tom, I guess the series needs the following changes:
- update the old license identifiers
- two occurrences of "#ifdef CONFIG_DM_GPIO" in this patch to be
  replaced by "#if (IS_ENABLED(CONFIG_DM_GPIO))"

I can either repost a new iteration of the whole series/just this patch
or let you make the changes. Let me know what is best for you.

Thanks you very much, both of you, for your guidance.

Regards,
Miquèl

-- 
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the U-Boot mailing list