From patchwork Thu Mar 5 16:46:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 5947861 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 C56AC9F318 for ; Thu, 5 Mar 2015 16:51:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F287620390 for ; Thu, 5 Mar 2015 16:51:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BEFD2038E for ; Thu, 5 Mar 2015 16:51:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758136AbbCEQvJ (ORCPT ); Thu, 5 Mar 2015 11:51:09 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:48186 "EHLO mailhub1.si.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757799AbbCEQqW (ORCPT ); Thu, 5 Mar 2015 11:46:22 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id CA6CE1C8335; Thu, 5 Mar 2015 17:46:20 +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 OZ6kF__IzaMP; Thu, 5 Mar 2015 17:46:20 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id AFC201C8330; Thu, 5 Mar 2015 17:46:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8E395C73D7; Thu, 5 Mar 2015 17:46:18 +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 j8MnYVHR5vIS; Thu, 5 Mar 2015 17:46:18 +0100 (CET) Received: from PO10863.localdomain (unknown [172.25.231.75]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 98D2BC73D4; Thu, 5 Mar 2015 17:46:11 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id D789C1A2423; Thu, 5 Mar 2015 17:46:06 +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 09/17] crypto: talitos - Move reset/init helpers into talitos2.h Message-Id: <20150305164606.D789C1A2423@localhost.localdomain> Date: Thu, 5 Mar 2015 17:46:06 +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 de31ab0..d15cf83 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); +}