Lines Matching +full:tpm +full:- +full:tis +full:- +full:mmio
1 // SPDX-License-Identifier: GPL-2.0-only
10 * Maintained by: <tpmdd-devel@lists.sourceforge.net>
12 * Device driver for TCG/TCPA TPM (trusted platform module).
15 * This device driver implements the TPM interface as defined in
16 * the TCG TPM Interface Spec version 1.2, revision 1.0.
29 #include "tpm.h"
36 * irq = -1 means: no irq support
54 * TPM MMIO base address.
65 * Write a byte word to the TPM MMIO address, and flush the write queue.
78 * Write a 32-bit word to the TPM MMIO address, and flush the write queue.
109 list_for_each_entry(id, &dev->pnp.ids, list) in has_hid()
110 if (!strcmp(hid, id->id)) in has_hid()
145 if (!aid || aid->driver_data != DEVICE_IS_TPM2) in check_acpi_tpm2()
152 if (ACPI_FAILURE(st) || tbl->header.length < sizeof(*tbl)) { in check_acpi_tpm2()
154 return -EINVAL; in check_acpi_tpm2()
158 if (tbl->start_method != ACPI_TPM2_MEMORY_MAPPED) in check_acpi_tpm2()
159 ret = -ENODEV; in check_acpi_tpm2()
180 while (len--) in tpm_tcg_read_bytes()
181 *result++ = ioread8(phy->iobase + addr); in tpm_tcg_read_bytes()
184 result_le16 = cpu_to_le16(ioread16(phy->iobase + addr)); in tpm_tcg_read_bytes()
188 result_le32 = cpu_to_le32(ioread32(phy->iobase + addr)); in tpm_tcg_read_bytes()
203 while (len--) in tpm_tcg_write_bytes()
204 tpm_tis_iowrite8(*value++, phy->iobase, addr); in tpm_tcg_write_bytes()
207 return -EINVAL; in tpm_tcg_write_bytes()
209 tpm_tis_iowrite32(le32_to_cpu(*((__le32 *)value)), phy->iobase, addr); in tpm_tcg_write_bytes()
224 int irq = -1; in tpm_tis_init()
233 return -ENOMEM; in tpm_tis_init()
235 phy->iobase = devm_ioremap_resource(dev, &tpm_info->res); in tpm_tis_init()
236 if (IS_ERR(phy->iobase)) in tpm_tis_init()
237 return PTR_ERR(phy->iobase); in tpm_tis_init()
240 irq = tpm_info->irq; in tpm_tis_init()
243 set_bit(TPM_TIS_ITPM_WORKAROUND, &phy->priv.flags); in tpm_tis_init()
245 return tpm_tis_core_init(dev, &phy->priv, irq, &tpm_tcg, in tpm_tis_init()
259 return -ENODEV; in tpm_tis_pnp_init()
265 tpm_info.irq = -1; in tpm_tis_pnp_init()
267 return tpm_tis_init(&pnp_dev->dev, &tpm_info); in tpm_tis_pnp_init()
271 * There is a known bug caused by 93e1b7d42e1e ("[PATCH] tpm: add HID module
278 {"PNP0C31", 0}, /* TPM */
309 #define TIS_HID_USR_IDX (ARRAY_SIZE(tpm_pnp_tbl) - 2)
323 dev_err(&pdev->dev, "no memory resource defined\n"); in tpm_tis_plat_probe()
324 return -ENODEV; in tpm_tis_plat_probe()
331 tpm_info.irq = -1; in tpm_tis_plat_probe()
337 return tpm_tis_init(&pdev->dev, &tpm_info); in tpm_tis_plat_probe()
342 struct tpm_chip *chip = dev_get_drvdata(&pdev->dev); in tpm_tis_plat_remove()
351 {.compatible = "tcg,tpm-tis-mmio"},
382 pdev = platform_device_register_simple("tpm_tis", -1, x86_resources, in tpm_tis_force_device()
433 MODULE_DESCRIPTION("TPM Driver");