From patchwork Tue Jul 3 17:12:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 10504797 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E009B60325 for ; Tue, 3 Jul 2018 17:12:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2A1628D61 for ; Tue, 3 Jul 2018 17:12:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B638028D65; Tue, 3 Jul 2018 17:12:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3112B28D61 for ; Tue, 3 Jul 2018 17:12:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932926AbeGCRM1 (ORCPT ); Tue, 3 Jul 2018 13:12:27 -0400 Received: from mail-bl2nam02on0043.outbound.protection.outlook.com ([104.47.38.43]:34474 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932759AbeGCRM0 (ORCPT ); Tue, 3 Jul 2018 13:12:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h3r8chlVnrBNFeoneE+px2veTy+BaW1MqmBZd1fJB98=; b=Uo3Q7uL5ezNXuOf9bOcqxRpbbUSO4NVl1B71hzRCyfdc4PzInl24TdVTJDRCICKnvEKlOlhQmZRffYkbz29D+QbsG9Fv+NTptqm8GIDVDREKjb2Xyh0bEdhTcrHiHCdN74+PdAjcoSXoRq3Ge43qCIj5roWK14hRC1fYVFA2WOw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from tlendack-t1.amdoffice.net (165.204.77.1) by BY2PR12MB0164.namprd12.prod.outlook.com (2a01:111:e400:585a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.20; Tue, 3 Jul 2018 17:12:18 +0000 From: Tom Lendacky Subject: [PATCH v1 5/5] crypto: ccp: Add support for new CCP/PSP device ID To: linux-crypto@vger.kernel.org Cc: Brijesh Singh , Gary Hook , Herbert Xu , David Miller Date: Tue, 03 Jul 2018 12:12:14 -0500 Message-ID: <20180703171214.3225.27261.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20180703171122.3225.55265.stgit@tlendack-t1.amdoffice.net> References: <20180703171122.3225.55265.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR13CA0012.namprd13.prod.outlook.com (2603:10b6:300:16::22) To BY2PR12MB0164.namprd12.prod.outlook.com (2a01:111:e400:585a::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: af72a06d-aa74-498c-07e1-08d5e1082242 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(48565401081)(5600053)(711020)(2017052603328)(7153060)(7193020); SRVR:BY2PR12MB0164; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0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yrxeMIb8stlHIQIRFNFQF1xpmWOoJ3F/ZNUJTRgIsruZGQmX+nKjSIlwo2poRP6TyCFpT+GtasfqENfFBa8vUu3VU9T8XRhPnn6DL3eCZGDymrXJSlpbEnvzWEol5xZJQBneCA0QHJcAxTsiVvQtFLV7oI7vTLlgN2Or0lzV5+Y8m0b1RrgrrOjp1BCR79df9FL1gWLJgpUo+qhhGjpvQnT3qxWmAPzCkp+aZ2W2Qm8oGfXjl3qtRMNUPY0zdot3nn9Oem8rozxIzHk/PPK20b8e3lEfVzUidX+Ele55hlLTJF0QYQ0KwMHBsLALpMPuAY3j4mm4FVna4ZFRK6tIJuz; 4:CBIqvlh5ZLaKF7u3p6A17/nYqPQ+bOCLPEN8kDtggLvAk/ory40ZFxZUH3GFAjucKM9wCn6I20k2+QbwAxNBR/tf0K3MExyNuRTAl0VdFnAspc0ENRnH3oGN1jsLPWMgfnKe3RXBTsVajZKRK2uRRKfGfv55k4bOTc8BZ7e/TkQ7QUemhG4Ui674aqGHs0UoeJv3HqG1zYNK13pZkw1rFOop/tdq1pURMOOcmhhklX3K5dRKi8MZ7NrvZEaSJcUDiZ6/XJFv8JzS9I0Un8wQVit3AvAzf//tkz3m7MxjZdXRmUi29wjfQTi6H9LraqcA X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:BY2PR12MB0164; BCL:0; PCL:0; RULEID:; SRVR:BY2PR12MB0164; X-Forefront-PRVS: 0722981D2A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(376002)(346002)(136003)(396003)(199004)(189003)(4326008)(47776003)(16526019)(26005)(9686003)(8676002)(58126008)(86362001)(6506007)(386003)(81166006)(81156014)(55016002)(52116002)(2486003)(53416004)(2361001)(23676004)(8936002)(103116003)(105586002)(106356001)(2351001)(54906003)(69596002)(7736002)(25786009)(72206003)(97746001)(305945005)(53936002)(316002)(11346002)(956004)(97736004)(230700001)(6916009)(486006)(446003)(478600001)(476003)(7696005)(2906002)(50466002)(6116002)(76176011)(3846002)(1076002)(66066001)(5660300001)(68736007)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR12MB0164; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjEyTUIwMTY0OzIzOnRRQm5la0FDcVlvT1NpSHZRcEd5QmRjWFpC?= =?utf-8?B?VmlFRDdvVmpxeng2WXU2dmdGSjh6MXliYVkyL2w1SFBRR2QxMVg1NVV1OVlv?= =?utf-8?B?L0FiaXV6V1J6cTBjSmk2T204bG5WcEZMbHRVN0VXNFl1bUl3WHJyc0o0R3BK?= =?utf-8?B?MUJXeHpzb1JNdlZwWnJXYVk2YzVXaDBub3U0cE1kN2ZVa015WGlRUmc0a2E2?= =?utf-8?B?cDRrNEdhQ3NKdU1OR256WkdlNlNYai9EUFZialBWUXBEMGNuOTRSQSs4R040?= =?utf-8?B?WFRBc3Q0Z3V1cFNTUGl5aFk4bFNhMjNCdjVLM0Fab05qMGQxNTVWS3ZLWHVS?= =?utf-8?B?cUJpZ0dUSndZcitacEtaM1FwdHVPcHJmQVZVL1BMaGJja2lEc1VDZ0JFTUF3?= =?utf-8?B?cDJJK1dnRzVDWHJLMEQxMlN6NzNPZlhsTHZiV05xMERDMWlTaFVlek80WHZK?= =?utf-8?B?aDBkUTdvcmEzVXZHS2NQMXJSdWRON3hRUTB4bz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lqgX2N7FnSHT/soiIF5hM3ITI4rtCXPZaTxkVXhN/ezvSO8WFAwOu+55zqGeTGvWfeV5N1I56sJs/l30kLzsgf4kg X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2018 17:12:18.6608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af72a06d-aa74-498c-07e1-08d5e1082242 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0164 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a new CCP/PSP PCI device ID and new PSP register offsets. Signed-off-by: Tom Lendacky Acked-by: Gary R Hook Reviewed-by: Brijesh Singh --- drivers/crypto/ccp/sp-pci.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c index 78c1e9d..7da93e9 100644 --- a/drivers/crypto/ccp/sp-pci.c +++ b/drivers/crypto/ccp/sp-pci.c @@ -269,7 +269,7 @@ static int sp_pci_resume(struct pci_dev *pdev) #endif #ifdef CONFIG_CRYPTO_DEV_SP_PSP -static const struct psp_vdata psp_entry = { +static const struct psp_vdata pspv1 = { .cmdresp_reg = 0x10580, .cmdbuff_addr_lo_reg = 0x105e0, .cmdbuff_addr_hi_reg = 0x105e4, @@ -277,35 +277,54 @@ static int sp_pci_resume(struct pci_dev *pdev) .inten_reg = 0x10610, .intsts_reg = 0x10614, }; + +static const struct psp_vdata pspv2 = { + .cmdresp_reg = 0x10980, + .cmdbuff_addr_lo_reg = 0x109e0, + .cmdbuff_addr_hi_reg = 0x109e4, + .feature_reg = 0x109fc, + .inten_reg = 0x10690, + .intsts_reg = 0x10694, +}; #endif static const struct sp_dev_vdata dev_vdata[] = { - { + { /* 0 */ .bar = 2, #ifdef CONFIG_CRYPTO_DEV_SP_CCP .ccp_vdata = &ccpv3, #endif }, - { + { /* 1 */ .bar = 2, #ifdef CONFIG_CRYPTO_DEV_SP_CCP .ccp_vdata = &ccpv5a, #endif #ifdef CONFIG_CRYPTO_DEV_SP_PSP - .psp_vdata = &psp_entry + .psp_vdata = &pspv1, #endif }, - { + { /* 2 */ .bar = 2, #ifdef CONFIG_CRYPTO_DEV_SP_CCP .ccp_vdata = &ccpv5b, #endif }, + { /* 3 */ + .bar = 2, +#ifdef CONFIG_CRYPTO_DEV_SP_CCP + .ccp_vdata = &ccpv5a, +#endif +#ifdef CONFIG_CRYPTO_DEV_SP_PSP + .psp_vdata = &pspv2, +#endif + }, }; static const struct pci_device_id sp_pci_table[] = { { PCI_VDEVICE(AMD, 0x1537), (kernel_ulong_t)&dev_vdata[0] }, { PCI_VDEVICE(AMD, 0x1456), (kernel_ulong_t)&dev_vdata[1] }, { PCI_VDEVICE(AMD, 0x1468), (kernel_ulong_t)&dev_vdata[2] }, + { PCI_VDEVICE(AMD, 0x1486), (kernel_ulong_t)&dev_vdata[3] }, /* Last entry must be zero */ { 0, } };