Received: by 10.213.65.68 with SMTP id h4csp474829imn; Fri, 16 Mar 2018 08:52:59 -0700 (PDT) X-Google-Smtp-Source: AG47ELvCKK7Sh7q2xW++CJ+xn/VtLlRtnlc96Xcz+bSocnNzWKjFyeMCa1i5f2IP25dilkoHdr3r X-Received: by 2002:a17:902:678f:: with SMTP id g15-v6mr2745053plk.120.1521215578973; Fri, 16 Mar 2018 08:52:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521215578; cv=none; d=google.com; s=arc-20160816; b=FuRCqppQ1lJ9lWVX1MnWzNzRpov7rIIcbdb7YBsU90Msx76AnSDaZvQY5GtK3gx/p0 J3+5X5VgCxAcvVr8N9J/DknkgiDroDQobJKbKlZ5F/gFWl4x6XD3D2TNWKFKNBtEGM0A 7rzfVsvoVbMY46GNRl2vwmYdPZPJo6ksgCB4XZ429qBg941x+IkyjOpPys3zljxqWupA IZcQV1/a4STejkMf8aaFts4mRPUx3O4Mk0RuzL10sRI9Dv8oX2fQ+MOvNy/nV2MS867g q9TwuTbPd0fdbDfDH5mbgdj4OfkXgUFugYnfNKbcfDJ7iYwJSLgX/okNQnbV6xlN39P1 XXqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:cc:to:from :arc-authentication-results; bh=VScL5+GQvjqTdu4kyTkUM9KO2YStlRE5s+DVLwEW3V0=; b=ONq4OB8Fv7onV8yt+ATaG9556teBYG8I14xHZxJEfTxSPvRSNuESNa5JCkYM9Dbl9s hqQ+pozFKBgUhTmecOsObDeMmzUKaLFvo4TS1nmVCnVgO+wp6o/l5tRFlQYJjvpvwT05 p28xQZCasOBgSftdLauFMZnvidJCAodIzU0AyJ9g1hsOhNoxpWSvFXM9HSoc+SMTjbLv Wz2NdGihYmcoEH5iXIb8ZlgI+wBDX0GJm+V+3aFg0eSYad6XJamXe0Oi1GzOFcUnMe8x q2P8Ig1xtZj2yjpswHTiQKhvRUQ01QilNkMfrXnUO/QnJXMlBpGsgtuIKlFLF/WNej4g gvkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bb5-v6si6172655plb.407.2018.03.16.08.52.44; Fri, 16 Mar 2018 08:52:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934617AbeCPPu6 (ORCPT + 99 others); Fri, 16 Mar 2018 11:50:58 -0400 Received: from ale.deltatee.com ([207.54.116.67]:54520 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934261AbeCPPtB (ORCPT ); Fri, 16 Mar 2018 11:49:01 -0400 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ewrbH-0003pk-05; Fri, 16 Mar 2018 09:49:00 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1ewrbG-0003SD-0L; Fri, 16 Mar 2018 09:48:58 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-ntb@googlegroups.com, linux-crypto@vger.kernel.org, Greg Kroah-Hartman Cc: Arnd Bergmann , Andy Shevchenko , =?UTF-8?q?Horia=20Geant=C4=83?= , Logan Gunthorpe , Dan Douglass , Herbert Xu , "David S. Miller" Date: Fri, 16 Mar 2018 09:48:51 -0600 Message-Id: <20180316154852.13206-9-logang@deltatee.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180316154852.13206-1-logang@deltatee.com> References: <20180316154852.13206-1-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-crypto@vger.kernel.org, gregkh@linuxfoundation.org, arnd@arndb.de, andy.shevchenko@gmail.com, logang@deltatee.com, horia.geanta@nxp.com, dan.douglass@nxp.com, herbert@gondor.apana.org.au, davem@davemloft.net X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 Subject: [PATCH v12 8/9] crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64 X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clean up the extra ifdefs which defined the wr_reg64 and rd_reg64 functions in non-64bit cases in favour of the new common io-64-nonatomic-lo-hi header. To be consistent with CAAM engine HW spec: in case of 64-bit registers, irrespective of device endianness, the lower address should be read from / written to first, followed by the upper address. Indeed the I/O accessors in CAAM driver currently don't follow the spec, however this is a good opportunity to fix the code. Signed-off-by: Logan Gunthorpe Reviewed-by: Horia Geantă Cc: Andy Shevchenko Cc: Dan Douglass Cc: Herbert Xu Cc: "David S. Miller" --- drivers/crypto/caam/regs.h | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h index fee363865d88..f887b371040f 100644 --- a/drivers/crypto/caam/regs.h +++ b/drivers/crypto/caam/regs.h @@ -10,7 +10,7 @@ #include #include -#include +#include /* * Architecture-specific register access methods @@ -136,10 +136,9 @@ static inline void clrsetbits_32(void __iomem *reg, u32 clear, u32 set) * base + 0x0000 : least-significant 32 bits * base + 0x0004 : most-significant 32 bits */ -#ifdef CONFIG_64BIT static inline void wr_reg64(void __iomem *reg, u64 data) { - if (caam_little_end) + if (!caam_imx && caam_little_end) iowrite64(data, reg); else iowrite64be(data, reg); @@ -147,35 +146,12 @@ static inline void wr_reg64(void __iomem *reg, u64 data) static inline u64 rd_reg64(void __iomem *reg) { - if (caam_little_end) + if (!caam_imx && caam_little_end) return ioread64(reg); else return ioread64be(reg); } -#else /* CONFIG_64BIT */ -static inline void wr_reg64(void __iomem *reg, u64 data) -{ - if (!caam_imx && caam_little_end) { - wr_reg32((u32 __iomem *)(reg) + 1, data >> 32); - wr_reg32((u32 __iomem *)(reg), data); - } else { - wr_reg32((u32 __iomem *)(reg), data >> 32); - wr_reg32((u32 __iomem *)(reg) + 1, data); - } -} - -static inline u64 rd_reg64(void __iomem *reg) -{ - if (!caam_imx && caam_little_end) - return ((u64)rd_reg32((u32 __iomem *)(reg) + 1) << 32 | - (u64)rd_reg32((u32 __iomem *)(reg))); - - return ((u64)rd_reg32((u32 __iomem *)(reg)) << 32 | - (u64)rd_reg32((u32 __iomem *)(reg) + 1)); -} -#endif /* CONFIG_64BIT */ - static inline u64 cpu_to_caam_dma64(dma_addr_t value) { if (caam_imx) -- 2.11.0