From patchwork Wed Aug 5 18:28:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victoria Milhoan X-Patchwork-Id: 6952341 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 F22509F358 for ; Wed, 5 Aug 2015 18:28:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1224C205E3 for ; Wed, 5 Aug 2015 18:28:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 20DB7205EE for ; Wed, 5 Aug 2015 18:28:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753479AbbHES2y (ORCPT ); Wed, 5 Aug 2015 14:28:54 -0400 Received: from mail-bl2on0121.outbound.protection.outlook.com ([65.55.169.121]:60096 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752570AbbHES2x (ORCPT ); Wed, 5 Aug 2015 14:28:53 -0400 Received: from BY2PR03CA008.namprd03.prod.outlook.com (10.255.93.25) by DM2PR03MB575.namprd03.prod.outlook.com (10.141.84.151) with Microsoft SMTP Server (TLS) id 15.1.225.19; Wed, 5 Aug 2015 18:28:51 +0000 Received: from BY2FFO11FD024.protection.gbl (10.255.93.4) by BY2PR03CA008.outlook.office365.com (10.255.93.25) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Wed, 5 Aug 2015 18:28:50 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; kernel.org; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD024.mail.protection.outlook.com (10.1.15.213) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Wed, 5 Aug 2015 18:28:50 +0000 Received: from stc-hedley.am.freescale.net (stc-hedley.am.freescale.net [10.67.70.12]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t75ISmA8019320; Wed, 5 Aug 2015 11:28:50 -0700 From: Victoria Milhoan To: CC: , , , , , , Subject: [PATCH v2 04/14] crypto: caam - Modify Freescale CAAM driver Scatter Gather entry definition Date: Wed, 5 Aug 2015 11:28:38 -0700 Message-ID: <1438799328-10757-5-git-send-email-vicki.milhoan@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1438799328-10757-1-git-send-email-vicki.milhoan@freescale.com> References: <1438228709-27650-1-git-send-email-vicki.milhoan@freescale.com> <1438799328-10757-1-git-send-email-vicki.milhoan@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD024; 1:30a6FRgMfayLsacRZPXANoRPJ4jgDNNYDkw1To/RxLcKeXYeN5DuGA8sHfOVJJa1g72h3zke5XK35LKFG8DlWoZ4wqW1wa/WDVsBkXIBpUo69erbQ+bN/pMuI5ftv8tm1Bh+d2hq+417xxlbKH/dQ2CZiYO+WDV2IvWhbl/iat2FryreWRVcrNfqVjKU10miWW/CRMlRE4ht6E9Ct+mJUIu0JoMnb0/x21hfpcYzM/ABZ3jvkqKbfsXLQOgwTzCgA7jC5ukhnsgZ5Ren3AG6AXryinGG8mccOiYhUTvinepirxlQww5Iv6kIuZRERQQu3+RPV/mX2hx+PwcVwLLaVg== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(19580405001)(5001830100001)(86362001)(87936001)(76176999)(19580395003)(92566002)(85426001)(69596002)(50466002)(81156007)(4001540100001)(48376002)(50986999)(5001860100001)(50226001)(189998001)(6806004)(106466001)(47776003)(33646002)(110136002)(64706001)(5003940100001)(46102003)(104016003)(105606002)(77156002)(36756003)(5001960100002)(97736004)(68736005)(2351001)(2950100001)(229853001)(77096005)(62966003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR03MB575; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB575; 2:J5vEyKHzyYK5TQjL/rmEdqTEv6EqIygDsIPlI9To96lBU5QUZswgB+jHjIIIPDG6uIoosFEoaXlP1JHT8xxcRdAbJzL5NxUzdG/UpMl67HL0WC9iYqV82TQpqJ5kcwvTsTQwyzxXLlNycWIbLgUlf4On/JghEGlU3WEmDJcDgtg=; 3:WB/LuIFUrMMjA07vDKBaoNThBjM7KQB0QddmGHtj4eRvJiD1F3q2HAk+XcWGgexR2xP3hZcFyt1HHcUh58e8wCbyxbLpN4/zvRnZ0NpXeBfKZ4gtKAsb+OSovRS+lDe45/OnZNpBuD/wz07ZSpKSQlr557h1YRXLkG02/XiPMSBIHgBDElh98kN0qWSlF8oxOK0vJDBYVzfTc6LzhcEdDQ32sihWLyw1faPzYbceXPk=; 25:qh/5kaD4fSLSXpSnLw13RvoHv6wW8Rrb5jpHpnSh1QaApHV3tzgoFOmbFKgetRdJVXySMRm2FVwYXWV7dBmQm2DLnsS92r5LeUJYtq8au4Ru7BIO7mlCY73PnyVioRCrj32p6BoCn+yq5prHwr3I+Lp97A9QO5/2bHoWuZl8FgAIIG8bPO1HZHLDZJ+3WgrsKY93GmPrLE2a6CKuf7p0QEsQfT77jW78TCAPRm9UVF+acNoLZzyV5c62BwmpDQQEY+MnAW5E1xNK6HIm/FTyeA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB575; X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB575; 20:qTLvrrRFAMn42b1DQMfdpXS/wIZ/w5CAEpgCnIk4ShKQ1dhdjcZxxcusjFVlzUEAL2gkh0nVRfBePTC5+jGQY6LrT3RqjROinTp/nSJEFvh/uO1wHlfpkBqaVwOAziADE4UWOvXXNwII8K+0qGFH18bDbzpfKm/v2vT9Hn3puxlVWcUVouSps/8kDtDT0Et5Rv04dgMltFbTiomJ97OlehlZQRJxmWz25KNYeQlZZGI3QIgttg3edj3GVFn//Re204p61PRyLpUQgj8fqSgRvkxlOcNrl+mU2iq/5yJeXCJ4YjAbf47QqZ55ekrvomL4qUXTuJEAKJ4c5QIc/tTN9zYr1AL4t/8BJAsgZxA1sj0=; 4:6FEBOBOefrkX8z7rieul9xgJNc2rSfvVrdiwedJu9GRXiGJN5+W2UWP4e3MKRfEsK1L3wZsQOBtDkfcmo4dwWD0NZXEJh4VdGXZ6yM/mhTEg36bkCtcDMxQcTgediSMfiWhhX2WMeDvq6T3i1Oi1N/TcpKzwauDwA9ZK8TYuGrg3iHVsy9yYU+PQng3EFLuXfzR5IuK1U+gadtm3pgKai8t/i5AIYGv5htkiBI7DIgRVPM7gVxuyDtm0cuK/vGJ8LjEia+PjoHSy9od3S8nqavlIDCqTMDc93Nt7a5M+/No= 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:DM2PR03MB575; BCL:0; PCL:0; RULEID:; SRVR:DM2PR03MB575; X-Forefront-PRVS: 06592CCE58 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR03MB575; 23:umCCvISCNDKJC3+o43lJSoncniqFAJes9LeXTXwlnA?= =?us-ascii?Q?U/b6TCXvXGCDQ+RHdfevp//hzrmDLIGQarpR5wCstAA4UTlrRidqWNvjzqlb?= =?us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lwM8LI2Hb43OrFUH+64i?= =?us-ascii?Q?4pFwoGoOpMdmVcMbB0TYZRK8ecPHOnOavmpDI26jrfuP18VDMYTpLL8hudJT?= =?us-ascii?Q?WIv1+lgSFkRoG/DpXw3V0NAtXnEq3IlrEoNVHUOWK/JE+lS6125nv24KWmM3?= =?us-ascii?Q?HdbQB8S2w=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB575; 5:22M8J85XjPlRQ9rHmux8VPMsDRvDSUU4KottwbhTPW48LCmFaZTG95sqbUI+OuOx8E6B+1f3yRAVY/gGnvyorXQpJKwxVek+qPDr/TxPoU4EexjoJbbKIa0HlgCdj6oDYo9vlaP6JFMuBg8dDexuHg==; 24:06I/+n68gZBzgrkQGWh20xSkRaHWGGftQbDRvYgcWPOfgXjc1YwYE2zPw/Yc/GSbLz+NWKVLQ0U3+8IksjYiO8fG4kBEtkUZdo9a1mgE0Do=; 20:O+hgY+JL/cB90ot9PoxAf0MPIrpPc72R+S/e6otwZMcXJqlmoOYONURhl3vrqhLCUcbed7omW/vtg7lLm5vfIw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2015 18:28:50.7739 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB575 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-7.0 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