[U-Boot] [PATCH 23/45] tpm: Use livetree and allow children

Simon Glass sjg at chromium.org
Mon Oct 1 18:22:27 UTC 2018


Adjust the TPM drivers to use livetree (only one does not). Also,
sometimes TPMs can have child devices if they provide a service to the
system (such as storing secure data), so permit that.

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

 drivers/misc/cros_ec.c    | 6 +++---
 drivers/tpm/tpm-uclass.c  | 1 +
 drivers/tpm/tpm_tis_lpc.c | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index a92806c46c9..5ccf8ad359b 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -263,9 +263,9 @@ static int send_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version,
  * @param din_len       Maximum size of response in bytes
  * @return number of bytes in response, or -ve on error
  */
-static int ec_command_inptr(struct udevice *dev, uint8_t cmd,
-			    int cmd_version, const void *dout, int dout_len,
-			    uint8_t **dinp, int din_len)
+static int ec_command_inptr(struct udevice *dev, uint8_t cmd, int cmd_version,
+			    const void *dout, int dout_len, uint8_t **dinp,
+			    int din_len)
 {
 	struct cros_ec_dev *cdev = dev_get_uclass_priv(dev);
 	uint8_t *din = NULL;
diff --git a/drivers/tpm/tpm-uclass.c b/drivers/tpm/tpm-uclass.c
index 80fa0783d58..455f82b1c2b 100644
--- a/drivers/tpm/tpm-uclass.c
+++ b/drivers/tpm/tpm-uclass.c
@@ -129,5 +129,6 @@ UCLASS_DRIVER(tpm) = {
 	.id		= UCLASS_TPM,
 	.name		= "tpm",
 	.flags		= DM_UC_FLAG_SEQ_ALIAS,
+	.post_bind	= dm_scan_fdt_dev,
 	.per_device_auto_alloc_size	= sizeof(struct tpm_chip_priv),
 };
diff --git a/drivers/tpm/tpm_tis_lpc.c b/drivers/tpm/tpm_tis_lpc.c
index 7664bb1a605..e993fd9f833 100644
--- a/drivers/tpm/tpm_tis_lpc.c
+++ b/drivers/tpm/tpm_tis_lpc.c
@@ -164,7 +164,7 @@ static int tpm_tis_lpc_probe(struct udevice *dev)
 	u32 didvid;
 	ulong chip_type = dev_get_driver_data(dev);
 
-	addr = devfdt_get_addr(dev);
+	addr = dev_read_addr(dev);
 	if (addr == FDT_ADDR_T_NONE)
 		return -EINVAL;
 	priv->regs = map_sysmem(addr, 0);
-- 
2.19.0.605.g01d371f741-goog



More information about the U-Boot mailing list