From patchwork Thu Jul 30 03:58:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victoria Milhoan X-Patchwork-Id: 6898201 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0FACF9F358 for ; Thu, 30 Jul 2015 04:31:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F13F205B6 for ; Thu, 30 Jul 2015 04:31:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0CB50205B5 for ; Thu, 30 Jul 2015 04:31:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750890AbbG3Ebu (ORCPT ); Thu, 30 Jul 2015 00:31:50 -0400 Received: from mail-by2on0147.outbound.protection.outlook.com ([207.46.100.147]:27136 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750732AbbG3Ebt (ORCPT ); Thu, 30 Jul 2015 00:31:49 -0400 Received: from CO2PR03CA0036.namprd03.prod.outlook.com (10.141.194.163) by BL2PR03MB564.namprd03.prod.outlook.com (10.141.92.156) with Microsoft SMTP Server (TLS) id 15.1.225.19; Thu, 30 Jul 2015 03:58:35 +0000 Received: from BL2FFO11FD010.protection.gbl (2a01:111:f400:7c09::122) by CO2PR03CA0036.outlook.office365.com (2a01:111:e400:1414::35) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Thu, 30 Jul 2015 03:58:35 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; arm.linux.org.uk; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD010.mail.protection.outlook.com (10.173.161.16) with Microsoft SMTP Server (TLS) id 15.1.231.11 via Frontend Transport; Thu, 30 Jul 2015 03:58:34 +0000 Received: from stc-hedley.am.freescale.net (stc-hedley.am.freescale.net [10.67.70.12]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t6U3wUbd025418; Wed, 29 Jul 2015 20:58:33 -0700 From: Victoria Milhoan To: CC: , , , , , Subject: [PATCH 04/12] crypto: caam - Modify Freescale CAAM driver Scatter Gather entry definition Date: Wed, 29 Jul 2015 20:58:21 -0700 Message-ID: <1438228709-27650-5-git-send-email-vicki.milhoan@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1438228709-27650-1-git-send-email-vicki.milhoan@freescale.com> References: <1438228709-27650-1-git-send-email-vicki.milhoan@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD010; 1:e9DT1ikPNFpVPVKtIMUjthA0wXtwuUDHnVmtMtQJU7TjRRnI12OVu0WfdBJ4/Q9esQ2B16Q6etBc3/nkUrxEgANJVmy4VmtBDTSMB5qzV6g7bJ24SguU2Ulm0R2GJsbcZTYZYx87mI3TeyPCiYBe4dcy3yuRaCdjp0H6w5CKbl12alRLfz3bzOJL/6VfnAumyw9GCWP6KDZYz6hL8/hioYcgivXYsFkqP6QO5hiHxPhOB6I8H7Zh96KZAl6MIegXovS3JDQsP5Af7QuzzmvMKC16qnSX29J/XS2O4O5ZLMcyvH6hYw87Ksx+vOuZn5A041RztM40LkAn9Up5FcOpMg== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(62966003)(77096005)(105606002)(229853001)(36756003)(76176999)(50466002)(106466001)(50986999)(77156002)(2950100001)(46102003)(50226001)(6806004)(19580405001)(19580395003)(33646002)(47776003)(104016003)(189998001)(110136002)(85426001)(48376002)(87936001)(92566002)(86362001)(2351001)(5001960100002); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR03MB564; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB564; 2:wVsXTlQGyyyaclZbV+udBTVv4jiOWMH+Z0QHXzZaudnyLp7XTOEQskKdapc/1PTCgjPsiVaqLThaMgEIWS7x5n/CkS1WOfjrYjP83Wwmn3lUlOx5GhWBKaQMRGfriYGp9pium3Dbx0IU+EKd/uTY/MtPH0IGLcgbgfoiMWmDE6M=; 3:s7QZw/sO+Y3M4PO88tIPLz15BmhCf1DwsdrKpXyXL2TyEwXLRuM2SWyf6H5v+yEV4S1YIWQ6sC/UzsbOxcp2Fuw5NuF6au91shhELg/u6s3CvqFyCTkwDtFmbvqAEIuX4wfhsQJn8L434GfY1U8G9cdKYsQTL+UboGS7BkivM4ZmZ9rWOAauzbf0RgJIRDYEt5gNCM3biVRHrdOeBcsF+yNS+z/3+WozW7CBXsvaSho=; 25:wZzZaXfBIAwkH1DUIQIlXL6ShhD0I5hrHAIyQAxjNYVptLtbgydPIBIwVS2Yxkn2/TXrwBMtArJU3ciPjr4opu1cw3jm3DjgTJaPqiN3LXQLil7RwAcy2mT74xpoQ/9EPjimHAcNZSAwE2gNrpCHxloW3y/Rr4/V+m1MXRI0Js+/p0TOqdk0QrQgGNTNqcopCvyaKjHKuFWQbRQvr/Aupbqfgqc1LSK1IRg/w1j3YS1/aPIUscp4BjOrFG3Xnh+Hv+GyOKRhJp4g6xhCO8u4iw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB564; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB564; 20:pz/w5A0Ol1OFw9/iiyu7Ol5oHsqDWssmBpHV3bCjAyUXvsxbJuM8IT/81az3M+8f5aIYyL7ppakNBhg/RUNs/WWjU0psTo3THMU1TSq9mFlWuB3jF+xJK4DltBvoypwWmTe9Ge2YvDEAdVUSMluyUOCpo3Sifv7Or6JKcxbbDSs5WOGogSDPi1KrRoy9ke1z7dJeB9KYkrnSNnO9eZb7M/5E3Ir/wCF8ROtqMlMgYso8kmYuCyXCu0yFXsEw6okBpS/YftpeEu/a1cyIQK4uYvGGDf9UuCKwvXXxzkLeoSbMmdZGH06KQ3ojwqfBWAaujEGI5W2YHk/1uuNI2GemAM9lJOZA72VkDFsYOZfILGU=; 4:svj++91J+z6/cDLJjTPtudcoJ2eZkQggGQkFBvxWfEHM0Kko17Ic5hKafPng1/7LCPdq3eRGbhMwgK3DzOZxYa+nWihcY7JBEKM420/zZwwazvHFIxQ5vrYg4hL3VoX0E92orPfdpMir9EFsJM8MFjTkAwoj8G88QFr3X8737HALCOm7Jt9aZqmO1i2EXB6vHG20Ki+NosTww6MZs7uCeyiQ6/scmh1XWzGU2wGdVSlIVvvuPD+IAeTmtgRXk9rA24Jws9xZhmzkXI8C13VBYD4qai96fhNJwyVF5ofs/ag= BL2PR03MB564: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BL2PR03MB564; BCL:0; PCL:0; RULEID:; SRVR:BL2PR03MB564; X-Forefront-PRVS: 06530126A4 X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB564; 23:XrCQG7xNq/+b31sVHMp91dLieq05WupB8eYMKtHubLr5f/DntswWWPzDMKtc4r8fbgz8lImwK61SSNP9bxBpj6GH825Dgiw13UGjfsSrRPkFnCbvuzlsa1JnC0ifBOoctmEZcORX8AMD4vrd9qYY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BUK/SqO4yPNgSdProIY0rEK+eAAYFIWmkMkNUsujfOD2BikbQZvi6O0gsyI9NEUQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2015 03:58:34.5513 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB564 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Modify the Scatter-Gather entry definitions for the Freescale CAAM driver to include support for both 64- and 32-bit DMA pointers. Signed-off-by: Victoria Milhoan --- drivers/crypto/caam/desc.h | 25 +++++++++++++++++++++---- drivers/crypto/caam/sg_sw_sec4.h | 1 - 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/caam/desc.h b/drivers/crypto/caam/desc.h index d397ff9..405acbf 100644 --- a/drivers/crypto/caam/desc.h +++ b/drivers/crypto/caam/desc.h @@ -8,12 +8,29 @@ #ifndef DESC_H #define DESC_H +/* + * 16-byte hardware scatter/gather table + * An 8-byte table exists in the hardware spec, but has never been + * implemented to date. The 8/16 option is selected at RTL-compile-time. + * and this selection is visible in the Compile Time Parameters Register + */ + +#define SEC4_SG_LEN_EXT 0x80000000 /* Entry points to table */ +#define SEC4_SG_LEN_FIN 0x40000000 /* Last ent in table */ +#define SEC4_SG_BPID_MASK 0x000000ff +#define SEC4_SG_BPID_SHIFT 16 +#define SEC4_SG_LEN_MASK 0x3fffffff /* Excludes EXT and FINAL */ +#define SEC4_SG_OFFS_MASK 0x00001fff + struct sec4_sg_entry { - u64 ptr; -#define SEC4_SG_LEN_FIN 0x40000000 -#define SEC4_SG_LEN_EXT 0x80000000 +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT + dma_addr_t ptr; +#else + u32 rsvd1; + dma_addr_t ptr; +#endif u32 len; - u8 reserved; + u8 rsvd2; u8 buf_pool_id; u16 offset; }; diff --git a/drivers/crypto/caam/sg_sw_sec4.h b/drivers/crypto/caam/sg_sw_sec4.h index b68b74c..711bb39 100644 --- a/drivers/crypto/caam/sg_sw_sec4.h +++ b/drivers/crypto/caam/sg_sw_sec4.h @@ -15,7 +15,6 @@ static inline void dma_to_sec4_sg_one(struct sec4_sg_entry *sec4_sg_ptr, { sec4_sg_ptr->ptr = dma; sec4_sg_ptr->len = len; - sec4_sg_ptr->reserved = 0; sec4_sg_ptr->buf_pool_id = 0; sec4_sg_ptr->offset = offset; #ifdef DEBUG