linux-stable/drivers/char
Matthew Garrett 0fd4ac3773 tpm_crb: Add support for CRB devices based on Pluton
commit 4d27328827 upstream.

Pluton is an integrated security processor present in some recent Ryzen
parts. If it's enabled, it presents two devices - an MSFT0101 ACPI device
that's broadly an implementation of a Command Response Buffer TPM2, and an
MSFT0200 ACPI device whose functionality I haven't examined in detail yet.
This patch only attempts to add support for the TPM device.

There's a few things that need to be handled here. The first is that the
TPM2 ACPI table uses a previously undefined start method identifier. The
table format appears to include 16 bytes of startup data, which corresponds
to one 64-bit address for a start message and one 64-bit address for a
completion response. The second is that the ACPI tables on the Thinkpad Z13
I'm testing this on don't define any memory windows in _CRS (or, more
accurately, there are two empty memory windows). This check doesn't seem
strictly necessary, so I've skipped that.

Finally, it seems like chip needs to be explicitly asked to transition into
ready status on every command. Failing to do this means that if two
commands are sent in succession without an idle/ready transition in
between, everything will appear to work fine but the response is simply the
original command. I'm working without any docs here, so I'm not sure if
this is actually the required behaviour or if I'm missing something
somewhere else, but doing this results in the chip working reliably.

Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Cc: "Limonciello, Mario" <mario.limonciello@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-28 11:12:17 +02:00
..
agp parisc: Flush gatt writes and adjust gatt mask in parisc_agp_mask_memory() 2023-06-21 16:00:53 +02:00
hw_random hwrng: geode - Fix PCI device refcount leak 2022-12-31 13:32:37 +01:00
ipmi ipmi: ASPEED_BT_IPMI_BMC: select REGMAP_MMIO instead of depending on it 2023-05-11 23:03:26 +09:00
mwave char/mwave: Adjust io port register size 2021-12-03 14:27:06 +01:00
pcmcia Revert "char: pcmcia: cm4000_cs: Replace mdelay with usleep_range in set_protocol" 2023-03-10 09:33:32 +01:00
tpm tpm_crb: Add support for CRB devices based on Pluton 2023-06-28 11:12:17 +02:00
xilinx_hwicap xilinx_hwicap: cleanup comments 2022-02-25 12:08:57 +01:00
xillybus char: xillybus: fix a refcount leak in cleanup_dev() 2022-04-24 17:30:45 +02:00
Kconfig Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
Makefile char: remove VR41XX related char driver 2022-07-28 16:12:33 +02:00
adi.c
apm-emulation.c apm-emulation: drop unexpected word "the" in the comments 2022-06-27 16:15:27 +02:00
applicom.c applicom: Fix PCI device refcount leak in applicom_init() 2023-03-10 09:33:32 +01:00
applicom.h
bsr.c powerpc/BSR: Make use of the helper macro LIST_HEAD() 2022-02-25 12:10:15 +01:00
ds1620.c
dsp56k.c
dtlk.c
hangcheck-timer.c
hpet.c hpet: remove unused writeq/readq function definitions 2022-02-04 16:45:39 +01:00
lp.c char: lp: remove redundant initialization of err 2022-06-10 15:29:50 +02:00
mem.c random: restore O_NONBLOCK support 2022-09-23 12:27:57 +02:00
misc.c char: misc: remove usage of list iterator past the loop body 2022-04-24 17:15:12 +02:00
mspec.c
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
powernv-op-panel.c powerpc/powernv: Fix fall-through warning for Clang 2021-07-13 19:21:41 -05:00
ppdev.c
ps3flash.c
random.c use less confusing names for iov_iter direction initializers 2023-02-09 11:28:04 +01:00
scx200_gpio.c
sonypi.c
tlclk.c
toshiba.c module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
ttyprintk.c char: ttyprintk: register console 2022-04-22 16:24:47 +02:00
uv_mmtimer.c
virtio_console.c Char/Misc and other driver updates for 5.18-rc1 2022-03-28 12:27:35 -07:00