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>,
	"Mark Hasemeyer" <markhas@chromium.org>,
	"Tom Lendacky" <thomas.lendacky@amd.com>,
	"John Allen" <john.allen@amd.com>
Cc: Felix Held <Felix.Held@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	<linux-crypto@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v7 4/6] crypto: ccp: Use lower 8 bytes to communicate with doorbell command register
Date: Wed, 29 Mar 2023 17:07:50 -0500	[thread overview]
Message-ID: <20230329220753.7741-5-mario.limonciello@amd.com> (raw)
In-Reply-To: <20230329220753.7741-1-mario.limonciello@amd.com>

Unlike other command registers used by the PSP, only the lower 8 bytes are
used for communication for both command and status of the command.

Suggested-by: Mark Hasemeyer <markhas@chromium.org>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v6->v7:
 * New patch
---
 drivers/crypto/ccp/platform-access.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ccp/platform-access.c b/drivers/crypto/ccp/platform-access.c
index 48f59ae91692..939c924fc383 100644
--- a/drivers/crypto/ccp/platform-access.c
+++ b/drivers/crypto/ccp/platform-access.c
@@ -19,6 +19,7 @@
 #include "platform-access.h"
 
 #define PSP_CMD_TIMEOUT_US	(500 * USEC_PER_MSEC)
+#define DOORBELL_CMDRESP_STS	GENMASK(7, 0)
 
 /* Recovery field should be equal 0 to start sending commands */
 static int check_recovery(u32 __iomem *cmd)
@@ -154,7 +155,7 @@ int psp_ring_platform_doorbell(int msg, u32 *result)
 		goto unlock;
 	}
 
-	iowrite32(FIELD_PREP(PSP_DRBL_MSG, msg), cmd);
+	iowrite32(FIELD_PREP(DOORBELL_CMDRESP_STS, msg), cmd);
 	iowrite32(PSP_DRBL_RING, button);
 
 	if (wait_cmd(cmd)) {
@@ -162,7 +163,7 @@ int psp_ring_platform_doorbell(int msg, u32 *result)
 		goto unlock;
 	}
 
-	val = FIELD_GET(PSP_CMDRESP_STS, ioread32(cmd));
+	val = FIELD_GET(DOORBELL_CMDRESP_STS, ioread32(cmd));
 	if (val) {
 		if (result)
 			*result = val;
-- 
2.34.1


  parent reply	other threads:[~2023-03-29 22:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 22:07 [PATCH v7 0/6] Use CCP driver to handle PSP I2C arbitration Mario Limonciello
2023-03-29 22:07 ` [PATCH v7 1/6] crypto: ccp: Drop extra doorbell checks Mario Limonciello
2023-03-31 19:28   ` Mark Hasemeyer
2023-03-29 22:07 ` [PATCH v7 2/6] crypto: ccp: Bump up doorbell debug message to error Mario Limonciello
2023-03-29 22:07 ` [PATCH v7 3/6] crypto: ccp: Return doorbell status code as an argument Mario Limonciello
2023-03-31 19:29   ` Mark Hasemeyer
2023-03-29 22:07 ` Mario Limonciello [this message]
2023-03-31 19:31   ` [PATCH v7 4/6] crypto: ccp: Use lower 8 bytes to communicate with doorbell command register Mark Hasemeyer
2023-03-29 22:07 ` [PATCH v7 5/6] i2c: designware: Use PCI PSP driver for communication Mario Limonciello
2023-03-31 11:53   ` Jarkko Nikula
2023-03-31 12:03     ` Jan Dąbroś
2023-03-31 14:13       ` Limonciello, Mario
2023-03-31 19:32         ` Mark Hasemeyer
2023-04-01  7:39   ` kernel test robot
2023-03-29 22:07 ` [PATCH v7 6/6] i2c: designware: Add doorbell support for Mendocino Mario Limonciello
2023-03-31 11:55   ` Jarkko Nikula
2023-03-31 19:33   ` Mark Hasemeyer
2023-04-01 19:38   ` kernel test robot
2023-03-31 19:34 ` [PATCH v7 0/6] Use CCP driver to handle PSP I2C arbitration Mark Hasemeyer

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=20230329220753.7741-5-mario.limonciello@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Felix.Held@amd.com \
    --cc=davem@davemloft.net \
    --cc=gjb@semihalf.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=john.allen@amd.com \
    --cc=jsd@semihalf.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markhas@chromium.org \
    --cc=thomas.lendacky@amd.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®