Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4528557ybl; Tue, 20 Aug 2019 13:26:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNEIw372TIhACkhM/f9PS+Ue6VKvnH8HAhaKVma4JVObIX5+TpEcX6Upt/33hLzbVnyAn1 X-Received: by 2002:a63:ff20:: with SMTP id k32mr26281735pgi.445.1566332812936; Tue, 20 Aug 2019 13:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566332812; cv=none; d=google.com; s=arc-20160816; b=l9OzBQ31tYSH/zjrvYAs3eOhjKzCUP3mhOq4/RP+D7lDdzQkFs40RIb/lt/NTaeXFY /MfL8fVfvnYesatFVQK5jDIxlRoDw+VE1hrpQ//X5/xTN1Xw7DyJqJcUkPylX333sL7Y FAbrLjVJCSMz0g+7xHBXYHfWNGfzXuyvFO7cNR7jbdNDqJ/SfufJvW+nvSE2C72ENnk1 bBF/HhftTEazxYnG5pJXsb21qDixBnjsNJXiCGZ5i9aCMP8kT0v+G3wEVR7ytlWyoaO3 cC1R36yVJsKf0fQW+YqzNrzP4Ynw1ajOQDzgk0OV2mRbASndoKBJ8XN26Qzkg0Rd/Imy 8TBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=A6ercEpYWl8IkvOJaITxdGFgQIowCjFQxBcnpKPLscw=; b=Wy1V1eumqdQICQC7DCA6oir+sXr+7bbAORZ5P59Wrui2CWKRcJMNZsJcZKIUdAcjGs /N/H/X6co591Q3sslqexu7pvHUYK011oqdLA2FLvdE5l1WLNoS7hjv0Ycnv4y/RmPtF6 xzgo68PqkuCiekzyWnHUi9SZ1FCwwrjb5lt99zG0DrAkvrXaygF+YgcgBsgaNSY0Sl1D IZh2QqzjdHVelASZKBvpcWI12jc5NLwSQVSMYMOA9WiGENXI7flIqznSGXg2ZEEPNr6w f0FeAnjWIAI2Lx7VOsui9qvnbMSaa8CldLEUGjmvQLZRtm5gC0NiHlLxVTtqNdbhklFB MJBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vOzP+q0q; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v33si12789639pgk.152.2019.08.20.13.26.39; Tue, 20 Aug 2019 13:26:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vOzP+q0q; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730921AbfHTU0A (ORCPT + 99 others); Tue, 20 Aug 2019 16:26:00 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:40631 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730871AbfHTUY1 (ORCPT ); Tue, 20 Aug 2019 16:24:27 -0400 Received: by mail-pl1-f194.google.com with SMTP id h3so34714pls.7; Tue, 20 Aug 2019 13:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A6ercEpYWl8IkvOJaITxdGFgQIowCjFQxBcnpKPLscw=; b=vOzP+q0q+Oa6BZHJxhBaH7qaUU8zblJDo2ySy2oPY3e95wWQKZfWWhF+QMBjWlj41e rZmNg+sELolTQBlHws7u5zQ9XayMJNdtmAnrRzf5KvaJdz8kDMUmtvrz4//7ZZBKezPu W7bIFnOMLCd1YOqtjyQBfx5p+9LA0JpwIs7PN50elsXw0MYhbNR52kItaadpcLDTOziG hiFXips7Et1RniJ9MDPVR7D+53W6+lE5aLW17BkrFx2L0w3rW0nZ4RE/znHruRDFY+lA tTPC8cHPIPQbZq2+xpdMVyGdBP2XYqvoUZdAGucJlBx41FjWQfLgu9oueuR/8zq4PnB3 B57g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A6ercEpYWl8IkvOJaITxdGFgQIowCjFQxBcnpKPLscw=; b=ekoQPi6+tkE5C7zLJpjV+1Ya4E41CkfmUFcjpIo/eetdbX08Ox1mm12a85Z3DvfQ7b Lzdkcl/dos/8+kALXMPRnX6pghsQSzlmLbHmP+ae7jX/rkbKG/fEqBvZtA6eS9LoQ16l wqEhn/Bvzn093PAdRRtxf5w7rxIJbnyZ3LBIGsWATJEUqgVA+Olm7gyDMvmqo5TH1yWJ WCqL/7d6Ln+UhRbKDqtaXgsySBva6WNYOgQQYw5HZ4QJ8v3ENxDxPZLJ/yEeTCfWyhly lBrjCq+uTI/wUKu0FCHCcipCzt5zUf3n+zI6jk9gnyeYw4Mdsb3W5T54JzEBElLFifr+ 08jg== X-Gm-Message-State: APjAAAUH8EuClau7Rp+E4XsD4arf+EA5l8gD9R5kGsCTIOr79/mma4rx aks6qQulLyyC+9h82j2quIKq9k/zaKA= X-Received: by 2002:a17:902:306:: with SMTP id 6mr30104564pld.86.1566332666385; Tue, 20 Aug 2019 13:24:26 -0700 (PDT) Received: from localhost.lan (c-67-185-54-80.hsd1.wa.comcast.net. [67.185.54.80]) by smtp.gmail.com with ESMTPSA id k3sm36149846pfg.23.2019.08.20.13.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 13:24:25 -0700 (PDT) From: Andrey Smirnov To: linux-crypto@vger.kernel.org Cc: Andrey Smirnov , =?UTF-8?q?Horia=20Geant=C4=83?= , Chris Spencer , Cory Tusar , Chris Healy , Lucas Stach , Aymen Sghaier , Leonard Crestez , linux-kernel@vger.kernel.org Subject: [PATCH v8 06/16] crypto: caam - use ioread64*_hi_lo in rd_reg64 Date: Tue, 20 Aug 2019 13:23:52 -0700 Message-Id: <20190820202402.24951-7-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190820202402.24951-1-andrew.smirnov@gmail.com> References: <20190820202402.24951-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Following the same transformation logic as outlined in previous commit converting wr_reg64, convert rd_reg64 to use helpers from first. No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Horia Geantă Cc: Chris Spencer Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: Horia Geantă Cc: Aymen Sghaier Cc: Leonard Crestez Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/crypto/caam/regs.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h index 6acfef30a90c..4efc10534873 100644 --- a/drivers/crypto/caam/regs.h +++ b/drivers/crypto/caam/regs.h @@ -172,12 +172,20 @@ static inline void wr_reg64(void __iomem *reg, u64 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))); + if (caam_little_end) { + if (caam_imx) { + u32 low, high; - return ((u64)rd_reg32((u32 __iomem *)(reg)) << 32 | - (u64)rd_reg32((u32 __iomem *)(reg) + 1)); + high = ioread32(reg); + low = ioread32(reg + sizeof(u32)); + + return low + ((u64)high << 32); + } else { + return ioread64(reg); + } + } else { + return ioread64be(reg); + } } #endif /* CONFIG_64BIT */ -- 2.21.0