mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: "Jan Dąbroś" <jsd@semihalf.com>,
	"Grzegorz Bernacki" <gjb@semihalf.com>,
	Rijo-john.Thomas@amd.com, Thomas.Lendacky@amd.com,
	herbert@gondor.apana.org.au,
	"Jarkko Nikula" <jarkko.nikula@linux.intel.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>,
	<linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI ID
Date: Fri, 3 Mar 2023 10:50:47 -0600	[thread overview]
Message-ID: <20230303165050.2918-10-mario.limonciello@amd.com> (raw)
In-Reply-To: <20230303165050.2918-1-mario.limonciello@amd.com>

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


  parent reply	other threads:[~2023-03-03 16:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Mario Limonciello [this message]
2023-03-06 12:04   ` [PATCH v3 9/9] i2c: designware: Add support for AMDI0020 ACPI ID 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230303165050.2918-10-mario.limonciello@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Rijo-john.Thomas@amd.com \
    --cc=Thomas.Lendacky@amd.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gjb@semihalf.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jsd@semihalf.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®