Browse Source

tpm: Use livetree and allow children

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@chromium.org>
Simon Glass 3 years ago
parent
commit
c89d32a7b1
2 changed files with 4 additions and 1 deletions
  1. 3 0
      drivers/tpm/tpm-uclass.c
  2. 1 1
      drivers/tpm/tpm_tis_lpc.c

+ 3 - 0
drivers/tpm/tpm-uclass.c

@@ -129,5 +129,8 @@ UCLASS_DRIVER(tpm) = {
129 129
 	.id		= UCLASS_TPM,
130 130
 	.name		= "tpm",
131 131
 	.flags		= DM_UC_FLAG_SEQ_ALIAS,
132
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
133
+	.post_bind	= dm_scan_fdt_dev,
134
+#endif
132 135
 	.per_device_auto_alloc_size	= sizeof(struct tpm_chip_priv),
133 136
 };

+ 1 - 1
drivers/tpm/tpm_tis_lpc.c

@@ -164,7 +164,7 @@ static int tpm_tis_lpc_probe(struct udevice *dev)
164 164
 	u32 didvid;
165 165
 	ulong chip_type = dev_get_driver_data(dev);
166 166
 
167
-	addr = devfdt_get_addr(dev);
167
+	addr = dev_read_addr(dev);
168 168
 	if (addr == FDT_ADDR_T_NONE)
169 169
 		return -EINVAL;
170 170
 	priv->regs = map_sysmem(addr, 0);