From patchwork Tue Jul 18 15:30:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Horia Geanta X-Patchwork-Id: 9848739 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 48AD7600CC for ; Tue, 18 Jul 2017 15:32:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BAAD2852B for ; Tue, 18 Jul 2017 15:32:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3001A28590; Tue, 18 Jul 2017 15:32:13 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4909B2852B for ; Tue, 18 Jul 2017 15:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YuC3i4HlZjEp4uv4OL7PtKuniUOXB1s4kuV3rDifCLY=; b=PKPghPumdEE5uy 4VTNi6HZSc6QDNGwbYEY4ONCAQYs3KpDVqX0uDzseMJjH7pQV3Jl2w51sBwsLnpo6gXM6eC47VVp6 nmyFu4+5ddkoYh8uPxS1m0VDNk8zcqpGB5LHP/m10SFNMeZIJuOSl0DFGkWlIfPsZa4QGNQbGZFnq oUBCeWzxMkC1+Yli53JcLYlAYHuCDDmTm/7L0dlayrWVHLvomNtgaD51y0iwckJ0KXORL344DN5z/ 7cIokWQPFPs0E/6bHF+86TUNVjm3F8+viaXoOrM4Wpjvc1hj/QR1HSqD+J3tXdM3gaa9NoJOg3rN7 983bt1SMCHbbR2sc/W1w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dXUTq-00078o-HG; Tue, 18 Jul 2017 15:32:10 +0000 Received: from mail-cys01nam02on0074.outbound.protection.outlook.com ([104.47.37.74] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dXUTU-0006rc-7U for linux-arm-kernel@lists.infradead.org; Tue, 18 Jul 2017 15:31:50 +0000 Received: from MWHPR03CA0054.namprd03.prod.outlook.com (10.174.173.171) by CY1PR0301MB0907.namprd03.prod.outlook.com (10.160.165.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.13; Tue, 18 Jul 2017 15:31:24 +0000 Received: from BN1AFFO11FD011.protection.gbl (2a01:111:f400:7c10::124) by MWHPR03CA0054.outlook.office365.com (2603:10b6:301:3b::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.13 via Frontend Transport; Tue, 18 Jul 2017 15:31:24 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BN1AFFO11FD011.mail.protection.outlook.com (10.58.52.71) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1240.9 via Frontend Transport; Tue, 18 Jul 2017 15:31:23 +0000 Received: from enigma.ea.freescale.net (enigma.ea.freescale.net [10.171.77.120]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v6IFVGxQ024327; Tue, 18 Jul 2017 08:31:20 -0700 From: =?UTF-8?q?Horia=20Geant=C4=83?= To: Herbert Xu , Shawn Guo Subject: [PATCH 1/4] crypto: caam/jr - add support for DPAA2 parts Date: Tue, 18 Jul 2017 18:30:47 +0300 Message-ID: <20170718153050.15330-2-horia.geanta@nxp.com> X-Mailer: git-send-email 2.12.0.264.gd6db3f216544 In-Reply-To: <20170718153050.15330-1-horia.geanta@nxp.com> References: <20170718153050.15330-1-horia.geanta@nxp.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131448654835889096; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39410400002)(39850400002)(39380400002)(39840400002)(39860400002)(39400400002)(39450400003)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(2950100002)(105606002)(23676002)(2906002)(50226002)(38730400002)(1076002)(53936002)(8936002)(8656003)(36756003)(4326008)(104016004)(33646002)(86362001)(77096006)(54906002)(81166006)(356003)(498600001)(189998001)(47776003)(5820100001)(8676002)(50466002)(2870700001)(85426001)(626005)(5660300001)(305945005)(6666003)(50986999)(76176999)(106466001)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0907; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD011; 1:8wwhfIys2hvwxGBMj9iyLbHch1lk4iA6BNjTJmwkwMhv7+DbGU8jc8p9DL1pCh57npEvYfjTtEmzuOfNYtYWJ3v6xlWOxzvanOsaid1qfqiC1/u4HD6Mb6l3YbY8vtY3UEN/UxeWyTMj4/WtrE7LQqje68qamrE8Hm6D2GeSxqFUqB+2aeeWRrucOG0AoQf8t+Daflm8xwBCx1/yQ087qulG1+OEc0WGZ8ViE/+r2dIy3+NTDd1dGtEwmi4giyExB60lP4UePIhZTLrCdKBrbHettuQxO2mNgiD1j3pVVls4bN0vsZwsrHED1WuXTsNhzz7n+RtSYtPf6jdyZidG3psm3aygWG8eLmEsgA6h9/zo/m3xhiUBywWSPKnY9z+qAaIkmnDxP7ncbCjYw14PioGFllk3IfcJqRDVUKxROgBB9pW9gsLF0iP9hNs8bN8JtFI/6T3LnX6/GCrtaUiK4j9XYTWjD/P4q5jZ1032EYHztE689v3NRZ96gF5xCar4LT+0gdAv8OrMzfqIXyHb4N+C17QK4UeIbk+4acFWYIklVaVcgvjpTZK6sYr6/7iRweLMSpnpYpQYnEqnfMAboCYQK81FZls5t7ynmiZ7POP+N6FcveHslsyvsEFSZyhXCQI0dJ7XqkHIMfiTqBolyaMQ49whSTZviTqvoFEc892914+sombVG7CwZ/HCAv3ZBohEpa6R4fa0pMzOxFb+blX3vmw1GQT04RFQ0HJt7nJNHtL8Chl+LddpXH09oetaTOUpfp+8KVL4yD3jiBcrNcPVXRISnaU8VePM+o36YCAxkqduMIuXlikC1I+mpR/DeXRMw9uJZ2XRjMFS172bMjhDJCVdVeg53XkM5wLXiEcuPaZG3W95NqncA4+v344eYkd0LZLfQP6IwW5cXNjc4TdRSKkobGWXsWeIFAk0Q7oHucs4Bawk9auNVEEvhb5L X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2350eecd-bc0b-4a81-28c8-08d4cdf20c16 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603031)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR0301MB0907; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0907; 3:I70lWmnjligdRmaP6MJVq1VpqGKvLNxxWcPlv/+Hy7kLQu8dgDzD8A3NH8k/AARRSA8VYZerXwqShnIRmv7somFagnLAZTdB9oEZ9Vkpn5bWTUGgKaQbYgUQdu5FPWTEm5F+JzHj8ikRWt3iFrG6K6HMWnTmxMQpAs5u/nrPiBHJajF/l4MVIha9G9s1Rkbxa5rtrRr7ulYlDYwq7/IF0V4kIs4Ux6pNH8r3HnMvyLCWQ+osPvPFdO58/iOLbm5rHd1G2/iaaTe+aYzuFWac39KSZ60ajrBQmeHXkyjWSbOdtKs6Vu2HorzlwI/35OeZbajhyF1NVLAjRZitEsYUwsA2DbVXzfKnpMkgprVXh8TrxJ17equz5WpfVvF8WnXXhjRCtzvyhcp+E5IoLQP/efdoY7s2B/IqnLp7S1kMUOi4Zyhq6qrQndrLtNjwBTISgulYq7GCc8cA+8STxhUEe/jMF4IJBSYXoxb+z11ZvODYJqlNZdlVfPtFqm70zpgA5xZMoDu7yJqrZ88JjcwQ2h67MLdX883fk7FvL4jDfYjanxe5S+ziXl0FRjiv+ql65YeorerKI5tAgUCNDdQGxwy8aoF3JmvO6Wx0x6F8nfh6fC2oidFqJJGF0Itw8+7pIq5Rc/p2XdZ3p1jMMxsHfC1XWGEIeV/Ut2eahVmCcVSBf482m3EnWRH+TS2X9QAB2MvbY903b5BkDhLq8RdZP81WJooUA5J8Mgw/j64CJER3PIutQ66wjdmXdCLYvLIJGah7AQMFMW1jRsGRUMAQL1TGLTf6LXg48K0AtqpuqN3XG8fqYIIKomBC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s8= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0907; 31:H8SYti8eYFwXGjqDBxzbl3GqsgrrxGytGMv6pFcg2nct3IMsl7tM7UwUCm3mGqJti4Ffmtgj73XqQ5F2HBwCnBs7nxAStpXclTdbSO5SwXxECVD6ai1Tw9z9FtVi+wAjdJXkOQ2BAS7t8nPfG91ul+eX08CX78h8jU7d347yiVON4QePjBhxsh18UMiRDoVU1QcsiPWsdiT8d/csoPDKfMamZL2VxdgsfyYRXT6exAactml5nGa1XufecCCLBe54X/e+5gLOpvR21ZRtSHnM7SvARRuGDjVTd8OPUp3Zs1zbzx7okoOUkXl7D1RMW7uu/uLkvwOsy17zx8ZNG03vMjZHIIqLYdMQTZEI7D9Ikn1CvUq03AtUbW0GlYpyhvVcd/Kp0MMwFw+r/4uHon/sA7T4tQyvb79LfewNPXlGL4yEqycreCvDy5sRhC/hzUXTiHszrMCuNFh2C8vJOt1jtS7m6dx+T8o+IWM6r7NBbibtOkD2G7FlZogSS4mf5OWG9lC+8IK1F69vbulwpLPEMk3YTy4+C7eK2WgyZfJASjp52klRpmUtl/mjSenbov1fdnRUObJhUSWluIKhVBZ8OWEROZS9mBnjinSG9c3A92wOE1hAVwRFEtLOjm7S20PM6jgBthEppC7xs2wnXUb/aveZ67D2u3zUcEDWTsRM2k6DMgg/sie9x2iMM6CpoGWa X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(236129657087228)(185117386973197)(48057245064654)(148574349560750)(158140799945019); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(2017060910075)(5005006)(13016025)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123563025)(20161123561025)(20161123559100)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(20161123556025)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0301MB0907; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0301MB0907; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjAzMDFNQjA5MDc7NDpBUXVqQ3J4Z0JPMHVvOW5CWHcxNDRKZG1i?= =?utf-8?B?c05HdEJaVHdtMHZFV3E4WFFORWFKOXJuMWMvZkNwZHJwNzNSaVZqTVhwbGQv?= =?utf-8?B?ZWRmRTA3Q1R2SGwrL1JuY0xXT2FEVlhORm5IbkFodlR4MEtFR2NQdlJiNW11?= =?utf-8?B?dlFXS2dhQ1lFZlBKWVBCUGZGbE5XclAvTWxIVGkxeGpsbzFYUFFJTUZHL2Zm?= =?utf-8?B?T29PQy9HQ0ZRMGs3UHdOVTVJNFltK3IxYUFQNXk5dlpKdVFGM2J0K01JWUZK?= =?utf-8?B?Vi9rK1pmNlFhK0FTQkpsOEptMVRNekJWR3Y0dDRLQ1paR1pXdGtsa2lzUlF0?= =?utf-8?B?S1VwdkZEbVJOdlBpaDY4RDB1Z01lZ3dDVnV2djlTMVl3U3BoSzhGTmp6YW80?= =?utf-8?B?M0JZdTNGSmtJS1lZM0t6bitMeTBBd2UrajJHNGdWV0FDN0VNQm9NMmpyYWNZ?= =?utf-8?B?dEl5TGZIVUQ3dnVGVWlkSy81QSthSEdBcFNqYS9MWUxlS29DbUw3MzR6WlRB?= =?utf-8?B?TzBoanYrR3g5S1Fmd1RienVhZUNDc0oxNzA0U09pb3hTSGJINFRCbnNhRnh5?= =?utf-8?B?aEcvVDdtTGg4RWRUc2RLVUlVZnpBNjRVb1Nkb2s0MjlxcjQ5bndPVFp3bjF6?= =?utf-8?B?Wm5adGx4ZnFhTlR4ZkNKUXg4RlZaWXJhWGZqd3hDL3B2NDlSRlRHRitsSGRS?= =?utf-8?B?V1daUlRHamdKM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hDw8Gnk0QJyEYs+H/7GoFby1okzIO9P9L/QIq9tSz24+hrT7VZ8DDL+7N49X0B3WoamZW+vVl18VmLSoEwhcStldQoZQkkCvXK8BPDdnpbfcoKIF9uWD9RUX8wD4cRWom9rsRQFQTHAc0sQ4kdjFwB0i93MGg/QeQNGVywoRdcVkrJn6bW8WaFQrGXc7y+XEoxaT7IuzUhI9Z6G33Un6pyTBU0aBsrlPnyBR3YOUFVOyxgaT7BISyEOocSyGzZgP02ZSPsbVG4/ro/+ffNJ+4oUJZcMj94n256cZV1gJVC9kBCA6Fbx+JzrnabbNifBRfQWYGSZdUdlIV0m/XG//skURmOJW72R/AaTJqdW4N2kjf2tpIIfbsSE+XNgUeixewXnxocMFJyiwmzVeMxxcwjhahpd21AKJLrudwOCkqLn5iiGEVqt1UKP1Lu+A+9Wun0pTTp2M= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2017 15:31:23.1989 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0907 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170718_083148_403373_674949E9 X-CRM114-Status: UNSURE ( 8.29 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Dan Douglass , Rob Herring , linux-crypto@vger.kernel.org, "David S. Miller" , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for using the caam/jr backend on DPAA2-based SoCs. These have some particularities we have to account for: -HW S/G format is different -Management Complex (MC) firmware initializes / manages (partially) the CAAM block: MCFGR, QI enablement in QICTL, RNG Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamhash.c | 7 ++-- drivers/crypto/caam/ctrl.c | 45 ++++++++++++++-------- drivers/crypto/caam/ctrl.h | 2 + drivers/crypto/caam/jr.c | 7 +++- drivers/crypto/caam/regs.h | 1 + drivers/crypto/caam/sg_sw_qm2.h | 81 ++++++++++++++++++++++++++++++++++++++++ drivers/crypto/caam/sg_sw_sec4.h | 30 +++++++++++++-- 7 files changed, 148 insertions(+), 25 deletions(-) create mode 100644 drivers/crypto/caam/sg_sw_qm2.h diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index 910ec61cae09..698580b60b2f 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -791,8 +791,8 @@ static int ahash_update_ctx(struct ahash_request *req) to_hash - *buflen, *next_buflen, 0); } else { - (edesc->sec4_sg + sec4_sg_src_index - 1)->len |= - cpu_to_caam32(SEC4_SG_LEN_FIN); + sg_to_sec4_set_last(edesc->sec4_sg + sec4_sg_src_index - + 1); } desc = edesc->hw_desc; @@ -882,8 +882,7 @@ static int ahash_final_ctx(struct ahash_request *req) if (ret) goto unmap_ctx; - (edesc->sec4_sg + sec4_sg_src_index - 1)->len |= - cpu_to_caam32(SEC4_SG_LEN_FIN); + sg_to_sec4_set_last(edesc->sec4_sg + sec4_sg_src_index - 1); edesc->sec4_sg_dma = dma_map_single(jrdev, edesc->sec4_sg, sec4_sg_bytes, DMA_TO_DEVICE); diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 7338f15b8674..fdbcba13824c 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -17,6 +17,8 @@ bool caam_little_end; EXPORT_SYMBOL(caam_little_end); +bool caam_dpaa2; +EXPORT_SYMBOL(caam_dpaa2); #ifdef CONFIG_CAAM_QI #include "qi.h" @@ -319,8 +321,11 @@ static int caam_remove(struct platform_device *pdev) caam_qi_shutdown(ctrlpriv->qidev); #endif - /* De-initialize RNG state handles initialized by this driver. */ - if (ctrlpriv->rng4_sh_init) + /* + * De-initialize RNG state handles initialized by this driver. + * In case of DPAA 2.x, RNG is managed by MC firmware. + */ + if (!caam_dpaa2 && ctrlpriv->rng4_sh_init) deinstantiate_rng(ctrldev, ctrlpriv->rng4_sh_init); /* Shut down debug views */ @@ -552,12 +557,17 @@ static int caam_probe(struct platform_device *pdev) /* * Enable DECO watchdogs and, if this is a PHYS_ADDR_T_64BIT kernel, - * long pointers in master configuration register + * long pointers in master configuration register. + * In case of DPAA 2.x, Management Complex firmware performs + * the configuration. */ - clrsetbits_32(&ctrl->mcr, MCFGR_AWCACHE_MASK | MCFGR_LONG_PTR, - MCFGR_AWCACHE_CACH | MCFGR_AWCACHE_BUFF | - MCFGR_WDENABLE | MCFGR_LARGE_BURST | - (sizeof(dma_addr_t) == sizeof(u64) ? MCFGR_LONG_PTR : 0)); + caam_dpaa2 = !!(comp_params & CTPR_MS_DPAA2); + if (!caam_dpaa2) + clrsetbits_32(&ctrl->mcr, MCFGR_AWCACHE_MASK | MCFGR_LONG_PTR, + MCFGR_AWCACHE_CACH | MCFGR_AWCACHE_BUFF | + MCFGR_WDENABLE | MCFGR_LARGE_BURST | + (sizeof(dma_addr_t) == sizeof(u64) ? + MCFGR_LONG_PTR : 0)); /* * Read the Compile Time paramters and SCFGR to determine @@ -586,7 +596,9 @@ static int caam_probe(struct platform_device *pdev) JRSTART_JR3_START); if (sizeof(dma_addr_t) == sizeof(u64)) { - if (of_device_is_compatible(nprop, "fsl,sec-v5.0")) + if (caam_dpaa2) + ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(49)); + else if (of_device_is_compatible(nprop, "fsl,sec-v5.0")) ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(40)); else ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(36)); @@ -629,11 +641,9 @@ static int caam_probe(struct platform_device *pdev) ring++; } - /* Check to see if QI present. If so, enable */ - ctrlpriv->qi_present = - !!(rd_reg32(&ctrl->perfmon.comp_parms_ms) & - CTPR_MS_QI_MASK); - if (ctrlpriv->qi_present) { + /* Check to see if (DPAA 1.x) QI present. If so, enable */ + ctrlpriv->qi_present = !!(comp_params & CTPR_MS_QI_MASK); + if (ctrlpriv->qi_present && !caam_dpaa2) { ctrlpriv->qi = (struct caam_queue_if __iomem __force *) ((__force uint8_t *)ctrl + BLOCK_OFFSET * QI_BLOCK_NUMBER @@ -661,8 +671,10 @@ static int caam_probe(struct platform_device *pdev) /* * If SEC has RNG version >= 4 and RNG state handle has not been * already instantiated, do RNG instantiation + * In case of DPAA 2.x, RNG is managed by MC firmware. */ - if ((cha_vid_ls & CHA_ID_LS_RNG_MASK) >> CHA_ID_LS_RNG_SHIFT >= 4) { + if (!caam_dpaa2 && + (cha_vid_ls & CHA_ID_LS_RNG_MASK) >> CHA_ID_LS_RNG_SHIFT >= 4) { ctrlpriv->rng4_sh_init = rd_reg32(&ctrl->r4tst[0].rdsta); /* @@ -730,8 +742,9 @@ static int caam_probe(struct platform_device *pdev) /* Report "alive" for developer to see */ dev_info(dev, "device ID = 0x%016llx (Era %d)\n", caam_id, caam_get_era()); - dev_info(dev, "job rings = %d, qi = %d\n", - ctrlpriv->total_jobrs, ctrlpriv->qi_present); + dev_info(dev, "job rings = %d, qi = %d, dpaa2 = %s\n", + ctrlpriv->total_jobrs, ctrlpriv->qi_present, + caam_dpaa2 ? "yes" : "no"); #ifdef CONFIG_DEBUG_FS diff --git a/drivers/crypto/caam/ctrl.h b/drivers/crypto/caam/ctrl.h index cac5402a46eb..7e7bf68c9ef5 100644 --- a/drivers/crypto/caam/ctrl.h +++ b/drivers/crypto/caam/ctrl.h @@ -10,4 +10,6 @@ /* Prototypes for backend-level services exposed to APIs */ int caam_get_era(void); +extern bool caam_dpaa2; + #endif /* CTRL_H */ diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c index 1ccfb317d468..d258953ff488 100644 --- a/drivers/crypto/caam/jr.c +++ b/drivers/crypto/caam/jr.c @@ -9,6 +9,7 @@ #include #include "compat.h" +#include "ctrl.h" #include "regs.h" #include "jr.h" #include "desc.h" @@ -499,7 +500,11 @@ static int caam_jr_probe(struct platform_device *pdev) jrpriv->rregs = (struct caam_job_ring __iomem __force *)ctrl; if (sizeof(dma_addr_t) == sizeof(u64)) { - if (of_device_is_compatible(nprop, "fsl,sec-v5.0-job-ring")) + if (caam_dpaa2) + error = dma_set_mask_and_coherent(jrdev, + DMA_BIT_MASK(49)); + else if (of_device_is_compatible(nprop, + "fsl,sec-v5.0-job-ring")) error = dma_set_mask_and_coherent(jrdev, DMA_BIT_MASK(40)); else diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h index 84d2f838a063..2b5efff9ec3c 100644 --- a/drivers/crypto/caam/regs.h +++ b/drivers/crypto/caam/regs.h @@ -293,6 +293,7 @@ struct caam_perfmon { u32 cha_rev_ls; /* CRNR - CHA Rev No. Least significant half*/ #define CTPR_MS_QI_SHIFT 25 #define CTPR_MS_QI_MASK (0x1ull << CTPR_MS_QI_SHIFT) +#define CTPR_MS_DPAA2 BIT(13) #define CTPR_MS_VIRT_EN_INCL 0x00000001 #define CTPR_MS_VIRT_EN_POR 0x00000002 #define CTPR_MS_PG_SZ_MASK 0x10 diff --git a/drivers/crypto/caam/sg_sw_qm2.h b/drivers/crypto/caam/sg_sw_qm2.h new file mode 100644 index 000000000000..31b440757146 --- /dev/null +++ b/drivers/crypto/caam/sg_sw_qm2.h @@ -0,0 +1,81 @@ +/* + * Copyright 2015-2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the names of the above-listed copyright holders nor the + * names of any contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SG_SW_QM2_H_ +#define _SG_SW_QM2_H_ + +#include "../../../drivers/staging/fsl-mc/include/dpaa2-fd.h" + +static inline void dma_to_qm_sg_one(struct dpaa2_sg_entry *qm_sg_ptr, + dma_addr_t dma, u32 len, u16 offset) +{ + dpaa2_sg_set_addr(qm_sg_ptr, dma); + dpaa2_sg_set_format(qm_sg_ptr, dpaa2_sg_single); + dpaa2_sg_set_final(qm_sg_ptr, false); + dpaa2_sg_set_len(qm_sg_ptr, len); + dpaa2_sg_set_bpid(qm_sg_ptr, 0); + dpaa2_sg_set_offset(qm_sg_ptr, offset); +} + +/* + * convert scatterlist to h/w link table format + * but does not have final bit; instead, returns last entry + */ +static inline struct dpaa2_sg_entry * +sg_to_qm_sg(struct scatterlist *sg, int sg_count, + struct dpaa2_sg_entry *qm_sg_ptr, u16 offset) +{ + while (sg_count && sg) { + dma_to_qm_sg_one(qm_sg_ptr, sg_dma_address(sg), + sg_dma_len(sg), offset); + qm_sg_ptr++; + sg = sg_next(sg); + sg_count--; + } + return qm_sg_ptr - 1; +} + +/* + * convert scatterlist to h/w link table format + * scatterlist must have been previously dma mapped + */ +static inline void sg_to_qm_sg_last(struct scatterlist *sg, int sg_count, + struct dpaa2_sg_entry *qm_sg_ptr, + u16 offset) +{ + qm_sg_ptr = sg_to_qm_sg(sg, sg_count, qm_sg_ptr, offset); + dpaa2_sg_set_final(qm_sg_ptr, true); +} + +#endif /* _SG_SW_QM2_H_ */ diff --git a/drivers/crypto/caam/sg_sw_sec4.h b/drivers/crypto/caam/sg_sw_sec4.h index 2f6bf162bb6c..936b1b630058 100644 --- a/drivers/crypto/caam/sg_sw_sec4.h +++ b/drivers/crypto/caam/sg_sw_sec4.h @@ -5,7 +5,13 @@ * */ +#ifndef _SG_SW_SEC4_H_ +#define _SG_SW_SEC4_H_ + +#include "ctrl.h" #include "regs.h" +#include "sg_sw_qm2.h" +#include "../../../drivers/staging/fsl-mc/include/dpaa2-fd.h" struct sec4_sg_entry { u64 ptr; @@ -19,9 +25,15 @@ struct sec4_sg_entry { static inline void dma_to_sec4_sg_one(struct sec4_sg_entry *sec4_sg_ptr, dma_addr_t dma, u32 len, u16 offset) { - sec4_sg_ptr->ptr = cpu_to_caam_dma64(dma); - sec4_sg_ptr->len = cpu_to_caam32(len); - sec4_sg_ptr->bpid_offset = cpu_to_caam32(offset & SEC4_SG_OFFSET_MASK); + if (caam_dpaa2) { + dma_to_qm_sg_one((struct dpaa2_sg_entry *)sec4_sg_ptr, dma, len, + offset); + } else { + sec4_sg_ptr->ptr = cpu_to_caam_dma64(dma); + sec4_sg_ptr->len = cpu_to_caam32(len); + sec4_sg_ptr->bpid_offset = cpu_to_caam32(offset & + SEC4_SG_OFFSET_MASK); + } #ifdef DEBUG print_hex_dump(KERN_ERR, "sec4_sg_ptr@: ", DUMP_PREFIX_ADDRESS, 16, 4, sec4_sg_ptr, @@ -47,6 +59,14 @@ sg_to_sec4_sg(struct scatterlist *sg, int sg_count, return sec4_sg_ptr - 1; } +static inline void sg_to_sec4_set_last(struct sec4_sg_entry *sec4_sg_ptr) +{ + if (caam_dpaa2) + dpaa2_sg_set_final((struct dpaa2_sg_entry *)sec4_sg_ptr, true); + else + sec4_sg_ptr->len |= cpu_to_caam32(SEC4_SG_LEN_FIN); +} + /* * convert scatterlist to h/w link table format * scatterlist must have been previously dma mapped @@ -56,5 +76,7 @@ static inline void sg_to_sec4_sg_last(struct scatterlist *sg, int sg_count, u16 offset) { sec4_sg_ptr = sg_to_sec4_sg(sg, sg_count, sec4_sg_ptr, offset); - sec4_sg_ptr->len |= cpu_to_caam32(SEC4_SG_LEN_FIN); + sg_to_sec4_set_last(sec4_sg_ptr); } + +#endif /* _SG_SW_SEC4_H_ */