From patchwork Tue May 15 12:29:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 135876 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp950787lji; Tue, 15 May 2018 05:29:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpg7dJwYfHBQeNcPJJP/LpkzsIgntbdB36ucp2UN+Fc744o6kYFF8FWtrLn6RJ1NCVBJswi X-Received: by 2002:aa7:828c:: with SMTP id s12-v6mr14968251pfm.136.1526387395358; Tue, 15 May 2018 05:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526387395; cv=none; d=google.com; s=arc-20160816; b=qBnBZwz+LPvuRrlA3SPGoESVN7p6H9iMf3G7zwl6p8JWlsiaTa+8d5xspjw7lXQtLU pubMfkKNDCH9efTVCa0t4gCh9vmh1tQ/r4jzSii3CFXxyH0OJBhUptoMJFzvYKoTn+pL adTnyGrgmMXY5zYd5GznDv9C74+qPtZKIp2LC0Q+RqhdD8kxkf4gB4+/ZtGx2zubmqYf FdFj6AlnFeS8bCFPP23fD/MrHBw5ti0VuPePvRwgKd/F+lu9YwFRtzfvCnnhYOKzW0n8 3pd+QczRKfFe8wFvHRoRnIJYWNRpoeWBGnO9OCqve6/P6rU99XBPbolsew8txt2t1oiD 30zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=3r8X911ehDpNAVNJcyjFxMx3TTSsupKAYYa82wUYlTw=; b=stLGF3cGkRYZqpyL9ciVjp1p03snVmXLeYRNByIs4FX+LMe5aw1D2mLgxCCqO8G5gJ r8kuHgHytokO7yUYW3JR1a+vs8yz6sHKHVDSj9pZcj7k+W9un3qwrLbWTBqZf10MOXUi 5xhwcVbpaB24J9jWem9W3RUIIZs1YgG/49zFtSW2xrkq5QehMtcvGenraaOCN62SACdG uMsCb3FsKIPlr1jAlH3fzTdd2GAhPZmZBBXGyOHOWDlQXetvXrZWbpJ8ZmvbsLJwPjbm 2VJnQvKJxof++FB2o0zjBvoMI+hiiGGtLv/EQVuLsicG14pA7HoCPUB4rcc4f1G/1SBX 3pyg== 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 v6-v6si12254576plo.534.2018.05.15.05.29.54; Tue, 15 May 2018 05:29:55 -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 S1753334AbeEOM3v (ORCPT + 29 others); Tue, 15 May 2018 08:29:51 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59684 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753300AbeEOM3r (ORCPT ); Tue, 15 May 2018 08:29:47 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E50BA15AB; Tue, 15 May 2018 05:29:46 -0700 (PDT) Received: from sugar.kfn.arm.com (unknown [10.45.48.163]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CB1453F25D; Tue, 15 May 2018 05:29:42 -0700 (PDT) From: Gilad Ben-Yossef To: Simon Horman , Magnus Damm , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Herbert Xu , "David S. Miller" Cc: Ofir Drang , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-crypto@vger.kernel.org Subject: [PATCH 1/3] crypto: ccree: drop signature register check Date: Tue, 15 May 2018 13:29:27 +0100 Message-Id: <1526387370-17142-2-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526387370-17142-1-git-send-email-gilad@benyossef.com> References: <1526387370-17142-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We were using the content of the signature register as a sanity check for the hardware functioning but it turns out not all implementers use the same values so the check is giving false negative on certain SoCs and so we drop it. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_driver.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) -- 2.7.4 diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c index 89ce013..f8ff358 100644 --- a/drivers/crypto/ccree/cc_driver.c +++ b/drivers/crypto/ccree/cc_driver.c @@ -38,21 +38,20 @@ MODULE_PARM_DESC(cc_dump_bytes, "Dump buffers to kernel log as debugging aid"); struct cc_hw_data { char *name; enum cc_hw_rev rev; - u32 sig; }; /* Hardware revisions defs. */ static const struct cc_hw_data cc712_hw = { - .name = "712", .rev = CC_HW_REV_712, .sig = 0xDCC71200U + .name = "712", .rev = CC_HW_REV_712 }; static const struct cc_hw_data cc710_hw = { - .name = "710", .rev = CC_HW_REV_710, .sig = 0xDCC63200U + .name = "710", .rev = CC_HW_REV_710 }; static const struct cc_hw_data cc630p_hw = { - .name = "630P", .rev = CC_HW_REV_630, .sig = 0xDCC63000U + .name = "630P", .rev = CC_HW_REV_630 }; static const struct of_device_id arm_ccree_dev_of_match[] = { @@ -186,7 +185,6 @@ static int init_cc_resources(struct platform_device *plat_dev) struct cc_drvdata *new_drvdata; struct device *dev = &plat_dev->dev; struct device_node *np = dev->of_node; - u32 signature_val; u64 dma_mask; const struct cc_hw_data *hw_rev; const struct of_device_id *dev_id; @@ -275,16 +273,6 @@ static int init_cc_resources(struct platform_device *plat_dev) return rc; } - /* Verify correct mapping */ - signature_val = cc_ioread(new_drvdata, CC_REG(HOST_SIGNATURE)); - if (signature_val != hw_rev->sig) { - dev_err(dev, "Invalid CC signature: SIGNATURE=0x%08X != expected=0x%08X\n", - signature_val, hw_rev->sig); - rc = -EINVAL; - goto post_clk_err; - } - dev_dbg(dev, "CC SIGNATURE=0x%08X\n", signature_val); - /* Display HW versions */ dev_info(dev, "ARM CryptoCell %s Driver: HW version 0x%08X, Driver version %s\n", hw_rev->name, cc_ioread(new_drvdata, CC_REG(HOST_VERSION)), From patchwork Tue May 15 12:29:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 135877 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp950851lji; Tue, 15 May 2018 05:29:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq8Dr+cbRTD11HwF+sghVQci8bvDlo9Svfhu8mP46MxqnxSxJza2zjQBYBVZbwyWDTwyqbQ X-Received: by 2002:a17:902:294a:: with SMTP id g68-v6mr14409208plb.110.1526387397669; Tue, 15 May 2018 05:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526387397; cv=none; d=google.com; s=arc-20160816; b=X5LMNo9jmUm4lWmCAfyMoWtviz/Ha/CRa5S8ajJuf5AbwDd6ktwyDXrfN4KVVwJVzx TGfjQEH3jxDE0ASDw79BITKCJ9VXvdL3sZ75q43p1IdkjpICNlDkDzMS90StpCU/9I+I ZPvfD/WXN0T9J9FST6BG5/ESQChKNY4ZfjD4SPoJQif0n0m6V7SEXuMu8qM48PL6bvQe ZQYM9yGe+D7OGcKP15LCtJgoW2kZI94b9NAjx4F1ui1OenpTR1mm6ys6a6fuKImT+wF8 6h0JisOB3WDTMYcKxbkyfh+McGA87nsFyLfP5RdDKjM9SUrIRmaAsZ6L+D4fVPVmByFn bQ1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=a0Y/tZsiHGrtBhrg7EqgJcEfD1mPLnbeF1isrwHvEpE=; b=SkmznQTn5hRH/rVFGaw509nTvLvxhOFyhbquZKkVMQDObZi3SHUWZNYyBM95OTGhJF riPz6lkiSmUVVbMmU1VZEWakDomE/891d15bgteIroWKp5NreTCBQ7je2CNiK0kSjPW4 PaPUl7GJ8w+zJXxWkTgzAmTP8KMttCYnDGE7zJhyeM10J5Ppfbe05l3PCSuLaLoZ0UoQ qw5C/Fy2gXkfC9epTxdklGdXg4HZd8XG78aV+k9BCHqWPQHrYyfdS1ByWGZ6qjp4iQTY fpZtJLvLqEb1HKVN7gZpd82ggXhi0bo3Sh0mrOjSHqcmmnjQC4akwiJhda4htLd503Dh lNXQ== 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 az8-v6si11652317plb.347.2018.05.15.05.29.57; Tue, 15 May 2018 05:29:57 -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 S1753353AbeEOM3y (ORCPT + 29 others); Tue, 15 May 2018 08:29:54 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59698 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753300AbeEOM3w (ORCPT ); Tue, 15 May 2018 08:29:52 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D5093165C; Tue, 15 May 2018 05:29:51 -0700 (PDT) Received: from sugar.kfn.arm.com (unknown [10.45.48.163]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EAF4B3F25D; Tue, 15 May 2018 05:29:47 -0700 (PDT) From: Gilad Ben-Yossef To: Simon Horman , Magnus Damm , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Herbert Xu , "David S. Miller" Cc: Ofir Drang , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-crypto@vger.kernel.org Subject: [PATCH 2/3] clk: renesas: r8a7795: Add ccree clock Date: Tue, 15 May 2018 13:29:28 +0100 Message-Id: <1526387370-17142-3-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526387370-17142-1-git-send-email-gilad@benyossef.com> References: <1526387370-17142-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds the clock used by the CryptoCell 630p instance in the SoC. Signed-off-by: Gilad Ben-Yossef --- drivers/clk/renesas/r8a7795-cpg-mssr.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/drivers/clk/renesas/r8a7795-cpg-mssr.c b/drivers/clk/renesas/r8a7795-cpg-mssr.c index 775b0ce..642706a 100644 --- a/drivers/clk/renesas/r8a7795-cpg-mssr.c +++ b/drivers/clk/renesas/r8a7795-cpg-mssr.c @@ -132,6 +132,7 @@ static struct mssr_mod_clk r8a7795_mod_clks[] __initdata = { DEF_MOD("sys-dmac2", 217, R8A7795_CLK_S0D3), DEF_MOD("sys-dmac1", 218, R8A7795_CLK_S0D3), DEF_MOD("sys-dmac0", 219, R8A7795_CLK_S0D3), + DEF_MOD("ccree", 229, R8A7795_CLK_S3D2), DEF_MOD("cmt3", 300, R8A7795_CLK_R), DEF_MOD("cmt2", 301, R8A7795_CLK_R), DEF_MOD("cmt1", 302, R8A7795_CLK_R), From patchwork Tue May 15 12:29:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 135878 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp951056lji; Tue, 15 May 2018 05:30:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr70+uOCUKJokL6J0ihi06x1YolV7IsQhdoNjpeX1Xrgmxx9pQu+c1R2RAk5hsNRmZKRvVr X-Received: by 2002:a62:f713:: with SMTP id h19-v6mr14648367pfi.165.1526387404983; Tue, 15 May 2018 05:30:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526387404; cv=none; d=google.com; s=arc-20160816; b=FsN2irL+wdRhLIVBZmx5qxwcqq6tx/BJUaRlJTHVIMgb9DpXMpKwZnFgj/5U0yTplO GIYDmfEZQjNCYrlCxChQqmxAaJM0E2qvkyuBdq9PPOhx5C7j94+onESGS6xEkA//c/cO ZMDoWacrP4CTbjB7cILejfnMsb+hJllafRrqBnrrSg82Wf5x5ZhVDCnl1icUP+8vACod sC6SQf3p4CuPiHuANrM6eJT3R3d+CRoW9WAJtKn+04QMjuBHS8A7/G02M7bm8l21xH4b Pp+0UqaUHHwlNMRcjznLe+tN1E/JJPQjU2srf03w4s9efdY5YaVa/+YDZ6woDDXREx0y JbQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=MnzFSy0OlryZfr4xcvAKU69vEHROrRKl+X27kPv1XXk=; b=d4ri09sgr40LvhwMfYgp1lmxrnqtUVLdoTNdbZFjV4HRnZBRMqyT7R4YI956j6dfIz Y+6lE95pQC4ni+LQWckL6/360bo81XcLgUyUzRcXemvHviuZtZM4A3E1SU+gKCyxVukK H1VDnIL+0tiP5jFLt6y64Z6e9qI87xJP/0yrWDc5aEk0PKMJaBILRGMuxw/XxpzdcAn8 Owqy9FJEYU3RepVBB8/ELMtEpGsQwoa9FDOu5SQEyIUI0V4g7YzwfqeR64Ve3dI+Q6UL C+CTAhZyy6xmyL6h2Ni/o4IHO0QiF328U71j6bLxbaC3e2A3T6zjoIIud8EsiOn79H5C RhXw== 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 az8-v6si11652317plb.347.2018.05.15.05.30.04; Tue, 15 May 2018 05:30:04 -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 S1753371AbeEOMaB (ORCPT + 29 others); Tue, 15 May 2018 08:30:01 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59714 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752343AbeEOM35 (ORCPT ); Tue, 15 May 2018 08:29:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0F71280D; Tue, 15 May 2018 05:29:57 -0700 (PDT) Received: from sugar.kfn.arm.com (unknown [10.45.48.163]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E9C523F25D; Tue, 15 May 2018 05:29:52 -0700 (PDT) From: Gilad Ben-Yossef To: Simon Horman , Magnus Damm , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Herbert Xu , "David S. Miller" Cc: Ofir Drang , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-crypto@vger.kernel.org Subject: [PATCH 3/3] arm64: dts: renesas: r8a7795: add ccree binding Date: Tue, 15 May 2018 13:29:29 +0100 Message-Id: <1526387370-17142-4-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526387370-17142-1-git-send-email-gilad@benyossef.com> References: <1526387370-17142-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add bindings for CryptoCell instance in the SoC. Signed-off-by: Gilad Ben-Yossef --- arch/arm64/boot/dts/renesas/r8a7795.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.7.4 diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi b/arch/arm64/boot/dts/renesas/r8a7795.dtsi index 91486b4..6c76841 100644 --- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi @@ -528,6 +528,14 @@ status = "disabled"; }; + arm_cc630p: crypto@e6601000 { + compatible = "arm,cryptocell-630p-ree"; + interrupts = ; + #interrupt-cells = <2>; + reg = <0x0 0xe6601000 0 0x1000>; + clocks = <&cpg CPG_MOD 229>; + }; + i2c3: i2c@e66d0000 { #address-cells = <1>; #size-cells = <0>;