linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/9] Export platform features from ccp driver
@ 2023-03-03 16:50 Mario Limonciello
  2023-03-03 16:50 ` [PATCH v3 1/9] crypto: ccp: Drop TEE support for IRQ handler Mario Limonciello
                   ` (9 more replies)
  0 siblings, 10 replies; 18+ messages in thread
From: Mario Limonciello @ 2023-03-03 16:50 UTC (permalink / raw)
  To: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Andy Shevchenko, Mika Westerberg, kvm, linux-crypto, linux-i2c
  Cc: Mario Limonciello, H. Peter Anvin, Sumit Garg, linux-kernel, op-tee

The i2c-designware-amdpsp driver communicates with a platform
features mailbox provided by the PSP.  The address used for
communication is discovered via a non-architecturally
guaranteed mechanism.

To better scale, export a feature for communication with platform
features directly from the ccp driver.

v2->v3:
 * Split new ACPI ID to own patch
 * Squash doorbell offsets into doorbell patch
 * Fix all feedback from v2 (see individual patches for details)
Mario Limonciello (9):
  crypto: ccp: Drop TEE support for IRQ handler
  crypto: ccp: Add a header for multiple drivers to use `__psp_pa`
  crypto: ccp: Move some PSP mailbox bit definitions into common header
  crypto: ccp: Add support for an interface for platform features
  crypto: ccp: Enable platform access interface on client PSP parts
  i2c: designware: Use PCI PSP driver for communication
  crypto: ccp: Add support for ringing a platform doorbell
  i2c: designware: Add doorbell support for Skyrim
  i2c: designware: Add support for AMDI0020 ACPI ID

 arch/x86/kvm/svm/sev.c                      |   1 +
 drivers/crypto/ccp/Makefile                 |   3 +-
 drivers/crypto/ccp/platform-access.c        | 218 ++++++++++++++++++++
 drivers/crypto/ccp/platform-access.h        |  35 ++++
 drivers/crypto/ccp/psp-dev.c                |  32 +--
 drivers/crypto/ccp/psp-dev.h                |  11 +-
 drivers/crypto/ccp/sev-dev.c                |  16 +-
 drivers/crypto/ccp/sev-dev.h                |   2 +-
 drivers/crypto/ccp/sp-dev.h                 |  10 +
 drivers/crypto/ccp/sp-pci.c                 |   9 +
 drivers/crypto/ccp/tee-dev.c                |  17 +-
 drivers/i2c/busses/Kconfig                  |   2 +-
 drivers/i2c/busses/i2c-designware-amdpsp.c  | 179 +++-------------
 drivers/i2c/busses/i2c-designware-core.h    |   1 -
 drivers/i2c/busses/i2c-designware-platdrv.c |   2 +-
 drivers/tee/amdtee/call.c                   |   2 +-
 drivers/tee/amdtee/shm_pool.c               |   2 +-
 include/linux/psp-platform-access.h         |  65 ++++++
 include/linux/psp-sev.h                     |   8 -
 include/linux/psp.h                         |  29 +++
 20 files changed, 438 insertions(+), 206 deletions(-)
 create mode 100644 drivers/crypto/ccp/platform-access.c
 create mode 100644 drivers/crypto/ccp/platform-access.h
 create mode 100644 include/linux/psp-platform-access.h
 create mode 100644 include/linux/psp.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v3 1/9] crypto: ccp: Drop TEE support for IRQ handler
  2023-03-03 16:50 [PATCH v3 0/9] Export platform features from ccp driver Mario Limonciello
@ 2023-03-03 16:50 ` Mario Limonciello
  2023-03-03 16:50 ` [PATCH v3 2/9] crypto: ccp: Add a header for multiple drivers to use `__psp_pa` Mario Limonciello
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 18+ messages in thread
From: Mario Limonciello @ 2023-03-03 16:50 UTC (permalink / raw)
  To: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Tom Lendacky, John Allen
  Cc: Mario Limonciello, David S. Miller, linux-crypto, linux-kernel

The only PSP mailbox that currently supports interrupt on completion
is the SEV mailbox.  Drop the dead code for the TEE subdriver to
potentially call it.

Acked-by: Rijo Thomas <Rijo-john.Thomas@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v2->v3:
 * Pick up tags
---
 drivers/crypto/ccp/psp-dev.c | 15 ---------------
 drivers/crypto/ccp/psp-dev.h |  7 -------
 2 files changed, 22 deletions(-)

diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c
index c9c741ac8442..cd8d1974726a 100644
--- a/drivers/crypto/ccp/psp-dev.c
+++ b/drivers/crypto/ccp/psp-dev.c
@@ -46,9 +46,6 @@ static irqreturn_t psp_irq_handler(int irq, void *data)
 	if (status) {
 		if (psp->sev_irq_handler)
 			psp->sev_irq_handler(irq, psp->sev_irq_data, status);
-
-		if (psp->tee_irq_handler)
-			psp->tee_irq_handler(irq, psp->tee_irq_data, status);
 	}
 
 	/* Clear the interrupt status by writing the same value we read. */
@@ -219,18 +216,6 @@ void psp_clear_sev_irq_handler(struct psp_device *psp)
 	psp_set_sev_irq_handler(psp, NULL, NULL);
 }
 
-void psp_set_tee_irq_handler(struct psp_device *psp, psp_irq_handler_t handler,
-			     void *data)
-{
-	psp->tee_irq_data = data;
-	psp->tee_irq_handler = handler;
-}
-
-void psp_clear_tee_irq_handler(struct psp_device *psp)
-{
-	psp_set_tee_irq_handler(psp, NULL, NULL);
-}
-
 struct psp_device *psp_get_master_device(void)
 {
 	struct sp_device *sp = sp_get_psp_master_device();
diff --git a/drivers/crypto/ccp/psp-dev.h b/drivers/crypto/ccp/psp-dev.h
index d528eb04c3ef..06e1f317216d 100644
--- a/drivers/crypto/ccp/psp-dev.h
+++ b/drivers/crypto/ccp/psp-dev.h
@@ -40,9 +40,6 @@ struct psp_device {
 	psp_irq_handler_t sev_irq_handler;
 	void *sev_irq_data;
 
-	psp_irq_handler_t tee_irq_handler;
-	void *tee_irq_data;
-
 	void *sev_data;
 	void *tee_data;
 
@@ -53,10 +50,6 @@ void psp_set_sev_irq_handler(struct psp_device *psp, psp_irq_handler_t handler,
 			     void *data);
 void psp_clear_sev_irq_handler(struct psp_device *psp);
 
-void psp_set_tee_irq_handler(struct psp_device *psp, psp_irq_handler_t handler,
-			     void *data);
-void psp_clear_tee_irq_handler(struct psp_device *psp);
-
 struct psp_device *psp_get_master_device(void);
 
 #define PSP_CAPABILITY_SEV			BIT(0)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v3 2/9] crypto: ccp: Add a header for multiple drivers to use `__psp_pa`
  2023-03-03 16:50 [PATCH v3 0/9] Export platform features from ccp driver Mario Limonciello
  2023-03-03 16:50 ` [PATCH v3 1/9] crypto: ccp: Drop TEE support for IRQ handler Mario Limonciello
@ 2023-03-03 16:50 ` Mario Limonciello
  2023-03-07 23:42   ` Sean Christopherson
  2023-03-03 16:50 ` [PATCH v3 3/9] crypto: ccp: Move some PSP mailbox bit definitions into common header Mario Limonciello
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 18+ messages in thread
From: Mario Limonciello @ 2023-03-03 16:50 UTC (permalink / raw)
  To: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Sean Christopherson, Paolo Bonzini, Brijesh Singh, Tom Lendacky,
	John Allen, Jarkko Nikula, Andy Shevchenko, Mika Westerberg
  Cc: Mario Limonciello, Sumit Garg, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
	David S. Miller, Jens Wiklander, kvm, linux-kernel, linux-crypto,
	linux-i2c, op-tee

The TEE subdriver for CCP, the amdtee driver and the i2c-designware-amdpsp
drivers all include `psp-sev.h` even though they don't use SEV
functionality.

Move the definition of `__psp_pa` into a common header to be included
by all of these drivers.

Reviewed-by: Jan Dabros <jsd@semihalf.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> # For the drivers/i2c/busses/i2c-designware-amdpsp.c
Acked-by: Sumit Garg <sumit.garg@linaro.org> # For TEE subsystem bits
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v1->v2:
 * Add tags
---
 arch/x86/kvm/svm/sev.c                     |  1 +
 drivers/crypto/ccp/sev-dev.c               |  1 +
 drivers/crypto/ccp/tee-dev.c               |  2 +-
 drivers/i2c/busses/i2c-designware-amdpsp.c |  2 +-
 drivers/tee/amdtee/call.c                  |  2 +-
 drivers/tee/amdtee/shm_pool.c              |  2 +-
 include/linux/psp-sev.h                    |  8 --------
 include/linux/psp.h                        | 14 ++++++++++++++
 8 files changed, 20 insertions(+), 12 deletions(-)
 create mode 100644 include/linux/psp.h

diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
index c25aeb550cd9..ec18a756b7c9 100644
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -12,6 +12,7 @@
 #include <linux/kvm_host.h>
 #include <linux/kernel.h>
 #include <linux/highmem.h>
+#include <linux/psp.h>
 #include <linux/psp-sev.h>
 #include <linux/pagemap.h>
 #include <linux/swap.h>
diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c
index e2f25926eb51..28945ca7c856 100644
--- a/drivers/crypto/ccp/sev-dev.c
+++ b/drivers/crypto/ccp/sev-dev.c
@@ -24,6 +24,7 @@
 #include <linux/cpufeature.h>
 #include <linux/fs.h>
 #include <linux/fs_struct.h>
+#include <linux/psp.h>
 
 #include <asm/smp.h>
 #include <asm/cacheflush.h>
diff --git a/drivers/crypto/ccp/tee-dev.c b/drivers/crypto/ccp/tee-dev.c
index 5c9d47f3be37..f24fc953718a 100644
--- a/drivers/crypto/ccp/tee-dev.c
+++ b/drivers/crypto/ccp/tee-dev.c
@@ -13,7 +13,7 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/gfp.h>
-#include <linux/psp-sev.h>
+#include <linux/psp.h>
 #include <linux/psp-tee.h>
 
 #include "psp-dev.h"
diff --git a/drivers/i2c/busses/i2c-designware-amdpsp.c b/drivers/i2c/busses/i2c-designware-amdpsp.c
index 8f36167bce62..80f28a1bbbef 100644
--- a/drivers/i2c/busses/i2c-designware-amdpsp.c
+++ b/drivers/i2c/busses/i2c-designware-amdpsp.c
@@ -4,7 +4,7 @@
 #include <linux/bits.h>
 #include <linux/i2c.h>
 #include <linux/io-64-nonatomic-lo-hi.h>
-#include <linux/psp-sev.h>
+#include <linux/psp.h>
 #include <linux/types.h>
 #include <linux/workqueue.h>
 
diff --git a/drivers/tee/amdtee/call.c b/drivers/tee/amdtee/call.c
index cec6e70f0ac9..e8cd9aaa3467 100644
--- a/drivers/tee/amdtee/call.c
+++ b/drivers/tee/amdtee/call.c
@@ -8,7 +8,7 @@
 #include <linux/tee_drv.h>
 #include <linux/psp-tee.h>
 #include <linux/slab.h>
-#include <linux/psp-sev.h>
+#include <linux/psp.h>
 #include "amdtee_if.h"
 #include "amdtee_private.h"
 
diff --git a/drivers/tee/amdtee/shm_pool.c b/drivers/tee/amdtee/shm_pool.c
index f87f96a291c9..f0303126f199 100644
--- a/drivers/tee/amdtee/shm_pool.c
+++ b/drivers/tee/amdtee/shm_pool.c
@@ -5,7 +5,7 @@
 
 #include <linux/slab.h>
 #include <linux/tee_drv.h>
-#include <linux/psp-sev.h>
+#include <linux/psp.h>
 #include "amdtee_private.h"
 
 static int pool_op_alloc(struct tee_shm_pool *pool, struct tee_shm *shm,
diff --git a/include/linux/psp-sev.h b/include/linux/psp-sev.h
index 1595088c428b..7fd17e82bab4 100644
--- a/include/linux/psp-sev.h
+++ b/include/linux/psp-sev.h
@@ -14,14 +14,6 @@
 
 #include <uapi/linux/psp-sev.h>
 
-#ifdef CONFIG_X86
-#include <linux/mem_encrypt.h>
-
-#define __psp_pa(x)	__sme_pa(x)
-#else
-#define __psp_pa(x)	__pa(x)
-#endif
-
 #define SEV_FW_BLOB_MAX_SIZE	0x4000	/* 16KB */
 
 /**
diff --git a/include/linux/psp.h b/include/linux/psp.h
new file mode 100644
index 000000000000..202162487ec3
--- /dev/null
+++ b/include/linux/psp.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __PSP_H
+#define __PSP_H
+
+#ifdef CONFIG_X86
+#include <linux/mem_encrypt.h>
+
+#define __psp_pa(x)	__sme_pa(x)
+#else
+#define __psp_pa(x)	__pa(x)
+#endif
+
+#endif /* __PSP_H */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v3 3/9] crypto: ccp: Move some PSP mailbox bit definitions into common header
  2023-03-03 16:50 [PATCH v3 0/9] Export platform features from ccp driver Mario Limonciello
  2023-03-03 16:50 ` [PATCH v3 1/9] crypto: ccp: Drop TEE support for IRQ handler Mario Limonciello
  2023-03-03 16:50 ` [PATCH v3 2/9] crypto: ccp: Add a header for multiple drivers to use `__psp_pa` Mario Limonciello
@ 2023-03-03 16:50 ` Mario Limonciello
  2023-03-03 16:50 ` [PATCH v3 4/9] crypto: ccp: Add support for an interface for platform features Mario Limonciello
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 18+ messages in thread
From: Mario Limonciello @ 2023-03-03 16:50 UTC (permalink / raw)
  To: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Tom Lendacky, John Allen, Brijesh Singh, Jarkko Nikula,
	Andy Shevchenko, Mika Westerberg
  Cc: Mario Limonciello, David S. Miller, linux-crypto, linux-kernel,
	linux-i2c

Some of the bits and fields used for mailboxes communicating with the
PSP are common across all mailbox implementations (SEV, TEE, etc).

Move these bits into the common `linux/psp.h` so they don't need to
be re-defined for each implementation.

Acked-by: Rijo Thomas <Rijo-john.Thomas@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v2->v3:
 * Pick up tags
v1->v2:
 * Update comment to indicate it's PSP response not PSP ready
---
 drivers/crypto/ccp/psp-dev.h               |  3 ---
 drivers/crypto/ccp/sev-dev.c               | 15 +++++++--------
 drivers/crypto/ccp/sev-dev.h               |  2 +-
 drivers/crypto/ccp/tee-dev.c               | 15 ++++++++-------
 drivers/i2c/busses/i2c-designware-amdpsp.c | 16 +++++-----------
 include/linux/psp.h                        | 12 ++++++++++++
 6 files changed, 33 insertions(+), 30 deletions(-)

diff --git a/drivers/crypto/ccp/psp-dev.h b/drivers/crypto/ccp/psp-dev.h
index 06e1f317216d..55f54bb2b3fb 100644
--- a/drivers/crypto/ccp/psp-dev.h
+++ b/drivers/crypto/ccp/psp-dev.h
@@ -17,9 +17,6 @@
 
 #include "sp-dev.h"
 
-#define PSP_CMDRESP_RESP		BIT(31)
-#define PSP_CMDRESP_ERR_MASK		0xffff
-
 #define MAX_PSP_NAME_LEN		16
 
 extern struct psp_device *psp_master;
diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c
index 28945ca7c856..6440d35dfa4e 100644
--- a/drivers/crypto/ccp/sev-dev.c
+++ b/drivers/crypto/ccp/sev-dev.c
@@ -7,6 +7,7 @@
  * Author: Brijesh Singh <brijesh.singh@amd.com>
  */
 
+#include <linux/bitfield.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/kthread.h>
@@ -103,7 +104,7 @@ static void sev_irq_handler(int irq, void *data, unsigned int status)
 
 	/* Check if it is SEV command completion: */
 	reg = ioread32(sev->io_regs + sev->vdata->cmdresp_reg);
-	if (reg & PSP_CMDRESP_RESP) {
+	if (FIELD_GET(PSP_CMDRESP_RESP, reg)) {
 		sev->int_rcvd = 1;
 		wake_up(&sev->int_queue);
 	}
@@ -347,9 +348,7 @@ static int __sev_do_cmd_locked(int cmd, void *data, int *psp_ret)
 
 	sev->int_rcvd = 0;
 
-	reg = cmd;
-	reg <<= SEV_CMDRESP_CMD_SHIFT;
-	reg |= SEV_CMDRESP_IOC;
+	reg = FIELD_PREP(SEV_CMDRESP_CMD, cmd) | SEV_CMDRESP_IOC;
 	iowrite32(reg, sev->io_regs + sev->vdata->cmdresp_reg);
 
 	/* wait for command completion */
@@ -367,11 +366,11 @@ static int __sev_do_cmd_locked(int cmd, void *data, int *psp_ret)
 	psp_timeout = psp_cmd_timeout;
 
 	if (psp_ret)
-		*psp_ret = reg & PSP_CMDRESP_ERR_MASK;
+		*psp_ret = FIELD_GET(PSP_CMDRESP_STS, reg);
 
-	if (reg & PSP_CMDRESP_ERR_MASK) {
-		dev_dbg(sev->dev, "sev command %#x failed (%#010x)\n",
-			cmd, reg & PSP_CMDRESP_ERR_MASK);
+	if (FIELD_GET(PSP_CMDRESP_STS, reg)) {
+		dev_dbg(sev->dev, "sev command %#x failed (%#010lx)\n",
+			cmd, FIELD_GET(PSP_CMDRESP_STS, reg));
 		ret = -EIO;
 	} else {
 		ret = sev_write_init_ex_file_if_required(cmd);
diff --git a/drivers/crypto/ccp/sev-dev.h b/drivers/crypto/ccp/sev-dev.h
index 666c21eb81ab..778c95155e74 100644
--- a/drivers/crypto/ccp/sev-dev.h
+++ b/drivers/crypto/ccp/sev-dev.h
@@ -25,8 +25,8 @@
 #include <linux/miscdevice.h>
 #include <linux/capability.h>
 
+#define SEV_CMDRESP_CMD			GENMASK(26, 16)
 #define SEV_CMD_COMPLETE		BIT(1)
-#define SEV_CMDRESP_CMD_SHIFT		16
 #define SEV_CMDRESP_IOC			BIT(0)
 
 struct sev_misc_dev {
diff --git a/drivers/crypto/ccp/tee-dev.c b/drivers/crypto/ccp/tee-dev.c
index f24fc953718a..5560bf8329a1 100644
--- a/drivers/crypto/ccp/tee-dev.c
+++ b/drivers/crypto/ccp/tee-dev.c
@@ -8,6 +8,7 @@
  * Copyright (C) 2019,2021 Advanced Micro Devices, Inc.
  */
 
+#include <linux/bitfield.h>
 #include <linux/types.h>
 #include <linux/mutex.h>
 #include <linux/delay.h>
@@ -69,7 +70,7 @@ static int tee_wait_cmd_poll(struct psp_tee_device *tee, unsigned int timeout,
 
 	while (--nloop) {
 		*reg = ioread32(tee->io_regs + tee->vdata->cmdresp_reg);
-		if (*reg & PSP_CMDRESP_RESP)
+		if (FIELD_GET(PSP_CMDRESP_RESP, *reg))
 			return 0;
 
 		usleep_range(10000, 10100);
@@ -149,9 +150,9 @@ static int tee_init_ring(struct psp_tee_device *tee)
 		goto free_buf;
 	}
 
-	if (reg & PSP_CMDRESP_ERR_MASK) {
-		dev_err(tee->dev, "tee: ring init command failed (%#010x)\n",
-			reg & PSP_CMDRESP_ERR_MASK);
+	if (FIELD_GET(PSP_CMDRESP_STS, reg)) {
+		dev_err(tee->dev, "tee: ring init command failed (%#010lx)\n",
+			FIELD_GET(PSP_CMDRESP_STS, reg));
 		tee_free_ring(tee);
 		ret = -EIO;
 	}
@@ -179,9 +180,9 @@ static void tee_destroy_ring(struct psp_tee_device *tee)
 	ret = tee_wait_cmd_poll(tee, TEE_DEFAULT_TIMEOUT, &reg);
 	if (ret) {
 		dev_err(tee->dev, "tee: ring destroy command timed out\n");
-	} else if (reg & PSP_CMDRESP_ERR_MASK) {
-		dev_err(tee->dev, "tee: ring destroy command failed (%#010x)\n",
-			reg & PSP_CMDRESP_ERR_MASK);
+	} else if (FIELD_GET(PSP_CMDRESP_STS, reg)) {
+		dev_err(tee->dev, "tee: ring destroy command failed (%#010lx)\n",
+			FIELD_GET(PSP_CMDRESP_STS, reg));
 	}
 
 free_ring:
diff --git a/drivers/i2c/busses/i2c-designware-amdpsp.c b/drivers/i2c/busses/i2c-designware-amdpsp.c
index 80f28a1bbbef..652e6b64bd5f 100644
--- a/drivers/i2c/busses/i2c-designware-amdpsp.c
+++ b/drivers/i2c/busses/i2c-designware-amdpsp.c
@@ -25,12 +25,6 @@
 #define PSP_I2C_REQ_STS_BUS_BUSY	0x1
 #define PSP_I2C_REQ_STS_INV_PARAM	0x3
 
-#define PSP_MBOX_FIELDS_STS		GENMASK(15, 0)
-#define PSP_MBOX_FIELDS_CMD		GENMASK(23, 16)
-#define PSP_MBOX_FIELDS_RESERVED	GENMASK(29, 24)
-#define PSP_MBOX_FIELDS_RECOVERY	BIT(30)
-#define PSP_MBOX_FIELDS_READY		BIT(31)
-
 struct psp_req_buffer_hdr {
 	u32 total_size;
 	u32 status;
@@ -99,15 +93,15 @@ static int psp_check_mbox_recovery(struct psp_mbox __iomem *mbox)
 
 	tmp = readl(&mbox->cmd_fields);
 
-	return FIELD_GET(PSP_MBOX_FIELDS_RECOVERY, tmp);
+	return FIELD_GET(PSP_CMDRESP_RECOVERY, tmp);
 }
 
 static int psp_wait_cmd(struct psp_mbox __iomem *mbox)
 {
 	u32 tmp, expected;
 
-	/* Expect mbox_cmd to be cleared and ready bit to be set by PSP */
-	expected = FIELD_PREP(PSP_MBOX_FIELDS_READY, 1);
+	/* Expect mbox_cmd to be cleared and the response bit to be set by PSP */
+	expected = FIELD_PREP(PSP_CMDRESP_RESP, 1);
 
 	/*
 	 * Check for readiness of PSP mailbox in a tight loop in order to
@@ -124,7 +118,7 @@ static u32 psp_check_mbox_sts(struct psp_mbox __iomem *mbox)
 
 	cmd_reg = readl(&mbox->cmd_fields);
 
-	return FIELD_GET(PSP_MBOX_FIELDS_STS, cmd_reg);
+	return FIELD_GET(PSP_CMDRESP_STS, cmd_reg);
 }
 
 static int psp_send_cmd(struct psp_i2c_req *req)
@@ -148,7 +142,7 @@ static int psp_send_cmd(struct psp_i2c_req *req)
 	writeq(req_addr, &mbox->i2c_req_addr);
 
 	/* Write command register to trigger processing */
-	cmd_reg = FIELD_PREP(PSP_MBOX_FIELDS_CMD, PSP_I2C_REQ_BUS_CMD);
+	cmd_reg = FIELD_PREP(PSP_CMDRESP_CMD, PSP_I2C_REQ_BUS_CMD);
 	writel(cmd_reg, &mbox->cmd_fields);
 
 	if (psp_wait_cmd(mbox))
diff --git a/include/linux/psp.h b/include/linux/psp.h
index 202162487ec3..d3424790a70e 100644
--- a/include/linux/psp.h
+++ b/include/linux/psp.h
@@ -11,4 +11,16 @@
 #define __psp_pa(x)	__pa(x)
 #endif
 
+/*
+ * Fields and bits used by most PSP mailboxes
+ *
+ * Note: Some mailboxes (such as SEV) have extra bits or different meanings
+ * and should include an appropriate local definition in their source file.
+ */
+#define PSP_CMDRESP_STS		GENMASK(15, 0)
+#define PSP_CMDRESP_CMD		GENMASK(23, 16)
+#define PSP_CMDRESP_RESERVED	GENMASK(29, 24)
+#define PSP_CMDRESP_RECOVERY	BIT(30)
+#define PSP_CMDRESP_RESP	BIT(31)
+
 #endif /* __PSP_H */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v3 4/9] crypto: ccp: Add support for an interface for platform features
  2023-03-03 16:50 [PATCH v3 0/9] Export platform features from ccp driver Mario Limonciello
                   ` (2 preceding siblings ...)
  2023-03-03 16:50 ` [PATCH v3 3/9] crypto: ccp: Move some PSP mailbox bit definitions into common header Mario Limonciello
@ 2023-03-03 16:50 ` Mario Limonciello
  2023-03-03 16:50 ` [PATCH v3 5/9] crypto: ccp: Enable platform access interface on client PSP parts Mario Limonciello
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 18+ messages in thread
From: Mario Limonciello @ 2023-03-03 16:50 UTC (permalink / raw)
  To: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Tom Lendacky, John Allen
  Cc: Mario Limonciello, David S. Miller, linux-kernel, linux-crypto

Some platforms with a PSP support an interface for features that
interact directly with the PSP instead of through a SEV or TEE
environment.

Initialize this interface so that other drivers can consume it.
These drivers may either be subdrivers for the ccp module or
external modules.  For external modules, export a symbol for them
to utilize.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v2->v3:
 * Drop safety check
 * Rename mutex
 * Add unique messages
v1->v2:
 * Fix comment text
 * Add safety check that register values were populated
---
 drivers/crypto/ccp/Makefile          |   3 +-
 drivers/crypto/ccp/platform-access.c | 166 +++++++++++++++++++++++++++
 drivers/crypto/ccp/platform-access.h |  34 ++++++
 drivers/crypto/ccp/psp-dev.c         |  17 +++
 drivers/crypto/ccp/psp-dev.h         |   1 +
 drivers/crypto/ccp/sp-dev.h          |   7 ++
 include/linux/psp-platform-access.h  |  49 ++++++++
 7 files changed, 276 insertions(+), 1 deletion(-)
 create mode 100644 drivers/crypto/ccp/platform-access.c
 create mode 100644 drivers/crypto/ccp/platform-access.h
 create mode 100644 include/linux/psp-platform-access.h

diff --git a/drivers/crypto/ccp/Makefile b/drivers/crypto/ccp/Makefile
index db362fe472ea..f6196495e862 100644
--- a/drivers/crypto/ccp/Makefile
+++ b/drivers/crypto/ccp/Makefile
@@ -10,7 +10,8 @@ ccp-$(CONFIG_CRYPTO_DEV_CCP_DEBUGFS) += ccp-debugfs.o
 ccp-$(CONFIG_PCI) += sp-pci.o
 ccp-$(CONFIG_CRYPTO_DEV_SP_PSP) += psp-dev.o \
                                    sev-dev.o \
-                                   tee-dev.o
+                                   tee-dev.o \
+                                   platform-access.o
 
 obj-$(CONFIG_CRYPTO_DEV_CCP_CRYPTO) += ccp-crypto.o
 ccp-crypto-objs := ccp-crypto-main.o \
diff --git a/drivers/crypto/ccp/platform-access.c b/drivers/crypto/ccp/platform-access.c
new file mode 100644
index 000000000000..d7669a44dcfe
--- /dev/null
+++ b/drivers/crypto/ccp/platform-access.c
@@ -0,0 +1,166 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * AMD Platform Security Processor (PSP) Platform Access interface
+ *
+ * Copyright (C) 2023 Advanced Micro Devices, Inc.
+ *
+ * Author: Mario Limonciello <mario.limonciello@amd.com>
+ *
+ * Some of this code is adapted from drivers/i2c/busses/i2c-designware-amdpsp.c
+ * developed by Jan Dabros <jsd@semihalf.com> and Copyright (C) 2022 Google Inc.
+ *
+ */
+
+#include <linux/bitfield.h>
+#include <linux/errno.h>
+#include <linux/iopoll.h>
+#include <linux/mutex.h>
+
+#include "platform-access.h"
+
+#define PSP_CMD_TIMEOUT_US	(500 * USEC_PER_MSEC)
+
+/* Recovery field should be equal 0 to start sending commands */
+static int check_recovery(u32 __iomem *cmd)
+{
+	return FIELD_GET(PSP_CMDRESP_RECOVERY, ioread32(cmd));
+}
+
+static int wait_cmd(u32 __iomem *cmd)
+{
+	u32 tmp, expected;
+
+	/* Expect mbox_cmd to be cleared and ready bit to be set by PSP */
+	expected = FIELD_PREP(PSP_CMDRESP_RESP, 1);
+
+	/*
+	 * Check for readiness of PSP mailbox in a tight loop in order to
+	 * process further as soon as command was consumed.
+	 */
+	return readl_poll_timeout(cmd, tmp, (tmp & expected), 0,
+				  PSP_CMD_TIMEOUT_US);
+}
+
+int psp_check_platform_access_status(void)
+{
+	struct psp_device *psp = psp_get_master_device();
+
+	if (!psp || !psp->platform_access_data)
+		return -ENODEV;
+
+	return 0;
+}
+EXPORT_SYMBOL(psp_check_platform_access_status);
+
+int psp_send_platform_access_msg(enum psp_platform_access_msg msg,
+				 struct psp_request *req)
+{
+	struct psp_device *psp = psp_get_master_device();
+	u32 __iomem *cmd, __iomem *lo, __iomem *hi;
+	struct psp_platform_access_device *pa_dev;
+	phys_addr_t req_addr;
+	u32 cmd_reg;
+	int ret;
+
+	if (!psp || !psp->platform_access_data)
+		return -ENODEV;
+
+	pa_dev = psp->platform_access_data;
+	cmd = psp->io_regs + pa_dev->vdata->cmdresp_reg;
+	lo = psp->io_regs + pa_dev->vdata->cmdbuff_addr_lo_reg;
+	hi = psp->io_regs + pa_dev->vdata->cmdbuff_addr_hi_reg;
+
+	mutex_lock(&pa_dev->mailbox_mutex);
+
+	if (check_recovery(cmd)) {
+		dev_dbg(psp->dev, "platform mailbox is in recovery\n");
+		ret = -EBUSY;
+		goto unlock;
+	}
+
+	if (wait_cmd(cmd)) {
+		dev_dbg(psp->dev, "platform mailbox is not done processing command\n");
+		ret = -EBUSY;
+		goto unlock;
+	}
+
+	/*
+	 * Fill mailbox with address of command-response buffer, which will be
+	 * used for sending i2c requests as well as reading status returned by
+	 * PSP. Use physical address of buffer, since PSP will map this region.
+	 */
+	req_addr = __psp_pa(req);
+	iowrite32(lower_32_bits(req_addr), lo);
+	iowrite32(upper_32_bits(req_addr), hi);
+
+	print_hex_dump_debug("->psp ", DUMP_PREFIX_OFFSET, 16, 2, req,
+			     req->header.payload_size, false);
+
+	/* Write command register to trigger processing */
+	cmd_reg = FIELD_PREP(PSP_CMDRESP_CMD, msg);
+	iowrite32(cmd_reg, cmd);
+
+	if (wait_cmd(cmd)) {
+		ret = -ETIMEDOUT;
+		goto unlock;
+	}
+
+	/* Ensure it was triggered by this driver */
+	if (ioread32(lo) != lower_32_bits(req_addr) ||
+	    ioread32(hi) != upper_32_bits(req_addr)) {
+		ret = -EBUSY;
+		goto unlock;
+	}
+
+	/* Store the status in request header for caller to investigate */
+	cmd_reg = ioread32(cmd);
+	req->header.status = FIELD_GET(PSP_CMDRESP_STS, cmd_reg);
+	if (req->header.status) {
+		ret = -EIO;
+		goto unlock;
+	}
+
+	print_hex_dump_debug("<-psp ", DUMP_PREFIX_OFFSET, 16, 2, req,
+			     req->header.payload_size, false);
+
+	ret = 0;
+
+unlock:
+	mutex_unlock(&pa_dev->mailbox_mutex);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(psp_send_platform_access_msg);
+
+void platform_access_dev_destroy(struct psp_device *psp)
+{
+	struct psp_platform_access_device *pa_dev = psp->platform_access_data;
+
+	if (!pa_dev)
+		return;
+
+	mutex_destroy(&pa_dev->mailbox_mutex);
+	psp->platform_access_data = NULL;
+}
+
+int platform_access_dev_init(struct psp_device *psp)
+{
+	struct device *dev = psp->dev;
+	struct psp_platform_access_device *pa_dev;
+
+	pa_dev = devm_kzalloc(dev, sizeof(*pa_dev), GFP_KERNEL);
+	if (!pa_dev)
+		return -ENOMEM;
+
+	psp->platform_access_data = pa_dev;
+	pa_dev->psp = psp;
+	pa_dev->dev = dev;
+
+	pa_dev->vdata = (struct platform_access_vdata *)psp->vdata->platform_access;
+
+	mutex_init(&pa_dev->mailbox_mutex);
+
+	dev_dbg(dev, "platform access enabled\n");
+
+	return 0;
+}
diff --git a/drivers/crypto/ccp/platform-access.h b/drivers/crypto/ccp/platform-access.h
new file mode 100644
index 000000000000..c3a97893320d
--- /dev/null
+++ b/drivers/crypto/ccp/platform-access.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * AMD Platform Security Processor (PSP) Platform Access interface
+ *
+ * Copyright (C) 2023 Advanced Micro Devices, Inc.
+ *
+ * Author: Mario Limonciello <mario.limonciello@amd.com>
+ */
+
+#ifndef __PSP_PLATFORM_ACCESS_H__
+#define __PSP_PLATFORM_ACCESS_H__
+
+#include <linux/device.h>
+#include <linux/miscdevice.h>
+#include <linux/mutex.h>
+#include <linux/psp-platform-access.h>
+
+#include "psp-dev.h"
+
+struct psp_platform_access_device {
+	struct device *dev;
+	struct psp_device *psp;
+
+	struct platform_access_vdata *vdata;
+
+	struct mutex mailbox_mutex;
+
+	void *platform_access_data;
+};
+
+void platform_access_dev_destroy(struct psp_device *psp);
+int platform_access_dev_init(struct psp_device *psp);
+
+#endif /* __PSP_PLATFORM_ACCESS_H__ */
diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c
index cd8d1974726a..ec98f19800de 100644
--- a/drivers/crypto/ccp/psp-dev.c
+++ b/drivers/crypto/ccp/psp-dev.c
@@ -14,6 +14,7 @@
 #include "psp-dev.h"
 #include "sev-dev.h"
 #include "tee-dev.h"
+#include "platform-access.h"
 
 struct psp_device *psp_master;
 
@@ -102,6 +103,17 @@ static int psp_check_tee_support(struct psp_device *psp)
 	return 0;
 }
 
+static void psp_init_platform_access(struct psp_device *psp)
+{
+	int ret;
+
+	ret = platform_access_dev_init(psp);
+	if (ret) {
+		dev_warn(psp->dev, "platform access init failed: %d\n", ret);
+		return;
+	}
+}
+
 static int psp_init(struct psp_device *psp)
 {
 	int ret;
@@ -118,6 +130,9 @@ static int psp_init(struct psp_device *psp)
 			return ret;
 	}
 
+	if (psp->vdata->platform_access)
+		psp_init_platform_access(psp);
+
 	return 0;
 }
 
@@ -198,6 +213,8 @@ void psp_dev_destroy(struct sp_device *sp)
 
 	tee_dev_destroy(psp);
 
+	platform_access_dev_destroy(psp);
+
 	sp_free_psp_irq(sp, psp);
 
 	if (sp->clear_psp_master_device)
diff --git a/drivers/crypto/ccp/psp-dev.h b/drivers/crypto/ccp/psp-dev.h
index 55f54bb2b3fb..505e4bdeaca8 100644
--- a/drivers/crypto/ccp/psp-dev.h
+++ b/drivers/crypto/ccp/psp-dev.h
@@ -39,6 +39,7 @@ struct psp_device {
 
 	void *sev_data;
 	void *tee_data;
+	void *platform_access_data;
 
 	unsigned int capability;
 };
diff --git a/drivers/crypto/ccp/sp-dev.h b/drivers/crypto/ccp/sp-dev.h
index 20377e67f65d..5ec6c219a731 100644
--- a/drivers/crypto/ccp/sp-dev.h
+++ b/drivers/crypto/ccp/sp-dev.h
@@ -53,9 +53,16 @@ struct tee_vdata {
 	const unsigned int ring_rptr_reg;
 };
 
+struct platform_access_vdata {
+	const unsigned int cmdresp_reg;
+	const unsigned int cmdbuff_addr_lo_reg;
+	const unsigned int cmdbuff_addr_hi_reg;
+};
+
 struct psp_vdata {
 	const struct sev_vdata *sev;
 	const struct tee_vdata *tee;
+	const struct platform_access_vdata *platform_access;
 	const unsigned int feature_reg;
 	const unsigned int inten_reg;
 	const unsigned int intsts_reg;
diff --git a/include/linux/psp-platform-access.h b/include/linux/psp-platform-access.h
new file mode 100644
index 000000000000..977df5cfd494
--- /dev/null
+++ b/include/linux/psp-platform-access.h
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __PSP_PLATFORM_ACCESS_H
+#define __PSP_PLATFORM_ACCESS_H
+
+#include <linux/psp.h>
+
+enum psp_platform_access_msg {
+	PSP_CMD_NONE = 0x0,
+};
+
+struct psp_req_buffer_hdr {
+	u32 payload_size;
+	u32 status;
+} __packed;
+
+struct psp_request {
+	struct psp_req_buffer_hdr header;
+	void *buf;
+} __packed;
+
+/**
+ * psp_send_platform_access_msg() - Send a message to control platform features
+ *
+ * This function is intended to be used by drivers outside of ccp to communicate
+ * with the platform.
+ *
+ * Returns:
+ *  0:           success
+ *  -%EBUSY:     mailbox in recovery or in use
+ *  -%ENODEV:    driver not bound with PSP device
+ *  -%ETIMEDOUT: request timed out
+ *  -%EIO:       unknown error (see kernel log)
+ */
+int psp_send_platform_access_msg(enum psp_platform_access_msg, struct psp_request *req);
+
+/**
+ * psp_check_platform_access_status() - Checks whether platform features is ready
+ *
+ * This function is intended to be used by drivers outside of ccp to determine
+ * if platform features has initialized.
+ *
+ * Returns:
+ * 0          platform features is ready
+ * -%ENODEV   platform features is not ready or present
+ */
+int psp_check_platform_access_status(void);
+
+#endif /* __PSP_PLATFORM_ACCESS_H */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v3 5/9] crypto: ccp: Enable platform access interface on client PSP parts
  2023-03-03 16:50 [PATCH v3 0/9] Export platform features from ccp driver Mario Limonciello
                   ` (3 preceding siblings ...)
  2023-03-03 16:50 ` [PATCH v3 4/9] crypto: ccp: Add support for an interface for platform features Mario Limonciello
@ 2023-03-03 16:50 ` Mario Limonciello
  2023-03-03 16:50 ` [PATCH v3 6/9] i2c: designware: Use PCI PSP driver for communication Mario Limonciello
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 18+ messages in thread
From: Mario Limonciello @ 2023-03-03 16:50 UTC (permalink / raw)
  To: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Tom Lendacky, John Allen
  Cc: Mario Limonciello, David S. Miller, linux-crypto, linux-kernel

Client PSP parts support the platform access interface. Add
the register offsets so that client parts will initialize this
interface.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/crypto/ccp/sp-pci.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c
index cde33b2ac71b..18aa902eb5ce 100644
--- a/drivers/crypto/ccp/sp-pci.c
+++ b/drivers/crypto/ccp/sp-pci.c
@@ -361,6 +361,12 @@ static const struct tee_vdata teev1 = {
 	.ring_rptr_reg          = 0x10554,	/* C2PMSG_21 */
 };
 
+static const struct platform_access_vdata pa_v1 = {
+	.cmdresp_reg		= 0x10570,	/* C2PMSG_28 */
+	.cmdbuff_addr_lo_reg	= 0x10574,	/* C2PMSG_29 */
+	.cmdbuff_addr_hi_reg	= 0x10578,	/* C2PMSG_30 */
+};
+
 static const struct psp_vdata pspv1 = {
 	.sev			= &sevv1,
 	.feature_reg		= 0x105fc,	/* C2PMSG_63 */
@@ -377,6 +383,7 @@ static const struct psp_vdata pspv2 = {
 
 static const struct psp_vdata pspv3 = {
 	.tee			= &teev1,
+	.platform_access	= &pa_v1,
 	.feature_reg		= 0x109fc,	/* C2PMSG_63 */
 	.inten_reg		= 0x10690,	/* P2CMSG_INTEN */
 	.intsts_reg		= 0x10694,	/* P2CMSG_INTSTS */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v3 6/9] i2c: designware: Use PCI PSP driver for communication
  2023-03-03 16:50 [PATCH v3 0/9] Export platform features from ccp driver Mario Limonciello
                   ` (4 preceding siblings ...)
  2023-03-03 16:50 ` [PATCH v3 5/9] crypto: ccp: Enable platform access interface on client PSP parts Mario Limonciello
@ 2023-03-03 16:50 ` Mario Limonciello
  2023-03-03 16:50 ` [PATCH v3 7/9] crypto: ccp: Add support for ringing a platform doorbell Mario Limonciello
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 18+ messages in thread
From: Mario Limonciello @ 2023-03-03 16:50 UTC (permalink / raw)
  To: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Jarkko Nikula, Andy Shevchenko, Mika Westerberg
  Cc: Mario Limonciello, linux-i2c, linux-kernel

Currently the PSP semaphore communication base address is discovered
by using an MSR that is not architecturally guaranteed for future
platforms.  Also the mailbox that is utilized for communication with
the PSP may have other consumers in the kernel, so it's better to
make all communication go through a single driver.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v1->v2:
 * Fix Kconfig to use imply
 * Use IS_REACHABLE
---
 drivers/i2c/busses/Kconfig                  |   2 +-
 drivers/i2c/busses/i2c-designware-amdpsp.c  | 142 ++------------------
 drivers/i2c/busses/i2c-designware-core.h    |   1 -
 drivers/i2c/busses/i2c-designware-platdrv.c |   1 -
 include/linux/psp-platform-access.h         |   1 +
 5 files changed, 11 insertions(+), 136 deletions(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 9b8e84f20604..a24534d5877a 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -566,9 +566,9 @@ config I2C_DESIGNWARE_PLATFORM
 
 config I2C_DESIGNWARE_AMDPSP
 	bool "AMD PSP I2C semaphore support"
-	depends on X86_MSR
 	depends on ACPI
 	depends on I2C_DESIGNWARE_PLATFORM
+	imply CRYPTO_DEV_SP_PSP
 	help
 	  This driver enables managed host access to the selected I2C bus shared
 	  between AMD CPU and AMD PSP.
diff --git a/drivers/i2c/busses/i2c-designware-amdpsp.c b/drivers/i2c/busses/i2c-designware-amdpsp.c
index 652e6b64bd5f..105584abcf8f 100644
--- a/drivers/i2c/busses/i2c-designware-amdpsp.c
+++ b/drivers/i2c/busses/i2c-designware-amdpsp.c
@@ -1,11 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
 
-#include <linux/bitfield.h>
-#include <linux/bits.h>
 #include <linux/i2c.h>
-#include <linux/io-64-nonatomic-lo-hi.h>
+#include <linux/psp-platform-access.h>
 #include <linux/psp.h>
-#include <linux/types.h>
 #include <linux/workqueue.h>
 
 #include <asm/msr.h>
@@ -13,23 +10,15 @@
 #include "i2c-designware-core.h"
 
 #define MSR_AMD_PSP_ADDR	0xc00110a2
-#define PSP_MBOX_OFFSET		0x10570
-#define PSP_CMD_TIMEOUT_US	(500 * USEC_PER_MSEC)
 
 #define PSP_I2C_RESERVATION_TIME_MS 100
 
-#define PSP_I2C_REQ_BUS_CMD		0x64
 #define PSP_I2C_REQ_RETRY_CNT		400
 #define PSP_I2C_REQ_RETRY_DELAY_US	(25 * USEC_PER_MSEC)
 #define PSP_I2C_REQ_STS_OK		0x0
 #define PSP_I2C_REQ_STS_BUS_BUSY	0x1
 #define PSP_I2C_REQ_STS_INV_PARAM	0x3
 
-struct psp_req_buffer_hdr {
-	u32 total_size;
-	u32 status;
-};
-
 enum psp_i2c_req_type {
 	PSP_I2C_REQ_ACQUIRE,
 	PSP_I2C_REQ_RELEASE,
@@ -41,119 +30,12 @@ struct psp_i2c_req {
 	enum psp_i2c_req_type type;
 };
 
-struct psp_mbox {
-	u32 cmd_fields;
-	u64 i2c_req_addr;
-} __packed;
-
 static DEFINE_MUTEX(psp_i2c_access_mutex);
 static unsigned long psp_i2c_sem_acquired;
-static void __iomem *mbox_iomem;
 static u32 psp_i2c_access_count;
 static bool psp_i2c_mbox_fail;
 static struct device *psp_i2c_dev;
 
-/*
- * Implementation of PSP-x86 i2c-arbitration mailbox introduced for AMD Cezanne
- * family of SoCs.
- */
-
-static int psp_get_mbox_addr(unsigned long *mbox_addr)
-{
-	unsigned long long psp_mmio;
-
-	if (rdmsrl_safe(MSR_AMD_PSP_ADDR, &psp_mmio))
-		return -EIO;
-
-	*mbox_addr = (unsigned long)(psp_mmio + PSP_MBOX_OFFSET);
-
-	return 0;
-}
-
-static int psp_mbox_probe(void)
-{
-	unsigned long mbox_addr;
-	int ret;
-
-	ret = psp_get_mbox_addr(&mbox_addr);
-	if (ret)
-		return ret;
-
-	mbox_iomem = ioremap(mbox_addr, sizeof(struct psp_mbox));
-	if (!mbox_iomem)
-		return -ENOMEM;
-
-	return 0;
-}
-
-/* Recovery field should be equal 0 to start sending commands */
-static int psp_check_mbox_recovery(struct psp_mbox __iomem *mbox)
-{
-	u32 tmp;
-
-	tmp = readl(&mbox->cmd_fields);
-
-	return FIELD_GET(PSP_CMDRESP_RECOVERY, tmp);
-}
-
-static int psp_wait_cmd(struct psp_mbox __iomem *mbox)
-{
-	u32 tmp, expected;
-
-	/* Expect mbox_cmd to be cleared and the response bit to be set by PSP */
-	expected = FIELD_PREP(PSP_CMDRESP_RESP, 1);
-
-	/*
-	 * Check for readiness of PSP mailbox in a tight loop in order to
-	 * process further as soon as command was consumed.
-	 */
-	return readl_poll_timeout(&mbox->cmd_fields, tmp, (tmp == expected),
-				  0, PSP_CMD_TIMEOUT_US);
-}
-
-/* Status equal to 0 means that PSP succeed processing command */
-static u32 psp_check_mbox_sts(struct psp_mbox __iomem *mbox)
-{
-	u32 cmd_reg;
-
-	cmd_reg = readl(&mbox->cmd_fields);
-
-	return FIELD_GET(PSP_CMDRESP_STS, cmd_reg);
-}
-
-static int psp_send_cmd(struct psp_i2c_req *req)
-{
-	struct psp_mbox __iomem *mbox = mbox_iomem;
-	phys_addr_t req_addr;
-	u32 cmd_reg;
-
-	if (psp_check_mbox_recovery(mbox))
-		return -EIO;
-
-	if (psp_wait_cmd(mbox))
-		return -EBUSY;
-
-	/*
-	 * Fill mailbox with address of command-response buffer, which will be
-	 * used for sending i2c requests as well as reading status returned by
-	 * PSP. Use physical address of buffer, since PSP will map this region.
-	 */
-	req_addr = __psp_pa((void *)req);
-	writeq(req_addr, &mbox->i2c_req_addr);
-
-	/* Write command register to trigger processing */
-	cmd_reg = FIELD_PREP(PSP_CMDRESP_CMD, PSP_I2C_REQ_BUS_CMD);
-	writel(cmd_reg, &mbox->cmd_fields);
-
-	if (psp_wait_cmd(mbox))
-		return -ETIMEDOUT;
-
-	if (psp_check_mbox_sts(mbox))
-		return -EIO;
-
-	return 0;
-}
-
 /* Helper to verify status returned by PSP */
 static int check_i2c_req_sts(struct psp_i2c_req *req)
 {
@@ -182,10 +64,10 @@ static int psp_send_check_i2c_req(struct psp_i2c_req *req)
 	 * 2. i2c-requests - PSP refuses to grant i2c arbitration to x86 for too
 	 * long.
 	 * In order to distinguish between these two in error handling code, all
-	 * errors on the first level (returned by psp_send_cmd) are shadowed by
+	 * errors on the first level (returned by psp_send_platform_access_msg) are shadowed by
 	 * -EIO.
 	 */
-	if (psp_send_cmd(req))
+	if (psp_send_platform_access_msg(PSP_I2C_REQ_BUS_CMD, (struct psp_request *)req))
 		return -EIO;
 
 	return check_i2c_req_sts(req);
@@ -202,7 +84,7 @@ static int psp_send_i2c_req(enum psp_i2c_req_type i2c_req_type)
 	if (!req)
 		return -ENOMEM;
 
-	req->hdr.total_size = sizeof(*req);
+	req->hdr.payload_size = sizeof(*req);
 	req->type = i2c_req_type;
 
 	start = jiffies;
@@ -381,7 +263,8 @@ static const struct i2c_lock_operations i2c_dw_psp_lock_ops = {
 
 int i2c_dw_amdpsp_probe_lock_support(struct dw_i2c_dev *dev)
 {
-	int ret;
+	if (!IS_REACHABLE(CRYPTO_DEV_CCP_DD))
+		return -ENODEV;
 
 	if (!dev)
 		return -ENODEV;
@@ -393,11 +276,10 @@ int i2c_dw_amdpsp_probe_lock_support(struct dw_i2c_dev *dev)
 	if (psp_i2c_dev)
 		return -EEXIST;
 
-	psp_i2c_dev = dev->dev;
+	if (psp_check_platform_access_status())
+		return -EPROBE_DEFER;
 
-	ret = psp_mbox_probe();
-	if (ret)
-		return ret;
+	psp_i2c_dev = dev->dev;
 
 	dev_info(psp_i2c_dev, "I2C bus managed by AMD PSP\n");
 
@@ -411,9 +293,3 @@ int i2c_dw_amdpsp_probe_lock_support(struct dw_i2c_dev *dev)
 
 	return 0;
 }
-
-/* Unmap area used as a mailbox with PSP */
-void i2c_dw_amdpsp_remove_lock_support(struct dw_i2c_dev *dev)
-{
-	iounmap(mbox_iomem);
-}
diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h
index 050d8c63ad3c..c5d87aae39c6 100644
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -383,7 +383,6 @@ int i2c_dw_baytrail_probe_lock_support(struct dw_i2c_dev *dev);
 
 #if IS_ENABLED(CONFIG_I2C_DESIGNWARE_AMDPSP)
 int i2c_dw_amdpsp_probe_lock_support(struct dw_i2c_dev *dev);
-void i2c_dw_amdpsp_remove_lock_support(struct dw_i2c_dev *dev);
 #endif
 
 int i2c_dw_validate_speed(struct dw_i2c_dev *dev);
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 74182db03a88..89ad88c54754 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -214,7 +214,6 @@ static const struct i2c_dw_semaphore_callbacks i2c_dw_semaphore_cb_table[] = {
 #ifdef CONFIG_I2C_DESIGNWARE_AMDPSP
 	{
 		.probe = i2c_dw_amdpsp_probe_lock_support,
-		.remove = i2c_dw_amdpsp_remove_lock_support,
 	},
 #endif
 	{}
diff --git a/include/linux/psp-platform-access.h b/include/linux/psp-platform-access.h
index 977df5cfd494..f5a03cd11f10 100644
--- a/include/linux/psp-platform-access.h
+++ b/include/linux/psp-platform-access.h
@@ -7,6 +7,7 @@
 
 enum psp_platform_access_msg {
 	PSP_CMD_NONE = 0x0,
+	PSP_I2C_REQ_BUS_CMD = 0x64,
 };
 
 struct psp_req_buffer_hdr {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v3 7/9] crypto: ccp: Add support for ringing a platform doorbell
  2023-03-03 16:50 [PATCH v3 0/9] Export platform features from ccp driver Mario Limonciello
                   ` (5 preceding siblings ...)
  2023-03-03 16:50 ` [PATCH v3 6/9] i2c: designware: Use PCI PSP driver for communication Mario Limonciello
@ 2023-03-03 16:50 ` Mario Limonciello
  2023-03-10 11:19   ` Herbert Xu
  2023-03-03 16:50 ` [PATCH v3 8/9] i2c: designware: Add doorbell support for Skyrim Mario Limonciello
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 18+ messages in thread
From: Mario Limonciello @ 2023-03-03 16:50 UTC (permalink / raw)
  To: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Tom Lendacky, John Allen
  Cc: Mario Limonciello, David S. Miller, linux-crypto, linux-kernel

Some platforms support using a doorbell to communicate. Export
this feature for other drivers to utilize as well.

Link: https://lore.kernel.org/linux-i2c/20220916131854.687371-3-jsd@semihalf.com/
Suggested-by: Jan Dabros <jsd@semihalf.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v2->v3:
 * Squash register values in
 * Use command and button registers
 * Correct register values for incorrect ones previously shared
 * Use a unique mutex
v1->v2:
 * New patch
---
 drivers/crypto/ccp/platform-access.c | 52 ++++++++++++++++++++++++++++
 drivers/crypto/ccp/platform-access.h |  1 +
 drivers/crypto/ccp/sp-dev.h          |  3 ++
 drivers/crypto/ccp/sp-pci.c          |  2 ++
 include/linux/psp-platform-access.h  | 15 ++++++++
 include/linux/psp.h                  |  3 ++
 6 files changed, 76 insertions(+)

diff --git a/drivers/crypto/ccp/platform-access.c b/drivers/crypto/ccp/platform-access.c
index d7669a44dcfe..332e12637d48 100644
--- a/drivers/crypto/ccp/platform-access.c
+++ b/drivers/crypto/ccp/platform-access.c
@@ -132,6 +132,56 @@ int psp_send_platform_access_msg(enum psp_platform_access_msg msg,
 }
 EXPORT_SYMBOL_GPL(psp_send_platform_access_msg);
 
+int psp_ring_platform_doorbell(enum psp_platform_access_msg msg)
+{
+	struct psp_device *psp = psp_get_master_device();
+	struct psp_platform_access_device *pa_dev;
+	u32 __iomem *button, __iomem *cmd;
+	int ret, val;
+
+	if (!psp || !psp->platform_access_data)
+		return -ENODEV;
+
+	pa_dev = psp->platform_access_data;
+	button = psp->io_regs + pa_dev->vdata->doorbell_button_reg;
+	cmd = psp->io_regs + pa_dev->vdata->doorbell_cmd_reg;
+
+	mutex_lock(&pa_dev->doorbell_mutex);
+
+	if (check_recovery(cmd)) {
+		dev_dbg(psp->dev, "doorbell in recovery\n");
+		ret = -EBUSY;
+		goto unlock;
+	}
+
+	if (wait_cmd(cmd)) {
+		dev_dbg(psp->dev, "doorbell not done processing command\n");
+		ret = -EBUSY;
+		goto unlock;
+	}
+
+	iowrite32(FIELD_PREP(PSP_DRBL_MSG, msg), cmd);
+	iowrite32(PSP_DRBL_RING, button);
+
+	if (wait_cmd(cmd)) {
+		ret = -ETIMEDOUT;
+		goto unlock;
+	}
+
+	val = FIELD_GET(PSP_CMDRESP_STS, ioread32(cmd));
+	if (val) {
+		ret = -EIO;
+		goto unlock;
+	}
+
+	ret = 0;
+unlock:
+	mutex_unlock(&pa_dev->doorbell_mutex);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(psp_ring_platform_doorbell);
+
 void platform_access_dev_destroy(struct psp_device *psp)
 {
 	struct psp_platform_access_device *pa_dev = psp->platform_access_data;
@@ -140,6 +190,7 @@ void platform_access_dev_destroy(struct psp_device *psp)
 		return;
 
 	mutex_destroy(&pa_dev->mailbox_mutex);
+	mutex_destroy(&pa_dev->doorbell_mutex);
 	psp->platform_access_data = NULL;
 }
 
@@ -159,6 +210,7 @@ int platform_access_dev_init(struct psp_device *psp)
 	pa_dev->vdata = (struct platform_access_vdata *)psp->vdata->platform_access;
 
 	mutex_init(&pa_dev->mailbox_mutex);
+	mutex_init(&pa_dev->doorbell_mutex);
 
 	dev_dbg(dev, "platform access enabled\n");
 
diff --git a/drivers/crypto/ccp/platform-access.h b/drivers/crypto/ccp/platform-access.h
index c3a97893320d..a83f03beb869 100644
--- a/drivers/crypto/ccp/platform-access.h
+++ b/drivers/crypto/ccp/platform-access.h
@@ -24,6 +24,7 @@ struct psp_platform_access_device {
 	struct platform_access_vdata *vdata;
 
 	struct mutex mailbox_mutex;
+	struct mutex doorbell_mutex;
 
 	void *platform_access_data;
 };
diff --git a/drivers/crypto/ccp/sp-dev.h b/drivers/crypto/ccp/sp-dev.h
index 5ec6c219a731..1253a0217985 100644
--- a/drivers/crypto/ccp/sp-dev.h
+++ b/drivers/crypto/ccp/sp-dev.h
@@ -57,6 +57,9 @@ struct platform_access_vdata {
 	const unsigned int cmdresp_reg;
 	const unsigned int cmdbuff_addr_lo_reg;
 	const unsigned int cmdbuff_addr_hi_reg;
+	const unsigned int doorbell_button_reg;
+	const unsigned int doorbell_cmd_reg;
+
 };
 
 struct psp_vdata {
diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c
index 18aa902eb5ce..b5896f7af7ab 100644
--- a/drivers/crypto/ccp/sp-pci.c
+++ b/drivers/crypto/ccp/sp-pci.c
@@ -365,6 +365,8 @@ static const struct platform_access_vdata pa_v1 = {
 	.cmdresp_reg		= 0x10570,	/* C2PMSG_28 */
 	.cmdbuff_addr_lo_reg	= 0x10574,	/* C2PMSG_29 */
 	.cmdbuff_addr_hi_reg	= 0x10578,	/* C2PMSG_30 */
+	.doorbell_button_reg	= 0x10a24,	/* C2PMSG_73 */
+	.doorbell_cmd_reg	= 0x10a40,	/* C2PMSG_80 */
 };
 
 static const struct psp_vdata pspv1 = {
diff --git a/include/linux/psp-platform-access.h b/include/linux/psp-platform-access.h
index f5a03cd11f10..1e1d0e077cec 100644
--- a/include/linux/psp-platform-access.h
+++ b/include/linux/psp-platform-access.h
@@ -35,6 +35,21 @@ struct psp_request {
  */
 int psp_send_platform_access_msg(enum psp_platform_access_msg, struct psp_request *req);
 
+/**
+ * psp_ring_platform_doorbell() - Ring platform doorbell
+ *
+ * This function is intended to be used by drivers outside of ccp to ring the
+ * platform doorbell with a message.
+ *
+ * Returns:
+ *  0:           success
+ *  -%EBUSY:     mailbox in recovery or in use
+ *  -%ENODEV:    driver not bound with PSP device
+ *  -%ETIMEDOUT: request timed out
+ *  -%EIO:       unknown error (see kernel log)
+ */
+int psp_ring_platform_doorbell(enum psp_platform_access_msg);
+
 /**
  * psp_check_platform_access_status() - Checks whether platform features is ready
  *
diff --git a/include/linux/psp.h b/include/linux/psp.h
index d3424790a70e..92e60aeef21e 100644
--- a/include/linux/psp.h
+++ b/include/linux/psp.h
@@ -23,4 +23,7 @@
 #define PSP_CMDRESP_RECOVERY	BIT(30)
 #define PSP_CMDRESP_RESP	BIT(31)
 
+#define PSP_DRBL_MSG		PSP_CMDRESP_CMD
+#define PSP_DRBL_RING		BIT(0)
+
 #endif /* __PSP_H */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v3 8/9] i2c: designware: Add doorbell support for Skyrim
  2023-03-03 16:50 [PATCH v3 0/9] Export platform features from ccp driver Mario Limonciello
                   ` (6 preceding siblings ...)
  2023-03-03 16:50 ` [PATCH v3 7/9] crypto: ccp: Add support for ringing a platform doorbell Mario Limonciello
@ 2023-03-03 16:50 ` Mario Limonciello
  2023-03-03 16:50 ` [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI ID Mario Limonciello
  2023-03-03 20:58 ` [PATCH v3 0/9] Export platform features from ccp driver Tom Lendacky
  9 siblings, 0 replies; 18+ messages in thread
From: Mario Limonciello @ 2023-03-03 16:50 UTC (permalink / raw)
  To: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Jarkko Nikula, Andy Shevchenko, Mika Westerberg
  Cc: Mario Limonciello, linux-i2c, linux-kernel

Skyrim doesn't use the platform feature mailbox for communication
for I2C arbitration, it relies upon ringing a doorbell.

Link: https://lore.kernel.org/linux-i2c/20220916131854.687371-3-jsd@semihalf.com/
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v2->v3:
 * Use CPU ID rather than ACPI ID, this will be pushed to a later patch
v1->v2:
 * New patch

doorbell; get status field
---
 drivers/i2c/busses/i2c-designware-amdpsp.c | 28 ++++++++++++++--------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-amdpsp.c b/drivers/i2c/busses/i2c-designware-amdpsp.c
index 105584abcf8f..2c671973010d 100644
--- a/drivers/i2c/busses/i2c-designware-amdpsp.c
+++ b/drivers/i2c/busses/i2c-designware-amdpsp.c
@@ -73,34 +73,43 @@ static int psp_send_check_i2c_req(struct psp_i2c_req *req)
 	return check_i2c_req_sts(req);
 }
 
-static int psp_send_i2c_req(enum psp_i2c_req_type i2c_req_type)
+static int psp_send_i2c_req_amdi0019(enum psp_i2c_req_type i2c_req_type)
 {
 	struct psp_i2c_req *req;
-	unsigned long start;
 	int status, ret;
 
 	/* Allocate command-response buffer */
 	req = kzalloc(sizeof(*req), GFP_KERNEL);
 	if (!req)
 		return -ENOMEM;
-
 	req->hdr.payload_size = sizeof(*req);
 	req->type = i2c_req_type;
-
-	start = jiffies;
 	ret = read_poll_timeout(psp_send_check_i2c_req, status,
 				(status != -EBUSY),
 				PSP_I2C_REQ_RETRY_DELAY_US,
 				PSP_I2C_REQ_RETRY_CNT * PSP_I2C_REQ_RETRY_DELAY_US,
 				0, req);
-	if (ret) {
+	kfree(req);
+
+	if (ret)
 		dev_err(psp_i2c_dev, "Timed out waiting for PSP to %s I2C bus\n",
 			(i2c_req_type == PSP_I2C_REQ_ACQUIRE) ?
 			"release" : "acquire");
-		goto cleanup;
-	}
 
-	ret = status;
+	return ret ? ret : status;
+}
+
+static int psp_send_i2c_req(enum psp_i2c_req_type i2c_req_type)
+{
+	unsigned long start = jiffies;
+	int ret;
+
+	/* Use doorbell for Skyrim and mailbox for Cezanne */
+	if (boot_cpu_data.x86 == 25 && boot_cpu_data.x86_model == 80)
+		ret = psp_send_i2c_req_amdi0019(i2c_req_type);
+	else
+		ret = psp_ring_platform_doorbell(i2c_req_type);
+
 	if (ret) {
 		dev_err(psp_i2c_dev, "PSP communication error\n");
 		goto cleanup;
@@ -115,7 +124,6 @@ static int psp_send_i2c_req(enum psp_i2c_req_type i2c_req_type)
 		psp_i2c_mbox_fail = true;
 	}
 
-	kfree(req);
 	return ret;
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI ID
  2023-03-03 16:50 [PATCH v3 0/9] Export platform features from ccp driver Mario Limonciello
                   ` (7 preceding siblings ...)
  2023-03-03 16:50 ` [PATCH v3 8/9] i2c: designware: Add doorbell support for Skyrim Mario Limonciello
@ 2023-03-03 16:50 ` Mario Limonciello
  2023-03-06 12:04   ` Andy Shevchenko
  2023-03-03 20:58 ` [PATCH v3 0/9] Export platform features from ccp driver Tom Lendacky
  9 siblings, 1 reply; 18+ messages in thread
From: Mario Limonciello @ 2023-03-03 16:50 UTC (permalink / raw)
  To: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Jarkko Nikula, Andy Shevchenko, Mika Westerberg
  Cc: Mario Limonciello, linux-i2c, linux-kernel

Cezanne and Skyrim have the same PSP hardware but use a different
protocol to negotiate I2C arbitration. To disambiguate this going
forward introduce a new ACPI ID to represent the protocol that utilizes
a doorbell.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v2->v3:
 * Split from earlier patch to standalone
---
 drivers/i2c/busses/i2c-designware-amdpsp.c  | 5 +++--
 drivers/i2c/busses/i2c-designware-platdrv.c | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-amdpsp.c b/drivers/i2c/busses/i2c-designware-amdpsp.c
index 2c671973010d..44b8432458b0 100644
--- a/drivers/i2c/busses/i2c-designware-amdpsp.c
+++ b/drivers/i2c/busses/i2c-designware-amdpsp.c
@@ -101,11 +101,12 @@ static int psp_send_i2c_req_amdi0019(enum psp_i2c_req_type i2c_req_type)
 
 static int psp_send_i2c_req(enum psp_i2c_req_type i2c_req_type)
 {
+	const char *hid = acpi_device_hid(ACPI_COMPANION(psp_i2c_dev));
 	unsigned long start = jiffies;
 	int ret;
 
-	/* Use doorbell for Skyrim and mailbox for Cezanne */
-	if (boot_cpu_data.x86 == 25 && boot_cpu_data.x86_model == 80)
+	/* Use doorbell for AMDI0020 and mailbox for AMDI0019 */
+	if (!strcmp(hid, "AMDI0019"))
 		ret = psp_send_i2c_req_amdi0019(i2c_req_type);
 	else
 		ret = psp_ring_platform_doorbell(i2c_req_type);
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 89ad88c54754..5ca71bda9ac2 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -51,6 +51,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
 	{ "AMD0010", ACCESS_INTR_MASK },
 	{ "AMDI0010", ACCESS_INTR_MASK },
 	{ "AMDI0019", ACCESS_INTR_MASK | ARBITRATION_SEMAPHORE },
+	{ "AMDI0020", ACCESS_INTR_MASK | ARBITRATION_SEMAPHORE },
 	{ "AMDI0510", 0 },
 	{ "APMC0D0F", 0 },
 	{ "HISI02A1", 0 },
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 0/9] Export platform features from ccp driver
  2023-03-03 16:50 [PATCH v3 0/9] Export platform features from ccp driver Mario Limonciello
                   ` (8 preceding siblings ...)
  2023-03-03 16:50 ` [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI ID Mario Limonciello
@ 2023-03-03 20:58 ` Tom Lendacky
  9 siblings, 0 replies; 18+ messages in thread
From: Tom Lendacky @ 2023-03-03 20:58 UTC (permalink / raw)
  To: Mario Limonciello, Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, herbert, Andy Shevchenko,
	Mika Westerberg, kvm, linux-crypto, linux-i2c
  Cc: H. Peter Anvin, Sumit Garg, linux-kernel, op-tee

On 3/3/23 10:50, Mario Limonciello wrote:
> The i2c-designware-amdpsp driver communicates with a platform
> features mailbox provided by the PSP.  The address used for
> communication is discovered via a non-architecturally
> guaranteed mechanism.
> 
> To better scale, export a feature for communication with platform
> features directly from the ccp driver.
> 

If there is agreement with Jan and Grzegorz for patches 7-9, I'm ok with 
the rest.

Acked-by: Tom Lendacky <thomas.lendacky@amd.com>

> v2->v3:
>   * Split new ACPI ID to own patch
>   * Squash doorbell offsets into doorbell patch
>   * Fix all feedback from v2 (see individual patches for details)
> Mario Limonciello (9):
>    crypto: ccp: Drop TEE support for IRQ handler
>    crypto: ccp: Add a header for multiple drivers to use `__psp_pa`
>    crypto: ccp: Move some PSP mailbox bit definitions into common header
>    crypto: ccp: Add support for an interface for platform features
>    crypto: ccp: Enable platform access interface on client PSP parts
>    i2c: designware: Use PCI PSP driver for communication
>    crypto: ccp: Add support for ringing a platform doorbell
>    i2c: designware: Add doorbell support for Skyrim
>    i2c: designware: Add support for AMDI0020 ACPI ID
> 
>   arch/x86/kvm/svm/sev.c                      |   1 +
>   drivers/crypto/ccp/Makefile                 |   3 +-
>   drivers/crypto/ccp/platform-access.c        | 218 ++++++++++++++++++++
>   drivers/crypto/ccp/platform-access.h        |  35 ++++
>   drivers/crypto/ccp/psp-dev.c                |  32 +--
>   drivers/crypto/ccp/psp-dev.h                |  11 +-
>   drivers/crypto/ccp/sev-dev.c                |  16 +-
>   drivers/crypto/ccp/sev-dev.h                |   2 +-
>   drivers/crypto/ccp/sp-dev.h                 |  10 +
>   drivers/crypto/ccp/sp-pci.c                 |   9 +
>   drivers/crypto/ccp/tee-dev.c                |  17 +-
>   drivers/i2c/busses/Kconfig                  |   2 +-
>   drivers/i2c/busses/i2c-designware-amdpsp.c  | 179 +++-------------
>   drivers/i2c/busses/i2c-designware-core.h    |   1 -
>   drivers/i2c/busses/i2c-designware-platdrv.c |   2 +-
>   drivers/tee/amdtee/call.c                   |   2 +-
>   drivers/tee/amdtee/shm_pool.c               |   2 +-
>   include/linux/psp-platform-access.h         |  65 ++++++
>   include/linux/psp-sev.h                     |   8 -
>   include/linux/psp.h                         |  29 +++
>   20 files changed, 438 insertions(+), 206 deletions(-)
>   create mode 100644 drivers/crypto/ccp/platform-access.c
>   create mode 100644 drivers/crypto/ccp/platform-access.h
>   create mode 100644 include/linux/psp-platform-access.h
>   create mode 100644 include/linux/psp.h
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI ID
  2023-03-03 16:50 ` [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI ID Mario Limonciello
@ 2023-03-06 12:04   ` Andy Shevchenko
  2023-03-06 12:28     ` Jarkko Nikula
  0 siblings, 1 reply; 18+ messages in thread
From: Andy Shevchenko @ 2023-03-06 12:04 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Jarkko Nikula, Mika Westerberg, linux-i2c, linux-kernel

On Fri, Mar 03, 2023 at 10:50:47AM -0600, Mario Limonciello wrote:
> Cezanne and Skyrim have the same PSP hardware but use a different
> protocol to negotiate I2C arbitration. To disambiguate this going
> forward introduce a new ACPI ID to represent the protocol that utilizes
> a doorbell.

> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> v2->v3:
>  * Split from earlier patch to standalone
> ---
>  drivers/i2c/busses/i2c-designware-amdpsp.c  | 5 +++--
>  drivers/i2c/busses/i2c-designware-platdrv.c | 1 +
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-amdpsp.c b/drivers/i2c/busses/i2c-designware-amdpsp.c
> index 2c671973010d..44b8432458b0 100644
> --- a/drivers/i2c/busses/i2c-designware-amdpsp.c
> +++ b/drivers/i2c/busses/i2c-designware-amdpsp.c
> @@ -101,11 +101,12 @@ static int psp_send_i2c_req_amdi0019(enum psp_i2c_req_type i2c_req_type)
>  
>  static int psp_send_i2c_req(enum psp_i2c_req_type i2c_req_type)
>  {
> +	const char *hid = acpi_device_hid(ACPI_COMPANION(psp_i2c_dev));
>  	unsigned long start = jiffies;
>  	int ret;
>  
> -	/* Use doorbell for Skyrim and mailbox for Cezanne */
> -	if (boot_cpu_data.x86 == 25 && boot_cpu_data.x86_model == 80)

Ah, in this form it's getting better than I thought!

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> +	/* Use doorbell for AMDI0020 and mailbox for AMDI0019 */
> +	if (!strcmp(hid, "AMDI0019"))
>  		ret = psp_send_i2c_req_amdi0019(i2c_req_type);
>  	else
>  		ret = psp_ring_platform_doorbell(i2c_req_type);
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 89ad88c54754..5ca71bda9ac2 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -51,6 +51,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
>  	{ "AMD0010", ACCESS_INTR_MASK },
>  	{ "AMDI0010", ACCESS_INTR_MASK },
>  	{ "AMDI0019", ACCESS_INTR_MASK | ARBITRATION_SEMAPHORE },
> +	{ "AMDI0020", ACCESS_INTR_MASK | ARBITRATION_SEMAPHORE },
>  	{ "AMDI0510", 0 },
>  	{ "APMC0D0F", 0 },
>  	{ "HISI02A1", 0 },
> -- 
> 2.34.1
> 

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI ID
  2023-03-06 12:04   ` Andy Shevchenko
@ 2023-03-06 12:28     ` Jarkko Nikula
  2023-03-06 12:55       ` Andy Shevchenko
  0 siblings, 1 reply; 18+ messages in thread
From: Jarkko Nikula @ 2023-03-06 12:28 UTC (permalink / raw)
  To: Andy Shevchenko, Mario Limonciello
  Cc: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Mika Westerberg, linux-i2c, linux-kernel

On 3/6/23 14:04, Andy Shevchenko wrote:
> On Fri, Mar 03, 2023 at 10:50:47AM -0600, Mario Limonciello wrote:
>> Cezanne and Skyrim have the same PSP hardware but use a different
>> protocol to negotiate I2C arbitration. To disambiguate this going
>> forward introduce a new ACPI ID to represent the protocol that utilizes
>> a doorbell.
> 
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>> v2->v3:
>>   * Split from earlier patch to standalone
>> ---
>>   drivers/i2c/busses/i2c-designware-amdpsp.c  | 5 +++--
>>   drivers/i2c/busses/i2c-designware-platdrv.c | 1 +
>>   2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-designware-amdpsp.c b/drivers/i2c/busses/i2c-designware-amdpsp.c
>> index 2c671973010d..44b8432458b0 100644
>> --- a/drivers/i2c/busses/i2c-designware-amdpsp.c
>> +++ b/drivers/i2c/busses/i2c-designware-amdpsp.c
>> @@ -101,11 +101,12 @@ static int psp_send_i2c_req_amdi0019(enum psp_i2c_req_type i2c_req_type)
>>   
>>   static int psp_send_i2c_req(enum psp_i2c_req_type i2c_req_type)
>>   {
>> +	const char *hid = acpi_device_hid(ACPI_COMPANION(psp_i2c_dev));
>>   	unsigned long start = jiffies;
>>   	int ret;
>>   
>> -	/* Use doorbell for Skyrim and mailbox for Cezanne */
>> -	if (boot_cpu_data.x86 == 25 && boot_cpu_data.x86_model == 80)
> 
> Ah, in this form it's getting better than I thought!
> 
These removed lines were added by previous patch. I think a bit too 
short lived if the same patchset adds and then removes lines?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI ID
  2023-03-06 12:28     ` Jarkko Nikula
@ 2023-03-06 12:55       ` Andy Shevchenko
  2023-03-06 13:11         ` Mario Limonciello
  0 siblings, 1 reply; 18+ messages in thread
From: Andy Shevchenko @ 2023-03-06 12:55 UTC (permalink / raw)
  To: Jarkko Nikula
  Cc: Mario Limonciello, Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Mika Westerberg, linux-i2c, linux-kernel

On Mon, Mar 06, 2023 at 02:28:05PM +0200, Jarkko Nikula wrote:
> On 3/6/23 14:04, Andy Shevchenko wrote:
> > On Fri, Mar 03, 2023 at 10:50:47AM -0600, Mario Limonciello wrote:
> > > Cezanne and Skyrim have the same PSP hardware but use a different
> > > protocol to negotiate I2C arbitration. To disambiguate this going
> > > forward introduce a new ACPI ID to represent the protocol that utilizes
> > > a doorbell.

...

> > > -	if (boot_cpu_data.x86 == 25 && boot_cpu_data.x86_model == 80)
> > 
> > Ah, in this form it's getting better than I thought!
> > 
> These removed lines were added by previous patch. I think a bit too short
> lived if the same patchset adds and then removes lines?

That what I have missed. Okay, coming to square 1, i.e. dropping CPU ID
completely from the series.

Note, for testing purposes you may always add a HACK patch at the end of the
series, marking it respectively. So, people may test it all and maintainer
apply w/o unneeded tail.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI ID
  2023-03-06 12:55       ` Andy Shevchenko
@ 2023-03-06 13:11         ` Mario Limonciello
  2023-03-07 21:22           ` Limonciello, Mario
  0 siblings, 1 reply; 18+ messages in thread
From: Mario Limonciello @ 2023-03-06 13:11 UTC (permalink / raw)
  To: Andy Shevchenko, Jarkko Nikula
  Cc: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Mika Westerberg, linux-i2c, linux-kernel

On 3/6/23 06:55, Andy Shevchenko wrote:
> On Mon, Mar 06, 2023 at 02:28:05PM +0200, Jarkko Nikula wrote:
>> On 3/6/23 14:04, Andy Shevchenko wrote:
>>> On Fri, Mar 03, 2023 at 10:50:47AM -0600, Mario Limonciello wrote:
>>>> Cezanne and Skyrim have the same PSP hardware but use a different
>>>> protocol to negotiate I2C arbitration. To disambiguate this going
>>>> forward introduce a new ACPI ID to represent the protocol that utilizes
>>>> a doorbell.
> 
> ...
> 
>>>> -	if (boot_cpu_data.x86 == 25 && boot_cpu_data.x86_model == 80)
>>>
>>> Ah, in this form it's getting better than I thought!
>>>
>> These removed lines were added by previous patch. I think a bit too short
>> lived if the same patchset adds and then removes lines?
> 
> That what I have missed. Okay, coming to square 1, i.e. dropping CPU ID
> completely from the series.
> 
> Note, for testing purposes you may always add a HACK patch at the end of the
> series, marking it respectively. So, people may test it all and maintainer
> apply w/o unneeded tail.
> 

If it still works then new ID can be reserved and patches 8 and 9 could 
be squashed together either by subsystem maintainer when merging or for 
v4.  My apologies if this wasn't obvious to reviewers.  My goal was to 
separate the scalability and functionality for test purposes.

The way I did it was the series could be tested with patches 1-8 on both 
Cezanne and Skyrim platforms and no BIOS changes.  If it works, BIOS for 
Skyrim can be patched and patch 9 could be added to test kernel.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI ID
  2023-03-06 13:11         ` Mario Limonciello
@ 2023-03-07 21:22           ` Limonciello, Mario
  0 siblings, 0 replies; 18+ messages in thread
From: Limonciello, Mario @ 2023-03-07 21:22 UTC (permalink / raw)
  To: Andy Shevchenko, Jarkko Nikula
  Cc: Jan Dąbroś,
	Grzegorz Bernacki, Thomas, Rijo-john, Lendacky, Thomas, herbert,
	Mika Westerberg, linux-i2c, linux-kernel

[Public]



> -----Original Message-----
> From: Limonciello, Mario
> Sent: Monday, March 6, 2023 07:12
> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>; Jarkko Nikula
> <jarkko.nikula@linux.intel.com>
> Cc: Jan Dąbroś <jsd@semihalf.com>; Grzegorz Bernacki
> <gjb@semihalf.com>; Thomas, Rijo-john <Rijo-john.Thomas@amd.com>;
> Lendacky, Thomas <Thomas.Lendacky@amd.com>;
> herbert@gondor.apana.org.au; Mika Westerberg
> <mika.westerberg@linux.intel.com>; linux-i2c@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI
> ID
> 
> On 3/6/23 06:55, Andy Shevchenko wrote:
> > On Mon, Mar 06, 2023 at 02:28:05PM +0200, Jarkko Nikula wrote:
> >> On 3/6/23 14:04, Andy Shevchenko wrote:
> >>> On Fri, Mar 03, 2023 at 10:50:47AM -0600, Mario Limonciello wrote:
> >>>> Cezanne and Skyrim have the same PSP hardware but use a different
> >>>> protocol to negotiate I2C arbitration. To disambiguate this going
> >>>> forward introduce a new ACPI ID to represent the protocol that utilizes
> >>>> a doorbell.
> >
> > ...
> >
> >>>> -	if (boot_cpu_data.x86 == 25 && boot_cpu_data.x86_model == 80)
> >>>
> >>> Ah, in this form it's getting better than I thought!
> >>>
> >> These removed lines were added by previous patch. I think a bit too short
> >> lived if the same patchset adds and then removes lines?
> >
> > That what I have missed. Okay, coming to square 1, i.e. dropping CPU ID
> > completely from the series.
> >
> > Note, for testing purposes you may always add a HACK patch at the end of
> the
> > series, marking it respectively. So, people may test it all and maintainer
> > apply w/o unneeded tail.
> >
> 
> If it still works then new ID can be reserved and patches 8 and 9 could
> be squashed together either by subsystem maintainer when merging or for
> v4.  My apologies if this wasn't obvious to reviewers.  My goal was to
> separate the scalability and functionality for test purposes.
> 
> The way I did it was the series could be tested with patches 1-8 on both
> Cezanne and Skyrim platforms and no BIOS changes.  If it works, BIOS for
> Skyrim can be patched and patch 9 could be added to test kernel.

I've found that AMDI0020 is already reserved and also in use for a while.
f5eda99ee6c0c ("ACPI / APD: Add device HID for future AMD UART controller")

Even if patches 1-9 all work with a patched BIOS to advertise AMDI0020 instead
of AMDI0019, besides squashing patch 8 and 9 will need to discuss what ID to
use.

For this reason, I would suggest that if 1-8 work and there is agreement on them
then merge 1-8 and patch 9 can be a later follow up if/after that discussion and
alignment with stakeholders.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/9] crypto: ccp: Add a header for multiple drivers to use `__psp_pa`
  2023-03-03 16:50 ` [PATCH v3 2/9] crypto: ccp: Add a header for multiple drivers to use `__psp_pa` Mario Limonciello
@ 2023-03-07 23:42   ` Sean Christopherson
  0 siblings, 0 replies; 18+ messages in thread
From: Sean Christopherson @ 2023-03-07 23:42 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, herbert,
	Paolo Bonzini, Brijesh Singh, John Allen, Jarkko Nikula,
	Andy Shevchenko, Mika Westerberg, Sumit Garg, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
	David S. Miller, Jens Wiklander, kvm, linux-kernel, linux-crypto,
	linux-i2c, op-tee

On Fri, Mar 03, 2023, Mario Limonciello wrote:
> The TEE subdriver for CCP, the amdtee driver and the i2c-designware-amdpsp
> drivers all include `psp-sev.h` even though they don't use SEV
> functionality.
> 
> Move the definition of `__psp_pa` into a common header to be included
> by all of these drivers.
> 
> Reviewed-by: Jan Dabros <jsd@semihalf.com>
> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> # For the drivers/i2c/busses/i2c-designware-amdpsp.c
> Acked-by: Sumit Garg <sumit.garg@linaro.org> # For TEE subsystem bits
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---

Acked-by: Sean Christopherson <seanjc@google.com> # KVM

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 7/9] crypto: ccp: Add support for ringing a platform doorbell
  2023-03-03 16:50 ` [PATCH v3 7/9] crypto: ccp: Add support for ringing a platform doorbell Mario Limonciello
@ 2023-03-10 11:19   ` Herbert Xu
  0 siblings, 0 replies; 18+ messages in thread
From: Herbert Xu @ 2023-03-10 11:19 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Jan Dąbroś,
	Grzegorz Bernacki, Rijo-john.Thomas, Thomas.Lendacky, John Allen,
	David S. Miller, linux-crypto, linux-kernel

On Fri, Mar 03, 2023 at 10:50:45AM -0600, Mario Limonciello wrote:
> Some platforms support using a doorbell to communicate. Export
> this feature for other drivers to utilize as well.
> 
> Link: https://lore.kernel.org/linux-i2c/20220916131854.687371-3-jsd@semihalf.com/
> Suggested-by: Jan Dabros <jsd@semihalf.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> v2->v3:
>  * Squash register values in
>  * Use command and button registers
>  * Correct register values for incorrect ones previously shared
>  * Use a unique mutex
> v1->v2:
>  * New patch
> ---
>  drivers/crypto/ccp/platform-access.c | 52 ++++++++++++++++++++++++++++
>  drivers/crypto/ccp/platform-access.h |  1 +
>  drivers/crypto/ccp/sp-dev.h          |  3 ++
>  drivers/crypto/ccp/sp-pci.c          |  2 ++
>  include/linux/psp-platform-access.h  | 15 ++++++++
>  include/linux/psp.h                  |  3 ++
>  6 files changed, 76 insertions(+)

With this patch I get:

  CHECK   ../drivers/crypto/ccp/platform-access.c
../drivers/crypto/ccp/platform-access.c:59:27: warning: duplicate [noderef]
../drivers/crypto/ccp/platform-access.c:59:27: error: multiple address spaces given: __iomem & __iomem
../drivers/crypto/ccp/platform-access.c:59:40: error: multiple address spaces given: __iomem & __iomem
../drivers/crypto/ccp/platform-access.c:139:30: error: multiple address spaces given: __iomem & __iomem

Please ensure that your code compiles cleanly with C=1 W=1 before
you submit.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-03-10 11:20 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03 16:50 [PATCH v3 0/9] Export platform features from ccp driver Mario Limonciello
2023-03-03 16:50 ` [PATCH v3 1/9] crypto: ccp: Drop TEE support for IRQ handler Mario Limonciello
2023-03-03 16:50 ` [PATCH v3 2/9] crypto: ccp: Add a header for multiple drivers to use `__psp_pa` Mario Limonciello
2023-03-07 23:42   ` Sean Christopherson
2023-03-03 16:50 ` [PATCH v3 3/9] crypto: ccp: Move some PSP mailbox bit definitions into common header Mario Limonciello
2023-03-03 16:50 ` [PATCH v3 4/9] crypto: ccp: Add support for an interface for platform features Mario Limonciello
2023-03-03 16:50 ` [PATCH v3 5/9] crypto: ccp: Enable platform access interface on client PSP parts Mario Limonciello
2023-03-03 16:50 ` [PATCH v3 6/9] i2c: designware: Use PCI PSP driver for communication Mario Limonciello
2023-03-03 16:50 ` [PATCH v3 7/9] crypto: ccp: Add support for ringing a platform doorbell Mario Limonciello
2023-03-10 11:19   ` Herbert Xu
2023-03-03 16:50 ` [PATCH v3 8/9] i2c: designware: Add doorbell support for Skyrim Mario Limonciello
2023-03-03 16:50 ` [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI ID Mario Limonciello
2023-03-06 12:04   ` Andy Shevchenko
2023-03-06 12:28     ` Jarkko Nikula
2023-03-06 12:55       ` Andy Shevchenko
2023-03-06 13:11         ` Mario Limonciello
2023-03-07 21:22           ` Limonciello, Mario
2023-03-03 20:58 ` [PATCH v3 0/9] Export platform features from ccp driver Tom Lendacky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).