From patchwork Thu Aug 10 17:42:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Horia Geanta X-Patchwork-Id: 9894431 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 8FE7B60384 for ; Thu, 10 Aug 2017 17:46:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F85228B41 for ; Thu, 10 Aug 2017 17:46:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73A5928B2D; Thu, 10 Aug 2017 17:46:46 +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,RCVD_IN_DNSWL_NONE 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 D9AA828B2D for ; Thu, 10 Aug 2017 17:46:45 +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=vdn4cfkS1jCAnCAPI9je1U87f9hCHe4HO5kLlPIgb8Y=; b=fwtq3ZgR7eqUHy 06hw8ggHAZyJhCARnzESaxnrPuKsPALiPdepvHyajWWhtgOpLruLFyESQ1AGSdNRsQCYpf13ya8U7 if3z797bMDGdWV/6Ikc/ySvhiMlngvZT/YSlyAIqJ5fU30OHZIO6acSsSUdMP36JriCJISGr0otBD UFvO0qKvAiuH4CdaGNE36q0s+aBE2xpY9B3VeIhDa9vrvZVcgpKdyg/vEGBLb2j/M230qChM4yFv0 gFaDHK9zFCCnBDTyYnMFxtmySZ5N3OeadGnc9s55Nwu9lpNP5oivpdELA6YtLmXGnsDQQWmw34cQT FZ8JN/K7zFjRFTIQplLg==; 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 1dfrXb-0005ug-GV; Thu, 10 Aug 2017 17:46:39 +0000 Received: from mail-by2nam01on0088.outbound.protection.outlook.com ([104.47.34.88] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dfrVO-0002zc-Su for linux-arm-kernel@lists.infradead.org; Thu, 10 Aug 2017 17:44:28 +0000 Received: from BN6PR03CA0071.namprd03.prod.outlook.com (10.173.137.33) by BN3PR03MB2260.namprd03.prod.outlook.com (10.166.74.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1320.16; Thu, 10 Aug 2017 17:43:50 +0000 Received: from BY2FFO11FD013.protection.gbl (2a01:111:f400:7c0c::141) by BN6PR03CA0071.outlook.office365.com (2603:10b6:404:4c::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1320.16 via Frontend Transport; Thu, 10 Aug 2017 17:43:50 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; driverdev.osuosl.org; dkim=none (message not signed) header.d=none;driverdev.osuosl.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 BY2FFO11FD013.mail.protection.outlook.com (10.1.14.75) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1304.16 via Frontend Transport; Thu, 10 Aug 2017 17:43:50 +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 v7AHhN1x012849; Thu, 10 Aug 2017 10:43:46 -0700 From: =?UTF-8?q?Horia=20Geant=C4=83?= To: Herbert Xu , Greg Kroah-Hartman , Stuart Yoder , Laurentiu Tudor , Ioana Radulescu , Catalin Marinas , Will Deacon Subject: [RFC PATCH 07/10] crypto: caam - add Queue Interface v2 error codes Date: Thu, 10 Aug 2017 20:42:50 +0300 Message-ID: <20170810174253.20951-8-horia.geanta@nxp.com> X-Mailer: git-send-email 2.12.0.264.gd6db3f216544 In-Reply-To: <20170810174253.20951-1-horia.geanta@nxp.com> References: <20170810174253.20951-1-horia.geanta@nxp.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131468606303064289; (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)(39840400002)(39380400002)(39860400002)(39400400002)(39850400002)(39410400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(53936002)(2870700001)(8656003)(4326008)(68736007)(1076002)(33646002)(38730400002)(105606002)(54906002)(23676002)(86362001)(36756003)(50466002)(77096006)(626005)(106466001)(39060400002)(104016004)(81156014)(50986999)(76176999)(5820100001)(2950100002)(47776003)(2906002)(7416002)(498600001)(81166006)(8676002)(97736004)(85426001)(8936002)(305945005)(356003)(50226002)(5660300001)(6666003)(189998001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2260; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD013; 1:mEVKQ9Q4VDDMQrFhVAvdYIAzLWfIgheu69p/q2AIzcxwUsVVYKghZ9uud9kfMk+SymOnxV+cnLvWPbegrZv3PtFt1gOHtDgQqyMH8L1Oc7flPtlgaUozyE5Zj+mJPsuyBbK9SMn8qav9AUJeaWtGor0G8VcnTIJ5gZZrJyRgWo0HLTA0yvvPgmZCgoWg+ocFH/tMY4nD2MAXBx2qRxdX/shJOH3CKagGNVyIF1TNH34EcVCvNvYOESI6MTt4sxda5BYnvg5all/oEmF1/W0+xDWcmY77rXLXxSqGOsYreXw2BFiSs1JRSPRbDlwAQCDdS7B8jwqhs9W6Izlyi/HUwXjAT4iTwGzvUGMvK1LBiKIa19XazBZk9kiN8eFhM5lvUTIySLwt2W1aiMhhzrmIYgpW3q6pFXhF3Z7zvdhKCM9Cwgjy1teesV06upnOPDT2gB8ngKKzlDYp7uLvSGecLBlYpVBbSDQRCP1+NGINiBMcmk29Q1ZmCahyzfm1I3LE/pqTcMwT9xME519SF9CQso0D0htmxunKBScRCvYyk8lo+RAFQT/dNvrsdbRH8QNWNa/yLWBkxElH+U/OLkyeaqWojMQPh/xhPBK6b8PP6CdFStc+DtZOWlCgJnK4rI2F0imOaMVBHhSM35WMgQ3cCt6mQuCecqNttLmiSvwuZQivV4AKZBLtFinQQjyu5Esep6qVIm26zA8qwkKIFrtrG+0kIOlu6GljWhznWuxbgZHPOE/szQNUbiHhJX7x5dvbUurgY15kV+3bU81RHH2PbIfJ+yQVW6b7oIh6Zgh1hBFIfZSCB0gplz8KV4lykITxg2LmEKwijFnurqKRBpwtS22xcBhqADnGb5DMgj6d6p5QcjseYt7DBGJLB5zoWHbN X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1590dae9-60d5-41cb-50e1-08d4e0175c46 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:BN3PR03MB2260; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2260; 3:x3uA4kgVO3pO1mFCT3HULLBvpw2ryLeZqFioUdXfRaZY5BX0FPd+zPKOH/EIaT6wnSZL0uf3gyinmojVyXO5L3++cVyvJ9Q+8XyLXgNwfVYNcf1kxYkfT8BTSeYSIHfuFH7vN7a2QsTLCfcJ2vDyHGVyJs1bJXPfBJheZsfj9TuiC8dDTkghX8UEXKrIB0TD+3NGgo51kIdfBLkrXIQf7RH/t/LdiESOGnJgl5dWZ/BXyX83BXEmQz52JkloH0Ubrg8h41nsqjH/SMRA1g8p/IreVvcMdpNpjr9egWrukzaRmbTq5UgmNA+vXJeVL+zCG/YQEdnEwathnuw3thJ9LTs/71ZqPfER2lhNZooOebM=; 25:b/uWhTo1fTDquvRRx7Lc1ixBMhyn4qnL3/i//e5kOzbj08D+rs9PUP3BWrO9+aOdhiENPLAj3r6PWXYAMn6gccxkYrtnyycA7VMzVTT/ImCkISH9IJssEAH2/jZgLNkQfmkMeYeQGr3P7pyv+1ADrJN+bkhokr8Fm4gqLhIxrS2VN/73AIcdSRCfN25BcGRhvKCCDrrDzaSGtrOn5mRKxfp4Cf7ZOCjhB2JGtHAqlK6a9QbSY36inToMcMn59myCQIsvUAf7FBEyqX6FxFx3I4xX5o2jm1psaPPbu7x2vXLemkf8sLgTo3JAQ8QsBzjnJkRG4XnUNV0H1KpmQKWDfg== X-MS-TrafficTypeDiagnostic: BN3PR03MB2260: X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2260; 31:8PMf6+duKT6GqGvUrLQRTa3MEINO+gFqkq6V1x5CcUpHzG4V5CLxNUFqdtpm+Z3Q27bXpTiHTyZTr1f05gQWlqgeC+QR5ZmMkUNbs5EpeKThtv/oaZ4otdICMaFuAOeqiYHVRtjjRjOlp4v9UK67EKKjNT+1SGp5T3qURGL/WyPEUWasLEcrJDaFi7bo8qgRmdVB8jg6DSX03JJe63eWj1u/qwdkY6ipvHGe7Lxk41Q=; 4:FRo4BHkYmKli6o+VsE/hduTW5m38TwEjnOADgDNWB25wTYASK3boY5fZJNCi9BBGxm3Bs7aq0zExfnMppjxdils28moGwpmHl8kjhgnCN8SS3qU6ASPXI5C25CbKyC7WfoMSkc/xwodFGYOXIkWnSIfYVczUybw1yDteaouhDqI308U83FriD38GoNgjSDTlyOKbREb/MNtGNOXobmLc6DPtl/hNYmpv3ENSeOfWRIjhVcgLhEbI4nARYrQJ4FJ3kttvp65rvmI3HOIFcvbYtXdMf36lC1MbaLjosWVhpRc= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); 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)(13016025)(5005006)(8121501046)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6096035)(20161123556025)(20161123561025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123559100)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR03MB2260; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR03MB2260; X-Forefront-PRVS: 03950F25EC X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjNQUjAzTUIyMjYwOzIzOnNMc3oxVnE4NUd3bGM4YUlQMVFYSVZTUm5H?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-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2260; 6:5Bsklqk8ymDVaHtrQAE93bpP1i77Z70muMPc/b1LYBFyYt5wu2V/rRpgV1tlOEpxuqr0EfLcWMo823SVTpw/oh1JeA6i6xOnEPp9yop4tFg+H2Bbceu1eBI/lwG8citrGK/7/Ke+SyI9BR3Lpm6cWNwusxm4RVs2cWIfREY01N/SUcToJ1iQ5m1KZb0IKU4OhLNFxMdV1OyBkB7xscwO96L8q9tasJNzwrw+A9UHmnnlNm7QjaHh8gLDLCmHGRE38rX0R6eHvdQjzjDdnorbJMzlEWSSlEssgfnqPwhxRH0j3/Z4zBoFAFteQckbkdrELXY8jS5NpNmBsnwaEFwDOw==; 5:Erehoj/FrtDxaJrsaxfG/V/u0TcUapZAKO++UZeLE+N8YNfuMy6WeP6t8a8581tw1tWfv0LD/Hf8UqXw9c8QKYvj5yTaVF37Ao1c0EpJeLFXf5p0aD8FZAvFoiUAhSRBC9mRQlVnhzZd3SFXoWxbgA==; 24:lXuDn3nysBrKLRCChnm1Te07JQHkosDbXN1R+Zejgve4vDgStGpwihqwqs75gvpg3Uh0b8ENF15T8aGZpIJybQFNFPXze1BYhTcRxSa6ZNA=; 7:Gd7ZE0amN8x9f52kYho/IKkzMxP7c1F0InXUxQbJi/oNv/ayfpaZzn97kRAkJVFqXD4P354Flrjzn8tFGT9yR07hq0ONnM46V9drUIRnb0p3Aur7CbhmaOWMO+qxC6ry35Z5Ff85K5BJ5Gg02qeYa7I6SB0d4vHd4/EHbgrYvK30olLjKMRBbCQchmbUYlKBfr5fmsVfdeCugE8uL2kMJwH9NXIp7CV4h6NdV1maR34= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2017 17:43:50.0568 (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: BN3PR03MB2260 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170810_104423_350934_820D8E33 X-CRM114-Status: GOOD ( 16.74 ) 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: devel@driverdev.osuosl.org, Roy Pledge , Dan Douglass , Radu Alexe , 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 to translate error codes returned by QI v2, i.e. Queue Interface present on DataPath Acceleration Architecture v2 (DPAA2). Signed-off-by: Horia Geantă --- drivers/crypto/caam/error.c | 75 +++++++++++++++++++++++++++++++++++++++++++-- drivers/crypto/caam/error.h | 6 +++- drivers/crypto/caam/regs.h | 2 ++ 3 files changed, 79 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c index 3d639f3b45aa..65756bab800f 100644 --- a/drivers/crypto/caam/error.c +++ b/drivers/crypto/caam/error.c @@ -107,6 +107,54 @@ static const struct { { 0xF1, "3GPP HFN matches or exceeds the Threshold" }, }; +static const struct { + u8 value; + const char *error_text; +} qi_error_list[] = { + { 0x1F, "Job terminated by FQ or ICID flush" }, + { 0x20, "FD format error"}, + { 0x21, "FD command format error"}, + { 0x23, "FL format error"}, + { 0x25, "CRJD specified in FD, but not enabled in FLC"}, + { 0x30, "Max. buffer size too small"}, + { 0x31, "DHR exceeds max. buffer size (allocate mode, S/G format)"}, + { 0x32, "SGT exceeds max. buffer size (allocate mode, S/G format"}, + { 0x33, "Size over/underflow (allocate mode)"}, + { 0x34, "Size over/underflow (reuse mode)"}, + { 0x35, "Length exceeds max. short length (allocate mode, S/G/ format)"}, + { 0x36, "Memory footprint exceeds max. value (allocate mode, S/G/ format)"}, + { 0x41, "SBC frame format not supported (allocate mode)"}, + { 0x42, "Pool 0 invalid / pool 1 size < pool 0 size (allocate mode)"}, + { 0x43, "Annotation output enabled but ASAR = 0 (allocate mode)"}, + { 0x44, "Unsupported or reserved frame format or SGHR = 1 (reuse mode)"}, + { 0x45, "DHR correction underflow (reuse mode, single buffer format)"}, + { 0x46, "Annotation length exceeds offset (reuse mode)"}, + { 0x48, "Annotation output enabled but ASA limited by ASAR (reuse mode)"}, + { 0x49, "Data offset correction exceeds input frame data length (reuse mode)"}, + { 0x4B, "Annotation output enabled but ASA cannote be expanded (frame list)"}, + { 0x51, "Unsupported IF reuse mode"}, + { 0x52, "Unsupported FL use mode"}, + { 0x53, "Unsupported RJD use mode"}, + { 0x54, "Unsupported inline descriptor use mode"}, + { 0xC0, "Table buffer pool 0 depletion"}, + { 0xC1, "Table buffer pool 1 depletion"}, + { 0xC2, "Data buffer pool 0 depletion, no OF allocated"}, + { 0xC3, "Data buffer pool 1 depletion, no OF allocated"}, + { 0xC4, "Data buffer pool 0 depletion, partial OF allocated"}, + { 0xC5, "Data buffer pool 1 depletion, partial OF allocated"}, + { 0xD0, "FLC read error"}, + { 0xD1, "FL read error"}, + { 0xD2, "FL write error"}, + { 0xD3, "OF SGT write error"}, + { 0xD4, "PTA read error"}, + { 0xD5, "PTA write error"}, + { 0xD6, "OF SGT F-bit write error"}, + { 0xD7, "ASA write error"}, + { 0xE1, "FLC[ICR]=0 ICID error"}, + { 0xE2, "FLC[ICR]=1 ICID error"}, + { 0xE4, "source of ICID flush not trusted (BDI = 0)"}, +}; + static const char * const cha_id_list[] = { "", "AES", @@ -235,6 +283,27 @@ static void report_deco_status(struct device *jrdev, const u32 status, status, error, idx_str, idx, err_str, err_err_code); } +static void report_qi_status(struct device *qidev, const u32 status, + const char *error) +{ + u8 err_id = status & JRSTA_QIERR_ERROR_MASK; + const char *err_str = "unidentified error value 0x"; + char err_err_code[3] = { 0 }; + int i; + + for (i = 0; i < ARRAY_SIZE(qi_error_list); i++) + if (qi_error_list[i].value == err_id) + break; + + if (i != ARRAY_SIZE(qi_error_list) && qi_error_list[i].error_text) + err_str = qi_error_list[i].error_text; + else + snprintf(err_err_code, sizeof(err_err_code), "%02x", err_id); + + dev_err(qidev, "%08x: %s: %s%s\n", + status, error, err_str, err_err_code); +} + static void report_jr_status(struct device *jrdev, const u32 status, const char *error) { @@ -249,7 +318,7 @@ static void report_cond_code_status(struct device *jrdev, const u32 status, status, error, __func__); } -void caam_jr_strstatus(struct device *jrdev, u32 status) +void caam_strstatus(struct device *jrdev, u32 status, bool qi_v2) { static const struct stat_src { void (*report_ssed)(struct device *jrdev, const u32 status, @@ -261,7 +330,7 @@ void caam_jr_strstatus(struct device *jrdev, u32 status) { report_ccb_status, "CCB" }, { report_jump_status, "Jump" }, { report_deco_status, "DECO" }, - { NULL, "Queue Manager Interface" }, + { report_qi_status, "Queue Manager Interface" }, { report_jr_status, "Job Ring" }, { report_cond_code_status, "Condition Code" }, { NULL, NULL }, @@ -287,4 +356,4 @@ void caam_jr_strstatus(struct device *jrdev, u32 status) else dev_err(jrdev, "%d: unknown error source\n", ssrc); } -EXPORT_SYMBOL(caam_jr_strstatus); +EXPORT_SYMBOL(caam_strstatus); diff --git a/drivers/crypto/caam/error.h b/drivers/crypto/caam/error.h index 250e1a21c473..751ddcacf6cd 100644 --- a/drivers/crypto/caam/error.h +++ b/drivers/crypto/caam/error.h @@ -7,7 +7,11 @@ #ifndef CAAM_ERROR_H #define CAAM_ERROR_H #define CAAM_ERROR_STR_MAX 302 -void caam_jr_strstatus(struct device *jrdev, u32 status); + +void caam_strstatus(struct device *dev, u32 status, bool qi_v2); + +#define caam_jr_strstatus(jrdev, status) caam_strstatus(jrdev, status, false) +#define caam_qi2_strstatus(qidev, status) caam_strstatus(qidev, status, true) void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type, int rowsize, int groupsize, struct scatterlist *sg, diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h index 2b5efff9ec3c..7d9a8e745ae2 100644 --- a/drivers/crypto/caam/regs.h +++ b/drivers/crypto/caam/regs.h @@ -629,6 +629,8 @@ struct caam_job_ring { #define JRSTA_DECOERR_INVSIGN 0x86 #define JRSTA_DECOERR_DSASIGN 0x87 +#define JRSTA_QIERR_ERROR_MASK 0x00ff + #define JRSTA_CCBERR_JUMP 0x08000000 #define JRSTA_CCBERR_INDEX_MASK 0xff00 #define JRSTA_CCBERR_INDEX_SHIFT 8