From patchwork Mon Jul 16 05:50:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 141971 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2013147ljj; Sun, 15 Jul 2018 22:51:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdeBJe5C9ITfGKTkuJvyNwOTOX4A1ZmhwjNRiPmgPsR/vQHVtGAPlTMaCi2ELcEwnE8NurB X-Received: by 2002:a63:3f05:: with SMTP id m5-v6mr14118545pga.51.1531720281610; Sun, 15 Jul 2018 22:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531720281; cv=none; d=google.com; s=arc-20160816; b=pctWNEKgEMOr6qpo5bObpi3/eILpKv2kBmrZofee9Z63Z7rN5FCZFCHc2ZjViP8cav zpFMBhFIqTwiRq8XKVtYyddC3Evzwnbu9l5BwCUOwUvvs3NffGwX5G4jrWdXG5Qa0Rq8 MYzfsXW+P8008oa9m5qJGJ6BsZ6onWs8mKxyWxFNQjjgXzZOks3lOypTc+olTfHQSVo6 yQimo/uSED6fippWSJJjW5GWMMTZD+MttboLvjbKmDRePOLhmghUU3HOAEx3AEt10EG3 avTR0Uw7wtl3sE2iA9xbALPH/Jsz5qI1i1h4aCApa55gg5pg9O6cI1SMQhBAkA5b2kMz bHQw== 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:dkim-signature:arc-authentication-results; bh=Qg81S8m1J82gexUC4qnavmNvYCCZ6/crtLtvN/hLcQg=; b=0yG1/kKOFbVcv4+QTMpsif1TOYCJUtmfacxPN7olsccVyaipn/BH69yUEoBk095rJ/ cWdG1N7Eo2gw9iOT6LBJFkMMu/920r80KCkzSgaJAf3qsEow+PGEhAT5lnjL3RU4LS2h 3pFUdcIHnCp8stXu6pZvmm5MGSOKr4IN22aOxPk6UR+Hnr+6/PmTLUihGUJrcjjTqF2T lLqcOepwc/3pXm9z/YZ2WYVka14vx8Hyj96HL1DxpbK36OHMF6D0sLEEGRd4OHIH31z7 k4WoaQiEESnW9zVoZUlwfBWv1LrInSoJ1jFusG7q/uTWCSXgDkYzn0FbC0USttAE6BoN qNpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TDfArAyv; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20-v6si6589657pls.237.2018.07.15.22.51.21; Sun, 15 Jul 2018 22:51:21 -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=@kernel.org header.s=default header.b=TDfArAyv; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727566AbeGPGRB (ORCPT + 1 other); Mon, 16 Jul 2018 02:17:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:37192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727540AbeGPGRB (ORCPT ); Mon, 16 Jul 2018 02:17:01 -0400 Received: from localhost.localdomain (unknown [122.178.242.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E4C5D2086E; Mon, 16 Jul 2018 05:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531720280; bh=vqVofvapwrG8ciliKflyyjljd3etyLgYjITOT4LK8ZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TDfArAyvpuSaeWWTancdiILnCJKi+prrXj5+TmqdDGpgchplaOqBoza/v1J3sT2Ru ncNfcQq74+GhxbCY5gjDOhEuFhfi+fBqSnX6VGEPSSOsth7q9zsVchmccG+Ul2IbEY FULJD0k4Hn3uRk16tQVkIEBFhk39fTF6U9n7ae1Q= From: Vinod Koul To: linux-crypto@vger.kernel.org Cc: Bjorn Andersson , Matt Mackall , Herbert Xu , linux-arm-msm@vger.kernel.org, Stephen Boyd , Timur Tabi , Jeffrey Hugo , Vinod Koul Subject: [PATCH v6 4/6] dt-bindings: crypto: Add new compatible qcom, prng-ee Date: Mon, 16 Jul 2018 11:20:25 +0530 Message-Id: <20180716055027.3048-5-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180716055027.3048-1-vkoul@kernel.org> References: <20180716055027.3048-1-vkoul@kernel.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Later qcom chips support v2 of the prng, which exposes an EE (Execution Environment) for OS to use so add new compatible qcom,prng-ee for this. Signed-off-by: Vinod Koul --- Documentation/devicetree/bindings/crypto/qcom,prng.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.14.4 diff --git a/Documentation/devicetree/bindings/crypto/qcom,prng.txt b/Documentation/devicetree/bindings/crypto/qcom,prng.txt index 8e5853c2879b..7ee0e9eac973 100644 --- a/Documentation/devicetree/bindings/crypto/qcom,prng.txt +++ b/Documentation/devicetree/bindings/crypto/qcom,prng.txt @@ -2,7 +2,9 @@ Qualcomm MSM pseudo random number generator. Required properties: -- compatible : should be "qcom,prng" +- compatible : should be "qcom,prng" for 8916 etc + : should be "qcom,prng-ee" for 8996 and later using EE + (Execution Environment) slice of prng - reg : specifies base physical address and size of the registers map - clocks : phandle to clock-controller plus clock-specifier pair - clock-names : "core" clocks all registers, FIFO and circuits in PRNG IP block From patchwork Mon Jul 16 05:50:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 141973 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2013228ljj; Sun, 15 Jul 2018 22:51:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpePm+Run4BROfCvXgVNk+yGkaSnY7Xk3Z2M59dAqsuzbdoY0Odm1RxEkiW4sYy0rhP6JcmY X-Received: by 2002:a17:902:82c7:: with SMTP id u7-v6mr15358639plz.83.1531720287731; Sun, 15 Jul 2018 22:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531720287; cv=none; d=google.com; s=arc-20160816; b=nmIMqouFfXW1m319hd9/7iofGyVbDCD0Wp8Uw8WVwcNSOq4WPgXMNnwZkQ2Dev9NQc eQaVWRCNI7RP9wVRD7k2XX07rPPEpl4Oyez7Y/A/8fQtRiZlpTJWYD5iJRBvrNH7HpSJ JDe+eywfoOLZ1eeM2d1U9TiiLxYASNf52dfDXuWBBEhpvwIv89AG1dT8pOMrQdoaby6N NLASjpA94nvTm/rDkGO5vCBuAi+qMSNbr/RSJ7vbCSzpw3DgL+CWQCXKWPpgMA309ZOn aZOdFxAFvS85zYx1sSeAEb4+ojgiyrhR/nXyxrwC/vSu63HAdMkbmfatLhB4H47aWg5S 6X9Q== 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:dkim-signature:arc-authentication-results; bh=HrnfW+X+ddbcVcrKikUnUyWZjT4DcbSHTFDpxO+pYZ8=; b=bdCImLEQHRvfHjBW/QPU0ISd2qljFYRnZVrA8Q6A/WA1ehUZiRofpzFw3pOpzCvupV t8FSSItvCJOFTOC5zzHuKlTNhYNDL49IcfVvGmL/ShNnUKuOuwGKL3LqYu3yM1dSVRoz LWorKQ2lngCiaXGViKftfiaiPY33UZVsAKZRPFU6ALKKzIoQBh0n4nGtTMPHe7xJXKRD cDfKmPB/Yh/wL9Rd+5cle12tt/N7EAUrO9EAJmDHfBXp850lV7FCjPhUV8CKOWpjUrch 4ZAsmQ6poSQdbe9BBlfDLSy3wKEHoPUPKLTjT8ZtgJzkDP1ri+wmJiyM0q0zLOvcfw8y tzmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wysWJdlW; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20-v6si6589657pls.237.2018.07.15.22.51.27; Sun, 15 Jul 2018 22:51:27 -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=@kernel.org header.s=default header.b=wysWJdlW; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727620AbeGPGRH (ORCPT + 1 other); Mon, 16 Jul 2018 02:17:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:37232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbeGPGRH (ORCPT ); Mon, 16 Jul 2018 02:17:07 -0400 Received: from localhost.localdomain (unknown [122.178.242.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 893452086E; Mon, 16 Jul 2018 05:51:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531720285; bh=a0oCxzbLOLjauSDG5VT9Xqo7iareLoHIOesk54QZWgs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wysWJdlWyo9b/U7mhIu3jbQrE47m+qfjEq3dnj2pH323XmLoKd0yx4UiGwOB3iseb VE9Nbs2Pz62Nn0w6R7TJ6Ggp6AAnXKvhhPFQsceQT1YqPFO7IUCN39Sl7UOU8kRgcg 1QXYEp9/ovRdw1NF3heWNUzj3ibpByhyS1Kn6L8M= From: Vinod Koul To: linux-crypto@vger.kernel.org Cc: Bjorn Andersson , Matt Mackall , Herbert Xu , linux-arm-msm@vger.kernel.org, Stephen Boyd , Timur Tabi , Jeffrey Hugo , Vinod Koul Subject: [PATCH v6 6/6] crypto: qcom: Add ACPI support Date: Mon, 16 Jul 2018 11:20:27 +0530 Message-Id: <20180716055027.3048-7-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180716055027.3048-1-vkoul@kernel.org> References: <20180716055027.3048-1-vkoul@kernel.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Timur Tabi Add support for probing on ACPI systems, with ACPI HID QCOM8160. On ACPI systems, clocks are always enabled, the PRNG should already be enabled, and the register region is read-only. The driver only verifies that the hardware is already enabled never tries to disable or configure it. Signed-off-by: Timur Tabi Tested-by: Jeffrey Hugo [port to crypto API] Signed-off-by: Vinod Koul --- drivers/crypto/qcom-rng.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) -- 2.14.4 diff --git a/drivers/crypto/qcom-rng.c b/drivers/crypto/qcom-rng.c index 80544326e310..e54249ccc009 100644 --- a/drivers/crypto/qcom-rng.c +++ b/drivers/crypto/qcom-rng.c @@ -4,6 +4,7 @@ // Based on msm-rng.c and downstream driver #include +#include #include #include #include @@ -168,9 +169,13 @@ static int qcom_rng_probe(struct platform_device *pdev) if (IS_ERR(rng->base)) return PTR_ERR(rng->base); - rng->clk = devm_clk_get(&pdev->dev, "core"); - if (IS_ERR(rng->clk)) - return PTR_ERR(rng->clk); + /* ACPI systems have clk already on, so skip clk_get */ + if (!has_acpi_companion(&pdev->dev)) { + rng->clk = devm_clk_get(&pdev->dev, "core"); + if (IS_ERR(rng->clk)) + return PTR_ERR(rng->clk); + } + rng->skip_init = (unsigned long)device_get_match_data(&pdev->dev); @@ -193,6 +198,14 @@ static int qcom_rng_remove(struct platform_device *pdev) return 0; } +#if IS_ENABLED(CONFIG_ACPI) +static const struct acpi_device_id qcom_rng_acpi_match[] = { + { .id = "QCOM8160", .driver_data = 1 }, + {} +}; +MODULE_DEVICE_TABLE(acpi, qcom_rng_acpi_match); +#endif + static const struct of_device_id qcom_rng_of_match[] = { { .compatible = "qcom,prng", .data = (void *)0}, { .compatible = "qcom,prng-ee", .data = (void *)1}, @@ -206,6 +219,7 @@ static struct platform_driver qcom_rng_driver = { .driver = { .name = KBUILD_MODNAME, .of_match_table = of_match_ptr(qcom_rng_of_match), + .acpi_match_table = ACPI_PTR(qcom_rng_acpi_match), } }; module_platform_driver(qcom_rng_driver);