From patchwork Fri Mar 6 16:40:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 5956301 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3C569BF6C3 for ; Fri, 6 Mar 2015 16:40:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 559662038D for ; Fri, 6 Mar 2015 16:40:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 687AE202AE for ; Fri, 6 Mar 2015 16:40:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755499AbbCFQkb (ORCPT ); Fri, 6 Mar 2015 11:40:31 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:54025 "EHLO mailhub1.si.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755103AbbCFQk1 (ORCPT ); Fri, 6 Mar 2015 11:40:27 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 608631C8571; Fri, 6 Mar 2015 17:40:26 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from mailhub1.si.c-s.fr ([192.168.12.234]) by localhost (mailhub1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Oq2__pnwaOjm; Fri, 6 Mar 2015 17:40:26 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 407691C8570; Fri, 6 Mar 2015 17:40:26 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2F0A1C73C5; Fri, 6 Mar 2015 17:40:26 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id faLMcJhFR5i3; Fri, 6 Mar 2015 17:40:26 +0100 (CET) Received: from PO10863.localdomain (unknown [172.25.231.75]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 039ACC73C4; Fri, 6 Mar 2015 17:40:26 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id D71101A241C; Fri, 6 Mar 2015 17:40:25 +0100 (CET) From: Christophe Leroy To: Kim Phillips , Herbert Xu , "David S. Miller" CC: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-crypto@vger.kernel.org Subject: [PATCH v2 09/17] crypto: talitos - Move reset/init helpers into talitos2.h Message-Id: <20150306164025.D71101A241C@localhost.localdomain> Date: Fri, 6 Mar 2015 17:40:25 +0100 (CET) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 Move reset/init helpers init talitos2.h as they are specific to SEC2 Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 19 ------------------- drivers/crypto/talitos2.h | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 81a6e47..ffa103b 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -55,19 +55,6 @@ #include "talitos.h" -static unsigned int do_reset_channel(struct talitos_private *priv, int ch) -{ - unsigned int timeout = TALITOS_TIMEOUT; - - setbits32(priv->chan[ch].reg + TALITOS_CCCR, TALITOS_CCCR_RESET); - - while ((in_be32(priv->chan[ch].reg + TALITOS_CCCR) & TALITOS_CCCR_RESET) - && --timeout) - cpu_relax(); - - return timeout; -} - int talitos_reset_channel(struct device *dev, int ch) { struct talitos_private *priv = dev_get_drvdata(dev); @@ -118,12 +105,6 @@ static int reset_device(struct device *dev) /* * Reset and initialize the device */ -static void do_init_device(struct talitos_private *priv) -{ - setbits32(priv->reg + TALITOS_IMR, TALITOS_IMR_INIT); - setbits32(priv->reg + TALITOS_IMR_LO, TALITOS_IMR_LO_INIT); -} - int talitos_init_device(struct device *dev) { struct talitos_private *priv = dev_get_drvdata(dev); diff --git a/drivers/crypto/talitos2.h b/drivers/crypto/talitos2.h index e7a91cf..f9da9f2 100644 --- a/drivers/crypto/talitos2.h +++ b/drivers/crypto/talitos2.h @@ -202,3 +202,23 @@ extern int talitos_alg_alloc_aead(struct crypto_alg *alg); #define DESC_PTR_LNKTBL_JUMP 0x80 #define DESC_PTR_LNKTBL_RETURN 0x02 #define DESC_PTR_LNKTBL_NEXT 0x01 + +static inline unsigned int do_reset_channel(struct talitos_private *priv, + int ch) +{ + unsigned int timeout = TALITOS_TIMEOUT; + + setbits32(priv->chan[ch].reg + TALITOS_CCCR, TALITOS_CCCR_RESET); + + while ((in_be32(priv->chan[ch].reg + TALITOS_CCCR) & TALITOS_CCCR_RESET) + && --timeout) + cpu_relax(); + + return timeout; +} + +static inline void do_init_device(struct talitos_private *priv) +{ + setbits32(priv->reg + TALITOS_IMR, TALITOS_IMR_INIT); + setbits32(priv->reg + TALITOS_IMR_LO, TALITOS_IMR_LO_INIT); +}