From patchwork Thu May 24 14:19:07 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: 136747 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2272147lji; Thu, 24 May 2018 07:19:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrYWBZSfK9yC4pBzV3c/CwQ6Mqo2LElQZIois3k98O8A7YiN51zDPT68WIoXooYuKyQVO9Y X-Received: by 2002:a17:902:6549:: with SMTP id d9-v6mr7674868pln.196.1527171588744; Thu, 24 May 2018 07:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527171588; cv=none; d=google.com; s=arc-20160816; b=We1nwntV+buUBWv4Bv+4uYFCJ15rJYtAL/5CX+ZIdd4ckzrNuEJZUoims9qDqykhFj PtRb9BqlBhSvLaBh8C841Y3lSn+/BVZAM90Gtv5udHGzo0/jpZfEC0Wv9zOyjLDdEBoJ 2twBQH1/KqCRuArc3fgqVPnJEVMrqvwQameTyk2kARugZjbi8HKEW+NlcbRpIseFCf6l cDoEsqmNPF3q1ktC9RFn/zB2lyR43hExoQ3YXWMJS1Ngpb5NUziSIBvES3nJrfeOJKXu SZE1jlX3/QMOV87KGYpUBpVTjftOmWYyClzUUUc1JpXrfW+Jatg7sMPlvy1gNW42y1dQ v/LA== 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=ZyzK5uYIaaOg43hMHgCqUXNqE395niJrdN5A8xt59wo=; b=F5b24CSHu8yIdiCspYtVToVV/kSEeWebKduMbm6gcYO63aUuw873OIadnAw6QBwrQ3 idwZmXPjZJKXtlnkZ2mZC+Om4fUplXazRn4kK2IegvWBxq9vx9V66EguGXEiDfOg262S 6bPTJhrZntD26J2ErFt2PwpDnPLOVssL40Fkj7ZmFgAtg6y5sATpg6cLPtZ2LB0R7UBL VVeb88YUghE7nnWu5JlqzkNsP4WbkjtI1gIE9VlQ3XUvIQnVdZ2MxptOGlbawHgsnyD2 Ih2U7MObV8rD4cCt7tjNAbIRyEmZfNxUax+d/nmWJkwwKeeTceqo5yyNnMqK6GTMS5xF kQiA== 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 y7-v6si16741808pgv.409.2018.05.24.07.19.48; Thu, 24 May 2018 07:19:48 -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 S1032145AbeEXOTj (ORCPT + 30 others); Thu, 24 May 2018 10:19:39 -0400 Received: from foss.arm.com ([217.140.101.70]:45634 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031916AbeEXOTd (ORCPT ); Thu, 24 May 2018 10:19:33 -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 2A4DA165D; Thu, 24 May 2018 07:19:33 -0700 (PDT) Received: from sugar.kfn.arm.com (unknown [10.45.48.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 312583F24A; Thu, 24 May 2018 07:19:28 -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 v2 2/5] crypto: ccree: better clock handling Date: Thu, 24 May 2018 15:19:07 +0100 Message-Id: <1527171551-21979-3-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527171551-21979-1-git-send-email-gilad@benyossef.com> References: <1527171551-21979-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 Use managed clock handling, differentiate between no clock (possibly OK) and clock init failure (never OK) and correctly handle clock detection being deferred. Suggested-by: Geert Uytterhoeven Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_driver.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) -- 2.7.4 Reviewed-by: Simon Horman diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c index 6f93ce7..b266657 100644 --- a/drivers/crypto/ccree/cc_driver.c +++ b/drivers/crypto/ccree/cc_driver.c @@ -190,6 +190,7 @@ static int init_cc_resources(struct platform_device *plat_dev) u64 dma_mask; const struct cc_hw_data *hw_rev; const struct of_device_id *dev_id; + struct clk *clk; int rc = 0; new_drvdata = devm_kzalloc(dev, sizeof(*new_drvdata), GFP_KERNEL); @@ -219,7 +220,24 @@ static int init_cc_resources(struct platform_device *plat_dev) platform_set_drvdata(plat_dev, new_drvdata); new_drvdata->plat_dev = plat_dev; - new_drvdata->clk = of_clk_get(np, 0); + clk = devm_clk_get(dev, NULL); + if (IS_ERR(clk)) + switch (PTR_ERR(clk)) { + /* Clock is optional so this might be fine */ + case -ENOENT: + break; + + /* Clock not available, let's try again soon */ + case -EPROBE_DEFER: + return -EPROBE_DEFER; + + default: + dev_err(dev, "Error getting clock: %ld\n", + PTR_ERR(clk)); + return PTR_ERR(clk); + } + new_drvdata->clk = clk; + new_drvdata->coherent = of_dma_is_coherent(np); /* Get device resources */ From patchwork Thu May 24 14:19:08 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: 136748 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2272155lji; Thu, 24 May 2018 07:19:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqJf0XN6Y4ZaaxmBS5UqlXaXKDmWBlECJjNZRjvnoIx4YYcS9SQsjTxELHnzxFOQvVI8k2c X-Received: by 2002:a17:902:848b:: with SMTP id c11-v6mr7622807plo.132.1527171589246; Thu, 24 May 2018 07:19:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527171589; cv=none; d=google.com; s=arc-20160816; b=B7J6F1H5BwRSfN4OcWDPtNxhp87p5JGBBIgywfTnn0aLaRVgHMDurjxS1OjotFZagv VVYfjYWlITF5vonFqdVb78tNZhnidx8gr/GA1QErpcU9lfqjL/JxDG/R5wl7acOrrjCK csm7zKueU2dROONBBxvlQegJao7wGMNqO44mTjehNKwIIgpDaguAVfibQQliPIQ1urJA O7bCSxXKc9UXWSU+eEEpWA8ex3p/SpRiJyon8AQKvAujZZO3MlIFtVLuUd52Q537THfl FuwY7ZKUrrgC/el2qNC4eNgCpDo9o/Dflq4exNDGvgjANd0gwVCtZVZXkr9GWJyW2qq9 yvNg== 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=GseoGocuqu9uFS8OIEf0/8IbKLWuLgE3McCfvH+WyYw=; b=RKH+HCNsi4orThMHarc+U53m0AGMwjBt1aJEzi+TkZa15SiRtRqlLBMms//qFXdbxP FdYzBhm6rqek+3QG1NqhSVoeWZHGiI22MpVohT0hPe8vc/5ZGGviFd4RoM7663TD8Spr JOoyql8UQmt6eFecadp7RJIv86PdXUVDdl3xQMB0JiNCSTq7fBo7R5M7PCliYP8/OBY8 C/hcv+V9j4Xc0KIC1f1utFiMZK/pLVr/x8onb0P0jYWBXxbE3VYieRif9jRrAFh/WKT0 Ic/eChBqF1MclAROpZeWYVFOsZ7qAbpznK39hl0RdPcE7XyRKon/Zsi99Y0l621Q/6vi fbsQ== 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 y7-v6si16741808pgv.409.2018.05.24.07.19.48; Thu, 24 May 2018 07:19:49 -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 S1032253AbeEXOTp (ORCPT + 30 others); Thu, 24 May 2018 10:19:45 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45648 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032054AbeEXOTj (ORCPT ); Thu, 24 May 2018 10:19:39 -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 B78151688; Thu, 24 May 2018 07:19:38 -0700 (PDT) Received: from sugar.kfn.arm.com (unknown [10.45.48.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 97A483F24A; Thu, 24 May 2018 07:19:34 -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 v2 3/5] crypto: ccree: silence debug prints Date: Thu, 24 May 2018 15:19:08 +0100 Message-Id: <1527171551-21979-4-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527171551-21979-1-git-send-email-gilad@benyossef.com> References: <1527171551-21979-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 The cache parameter register configuration was being too verbose. Use dev_dbg() to only provide the information if needed. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4 Reviewed-by: Simon Horman diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c index b266657..1e40e76 100644 --- a/drivers/crypto/ccree/cc_driver.c +++ b/drivers/crypto/ccree/cc_driver.c @@ -168,14 +168,14 @@ int init_cc_regs(struct cc_drvdata *drvdata, bool is_probe) val = cc_ioread(drvdata, CC_REG(AXIM_CACHE_PARAMS)); if (is_probe) - dev_info(dev, "Cache params previous: 0x%08X\n", val); + dev_dbg(dev, "Cache params previous: 0x%08X\n", val); cc_iowrite(drvdata, CC_REG(AXIM_CACHE_PARAMS), cache_params); val = cc_ioread(drvdata, CC_REG(AXIM_CACHE_PARAMS)); if (is_probe) - dev_info(dev, "Cache params current: 0x%08X (expect: 0x%08X)\n", - val, cache_params); + dev_dbg(dev, "Cache params current: 0x%08X (expect: 0x%08X)\n", + val, cache_params); return 0; } From patchwork Thu May 24 14:19:09 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: 136749 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2272255lji; Thu, 24 May 2018 07:19:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpTgqlb4RXyfVwmw1FvS/D9pYixMR7Vj5W5jBscDGTFo+C1/oJWGfpkwoTzZfeT/wAA5fD/ X-Received: by 2002:a63:6fcf:: with SMTP id k198-v6mr6172568pgc.307.1527171594870; Thu, 24 May 2018 07:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527171594; cv=none; d=google.com; s=arc-20160816; b=hcqz1YTXy4ILUUZyWXDOh2h73X2ebCO+pvd0ZRQEUnhp6t3H9nfcivcioqWoKR/zzr l4AWNF5Bx9fjJ4RIn+A4X2MGHuulE8o/7yy4bwCto2y2tngpR89nAVd2dnkdEM/Htno6 PrV3sAmfU6uTG0zRZ5werviNRP5T0D+JBbd2zTCaFlz2FVYqrMlrLwLs97lTwe5BPcSN 8ZQ8DOlYGNosgKw7CuSdvuNUyz7sF/lVQHYMOAJh0fhGpkxMI8d+PqYsmHvBP6zoCAiA yMigs/6V3bxNQQLz8FCFvdI5SK8TgHgQmSSzKMJRT21RAez6BuffWQPx4ORcHgErRGcP xl7A== 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=P3Q5EPCrw0FRMDMean8VQYiGOtUhncnLWK6RV6d5N8A=; b=CgT8C7uE8XlHjpTDNVt4ibjrx7XP4z2bcRdUu4kfzYF2nZqfhSvxPIE+34a51BDk85 4jZ0fGza70LAFh4HYqtzW2DVdUzC1TWBvK0LSkx5RF5YTxiPI3YmgGHeCEIL4FJ2fqv2 E6gZKp3ldzRbbV47gSG1HbLCXG95ZFG1RKy/zen4uxyuvV2NVi4yZXvPHDVAtEryksku rT2+UWzFC9JinTJLuqK2X/v/8dRq9Dd8Z2C+iblg1qcPgqHkdKMBt7MwRErOIyHHaElp GEE/S6m8TAP9aQ7XdwLQJXmM1NBxhT18ezIHR/7judcktKuT7b1Jewx8hkHspARVMvL8 Hv4Q== 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 y7-v6si16741808pgv.409.2018.05.24.07.19.54; Thu, 24 May 2018 07:19:54 -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 S1032153AbeEXOTw (ORCPT + 30 others); Thu, 24 May 2018 10:19:52 -0400 Received: from foss.arm.com ([217.140.101.70]:45672 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032250AbeEXOTp (ORCPT ); Thu, 24 May 2018 10:19:45 -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 80408168F; Thu, 24 May 2018 07:19:44 -0700 (PDT) Received: from sugar.kfn.arm.com (unknown [10.45.48.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 67A193F24A; Thu, 24 May 2018 07:19:40 -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 v2 4/5] clk: renesas: r8a7795: add ccree clock bindings Date: Thu, 24 May 2018 15:19:09 +0100 Message-Id: <1527171551-21979-5-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527171551-21979-1-git-send-email-gilad@benyossef.com> References: <1527171551-21979-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 --- This patch depends upon the "clk: renesas: r8a7795: Add CR clock" patch from Geert Uytterhoeven. drivers/clk/renesas/r8a7795-cpg-mssr.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 Reviewed-by: Geert Uytterhoeven diff --git a/drivers/clk/renesas/r8a7795-cpg-mssr.c b/drivers/clk/renesas/r8a7795-cpg-mssr.c index e5b1865..a85dd50 100644 --- a/drivers/clk/renesas/r8a7795-cpg-mssr.c +++ b/drivers/clk/renesas/r8a7795-cpg-mssr.c @@ -133,6 +133,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("sceg-pub", 229, R8A7795_CLK_CR), DEF_MOD("cmt3", 300, R8A7795_CLK_R), DEF_MOD("cmt2", 301, R8A7795_CLK_R), DEF_MOD("cmt1", 302, R8A7795_CLK_R),