linux-stable/drivers
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
..
accessibility
acpi
amba
android
ata ata: libata-scsi: Avoid deadlock on rescan after device resume 2023-06-28 11:12:17 +02:00
atm
auxdisplay
base regmap: Account for register length when chunking 2023-06-09 10:34:28 +02:00
bcma
block xen/blkfront: Only check REQ_FUA for writes 2023-06-21 16:00:53 +02:00
bluetooth Bluetooth: hci_qca: fix debugfs registration 2023-06-14 11:15:28 +02:00
bus
cdrom
char tpm_crb: Add support for CRB devices based on Pluton 2023-06-28 11:12:17 +02:00
clk clk: pxa: fix NULL pointer dereference in pxa3xx_clk_update_accr 2023-06-21 16:00:57 +02:00
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma
dma-buf
edac EDAC/qcom: Get rid of hardcoded register offsets 2023-06-21 16:00:51 +02:00
eisa
extcon
firewire
firmware firmware: arm_ffa: Set handle field to zero in memory descriptor 2023-06-14 11:15:31 +02:00
fpga
fsi
gnss
gpio gpio: sim: fix memory corruption when adding named lines and unnamed hogs 2023-06-14 11:15:31 +02:00
gpu drm/amd/display: fix the system hang while disable PSR 2023-06-28 11:12:16 +02:00
greybus
hid
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c i2c: sprd: Delete i2c adapter in .remove's error path 2023-06-14 11:15:32 +02:00
i3c
idle
iio
infiniband IB/isert: Fix incorrect release of isert connection 2023-06-21 16:01:00 +02:00
input Input: fix open count when closing inhibited device 2023-06-14 11:15:23 +02:00
interconnect
iommu iommu/amd/pgtbl_v2: Fix domain max address 2023-06-09 10:34:28 +02:00
ipack
irqchip irqchip/gic: Correctly validate OF quirk descriptors 2023-06-21 16:00:54 +02:00
isdn
leds
macintosh
mailbox
mcb
md dm: don't lock fs when the map is NULL during suspend or resume 2023-06-21 16:01:02 +02:00
media
memory
memstick
message
mfd
misc eeprom: at24: also select REGMAP 2023-06-14 11:15:32 +02:00
mmc
most
mtd
mux
net octeon_ep: Add missing check for ioremap 2023-06-21 16:01:02 +02:00
nfc
ntb
nubus
nvdimm
nvme NVMe: Add MAXIO 1602 to bogus nid list. 2023-06-21 16:00:54 +02:00
nvmem
of of: overlay: Fix missing of_node_put() in error case of init_overlay_changeset() 2023-06-21 16:00:51 +02:00
opp
parisc
parport
pci PCI/DPC: Quirk PIO log size for Intel Ice Lake Root Ports 2023-06-21 16:00:52 +02:00
pcmcia
peci
perf
phy
pinctrl pinctrl: meson-axg: add missing GPIOA_18 gpio group 2023-06-14 11:15:28 +02:00
platform platform/x86: asus-wmi: Ignore WMI events with codes 0x7B, 0xC0 2023-06-21 16:00:52 +02:00
pnp
power power: supply: Fix logic checking if system is running from battery 2023-06-21 16:00:52 +02:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: Fix error checking for debugfs_create_dir 2023-06-21 16:00:52 +02:00
remoteproc
reset
rpmsg
rtc
s390 s390/dasd: Use correct lock while counting channel queue length 2023-06-14 11:15:27 +02:00
sbus
scsi scsi: megaraid_sas: Add flexible array member for SGLs 2023-06-14 11:15:15 +02:00
sh
siox
slimbus
soc qcom: llcc/edac: Fix the base address used for accessing LLCC banks 2023-06-21 16:00:51 +02:00
soundwire soundwire: stream: Add missing clear of alloc_slave_rt 2023-06-14 11:15:32 +02:00
spi spi: fsl-dspi: avoid SCK glitches with continuous transfers 2023-06-21 16:00:58 +02:00
spmi
ssb
staging Revert "staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE" 2023-06-14 11:15:34 +02:00
target scsi: target: core: Fix error path in target_setup_session() 2023-06-21 16:01:03 +02:00
tc
tee tee: amdtee: Add return_origin to 'struct tee_cmd_load_ta' 2023-06-14 11:15:28 +02:00
thermal
thunderbolt thunderbolt: Mask ring interrupt on Intel hardware as well 2023-06-21 16:00:56 +02:00
tty tty: serial: fsl_lpuart: reduce RX watermark to 0 on LS1028A 2023-06-28 11:12:17 +02:00
ufs
uio
usb usb: dwc3: gadget: Reset num TRBs before giving back the request 2023-06-21 16:00:57 +02:00
vdpa vduse: avoid empty string for dev name 2023-06-14 11:15:32 +02:00
vfio
vhost vhost_vdpa: support PACKED when setting-getting vring_base 2023-06-14 11:15:33 +02:00
video
virt
virtio
vlynq
w1
watchdog
xen
zorro
Kconfig
Makefile