From patchwork Mon Jul 9 06:19:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 141544 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2284544ljj; Sun, 8 Jul 2018 23:20:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcaerFXjynBPDePsZn+Qpvt9iLFhGzm38bta3rP5EI7BXIJn5QB2Qh3lxB3K1QPHmqes+kR X-Received: by 2002:a63:710d:: with SMTP id m13-v6mr17631654pgc.66.1531117220445; Sun, 08 Jul 2018 23:20:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531117220; cv=none; d=google.com; s=arc-20160816; b=UGQkcnXWfJJJKr9ybHeVtjZ+eaYjzn3Er1dBGskjuAykHLGx8iDyAVKlucTiJapZsn PhpmdpBi4yJu/wXUOdSwkgQghc9OandGjWlE8JmJ7dZVB0N0PnTZ/1e3tNOsDDSVqORN zWRekFWNpZfh9WKFOE0FCrQlNm6LeFbhYKeHNHWnFmF5hW6W+CPi/+ZeIwJnN8pyKDJX PWXDk3zTU008hDjwPDO/2n9XtLzAWGIqapyTqJjVksq8cQpWIr4wqN/j1L3V1YiOPUWu cVD60EGTJtsV1Z9/1kykk5EFURtqvdtqPoMT/+zcrXPVw/88s0FT3DNlL2YUN9tz1jgU bkXw== 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=dA/j/tFoxxP3yrRqCRqNVjBBipgMx8wg3552GT0Mq4M=; b=fXsRIwJBT6suVgaEBvpJdM1kGHy8MGBKO0qOywrP9K+phnUJBa9D9pm2RBRhHZvgVb wrue0+NZosD4JikxFR8Ui4KTUtOoYldtB1hlZ8qo5Fq4u/wN3T2+0J7AEShPLIot6m4g I6S7/VYQPzupuRHTXNcnnhx2DIQ3HGNbvW0qUXPlmkZ/WznpG0HYNvvS2U9gSzW/a+sr WFUZ0zGyAY8NMj2ZLsFNALvhylBZp3dP3iPMi1UDC78SBSJO/psJCsHTcxuF1K59WNhf xkp9lhYaLWf3SPo6ZcKtmccdM6YtCF5lw7Y6oprHQctVEazXv/lER3ojAYYls3x8d7fM 0ovg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bpvenMzx; 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; 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 k20-v6si13108647pgb.115.2018.07.08.23.20.20; Sun, 08 Jul 2018 23:20:20 -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; dkim=pass header.i=@kernel.org header.s=default header.b=bpvenMzx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754625AbeGIGUS (ORCPT + 29 others); Mon, 9 Jul 2018 02:20:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:45402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754405AbeGIGUP (ORCPT ); Mon, 9 Jul 2018 02:20:15 -0400 Received: from localhost.localdomain (unknown [106.201.46.178]) (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 B84A5208DB; Mon, 9 Jul 2018 06:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531117210; bh=Y6e/3n+guSDc62R6uIPH9agVkOQjWphtXjwR8dgS8bw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bpvenMzxPatKzvwzi8DUZdbGN5+afan21SV9TOUs1UWhPolCZj1jELWNq+LC+4G3H BP3zt106XYo9HVy48zOsgnBqF6rOponL8rKECs45b5uGC9QWdweNLlHOTsqN3GgnLd zcxnGFLfBlG/admE64HQr4pYoE/ASeRxZS0OwMok= From: Vinod Koul To: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bjorn Andersson , Matt Mackall , Herbert Xu , Arnd Bergmann , linux-arm-msm@vger.kernel.org, Stephen Boyd , Timur Tabi , Jeffrey Hugo , Vinod Koul Subject: [PATCH v5 2/6] dt-bindings: crypto: Move prng binding to crypto Date: Mon, 9 Jul 2018 11:49:21 +0530 Message-Id: <20180709061925.20276-3-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180709061925.20276-1-vkoul@kernel.org> References: <20180709061925.20276-1-vkoul@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that we are adding new driver for prng in crypto, move the binding as well. Signed-off-by: Vinod Koul --- Documentation/devicetree/bindings/{rng => crypto}/qcom,prng.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Documentation/devicetree/bindings/{rng => crypto}/qcom,prng.txt (100%) -- 2.14.4 diff --git a/Documentation/devicetree/bindings/rng/qcom,prng.txt b/Documentation/devicetree/bindings/crypto/qcom,prng.txt similarity index 100% rename from Documentation/devicetree/bindings/rng/qcom,prng.txt rename to Documentation/devicetree/bindings/crypto/qcom,prng.txt From patchwork Mon Jul 9 06:19:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 141538 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2285052ljj; Sun, 8 Jul 2018 23:20:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdMYsUWOwOeIaW8DDr8JiydPDtr6gEM/5V5ZyltdzZWGbzjBwRL/EupIBRweFf0U3M5ck54 X-Received: by 2002:a62:60c3:: with SMTP id u186-v6mr20136695pfb.230.1531117253974; Sun, 08 Jul 2018 23:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531117253; cv=none; d=google.com; s=arc-20160816; b=Tc14Axt8aM6UblqTqaeY7WlHSG/+lxDIhW+iqjWRRhgzv2HlIoT1aBjzoDMUs8JOh9 xmKpGkPV0wr+YIqYYPdbZp2FokVA3bmMsWeIv4Grko41uKK/Nadj/BXC0CVpO8A41WFa xm432I80DEhHa6nK69TRyovXDM6z8LCzqMDJW1/UPC1HYe1n/k6uoHX7yCRkaYBNSgwC nCVYHmSllmrW4/11S/vaBL5lNEYwIap04dl2+u3Bmg/ZO+Ylxh0Rohxhwp+JyY9Vaz7Q i4d0ui8lcaXoKHKFO2pZJyhkQWCR8SkTFbLlSGBtPymXuiQE5z0VJ3AGfiUZKjgrMcEi 3JlQ== 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=r9gc9cUO2zGn+VmkeM8RHlPe8A0NvLL8cVdi5Qo1jv599OBwfHotxnDPCQ2OvMeYRh xN8lbIhP4By9cR4ZlS7kghbfYHbOcwJAigEby5S7b/lvYCzazh1y4QjTJDwKGrzmTtOQ maXsSmqgAfr/C35jEfK9d+7GV9AqTNLKL/A66KjdH4QEuiMPO8Nml+ebHtDLvRbQXzF3 PklAt5D5TesQNvfwiu0jwiTWLkFsY9qp7xVn7J47Zk4akSwETVs30Bmjl46TRZW7GzS7 ZWh7EZl3R+yuTuEBdEF2oUuYCWD+QcMMKtVzn7pQ1OSEDSmM78B0Zogy+b8dxC7MOORz HCJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="o/yJj6gJ"; 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; 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 k20-v6si13108647pgb.115.2018.07.08.23.20.53; Sun, 08 Jul 2018 23:20:53 -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; dkim=pass header.i=@kernel.org header.s=default header.b="o/yJj6gJ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754673AbeGIGU3 (ORCPT + 29 others); Mon, 9 Jul 2018 02:20:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:45548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754628AbeGIGUW (ORCPT ); Mon, 9 Jul 2018 02:20:22 -0400 Received: from localhost.localdomain (unknown [106.201.46.178]) (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 B1DDB208E6; Mon, 9 Jul 2018 06:20:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531117217; bh=vqVofvapwrG8ciliKflyyjljd3etyLgYjITOT4LK8ZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o/yJj6gJKZaofzF3we6qznDI3q1SZo80KmoLGNv7GSv9lqTVL6PUj1Op6h+6g6i2P L08ciJDf9oTMyQqNam9BwY2JE0k1ViNdc6JWb/PKb+HZBNphxvhAnzhZxFROigCuXL AhGNKtyLcva5FFy/iZuKSDeqNOOdwzIKQq80AHKo= From: Vinod Koul To: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bjorn Andersson , Matt Mackall , Herbert Xu , Arnd Bergmann , linux-arm-msm@vger.kernel.org, Stephen Boyd , Timur Tabi , Jeffrey Hugo , Vinod Koul Subject: [PATCH v5 4/6] dt-bindings: crypto: Add new compatible qcom, prng-ee Date: Mon, 9 Jul 2018 11:49:23 +0530 Message-Id: <20180709061925.20276-5-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180709061925.20276-1-vkoul@kernel.org> References: <20180709061925.20276-1-vkoul@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 9 06:19: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: 141541 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2284723ljj; Sun, 8 Jul 2018 23:20:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcHut6IUdFjNtIUnXKHCuz1/TB9ABkxHNYOU7i5zF3FVbooH2U8y1+XqtbeFQrabMq+y+f9 X-Received: by 2002:a17:902:9a8a:: with SMTP id w10-v6mr19276252plp.333.1531117232333; Sun, 08 Jul 2018 23:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531117232; cv=none; d=google.com; s=arc-20160816; b=vIbje2wPStDFkrzK8J6cyTTkd4fwzDV1BeM7+3WyVtndobkusBg1FzVXa7jYav74Jq JVNb9JFjmhJhOB5FQcKJKF+sEdrfDbWycEVdYxcQcb00yWXNOohqPmJ7jRrCe16xDIfR loulXm9u7/uhrIWmCLIGbZPkZGMnz20YyuY6mki7iXEv9A6xtIhxVnd/3Gd2A/Kic2gQ l3RtwiJ3+VrqV6YxExQ7cYmiDFx+FVUxvVRrQq8d0QQVH31rL/NOgxF67kABBrinqYn8 5A1OZGO37ZsmSb7A4Tin8RM8yDTG+oV2qhDiI9DoCwAEIr35MVE6gnJqMg8DNpRPs7wN WA2Q== 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=5f9zNpPW89LVmdxUi5DTZ+CR6jDeHFlhJQPz2Xj83SY=; b=wR2AOiZvyWse62GMJFIJaVubFu4DhnIp0xvZHLZD7rmGjyOsUtcq3GrHhIoE6k3WAq O/Set4bPFu5d2l6VGbOKy3SBN54HEUjN9PXImMyik1+v+6cvmzuiNE0oSzcuQHrMbd6Z g9WNGsq6eqbiynRhUWkwLaYZYfYzIxoZDAgdgSu974vBQh9aweIxEdHdaRsoTi/W5RQt PE4+O/pj8HH0KJdt5XuNOf36OQs2sL9H8KHaODlEBnY90tELloocIe/hi8puNCOwwJtk czoigX3ylTHjo2CVvJXmqIQv+x8ZBGUjNR4qsnMN2VcZtuaY7o5t5r+zyKKSBq1hz77I FBkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uUGntY4J; 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; 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 k20-v6si13108647pgb.115.2018.07.08.23.20.32; Sun, 08 Jul 2018 23:20:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b=uUGntY4J; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754693AbeGIGUb (ORCPT + 29 others); Mon, 9 Jul 2018 02:20:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:45616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750996AbeGIGUZ (ORCPT ); Mon, 9 Jul 2018 02:20:25 -0400 Received: from localhost.localdomain (unknown [106.201.46.178]) (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 D603D208A3; Mon, 9 Jul 2018 06:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531117224; bh=dZVwobq8XmsF4Lr32T/vrEXCLRzjLZZNHTsrNIIKwLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uUGntY4JrKS25p9EAmMiXYMQzEA9gD35sB5jBQ/O+1W37MCeV0OocFfNX09lRmLGJ S67xkW0EK1+q+zSOOXs+d04X7xhWyXnu9gPY1+Gc8IbKd6X7gU9NDDX60AXgkHeTXN ybeSQSwTC2FguoW3QgwD1a6Xb3N3rPy0I45caC1A= From: Vinod Koul To: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bjorn Andersson , Matt Mackall , Herbert Xu , Arnd Bergmann , linux-arm-msm@vger.kernel.org, Stephen Boyd , Timur Tabi , Jeffrey Hugo , Vinod Koul Subject: [PATCH v5 6/6] crypto: qcom: Add ACPI support Date: Mon, 9 Jul 2018 11:49:25 +0530 Message-Id: <20180709061925.20276-7-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180709061925.20276-1-vkoul@kernel.org> References: <20180709061925.20276-1-vkoul@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 [port to crypto API] Signed-off-by: Vinod Koul --- drivers/crypto/qcom-rng.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) -- 2.14.4 diff --git a/drivers/crypto/qcom-rng.c b/drivers/crypto/qcom-rng.c index f1bd86acaf9d..8118d4cd93b2 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,13 +169,17 @@ 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); - rng->skip_init = (unsigned long)of_device_get_match_data(&pdev->dev); + /* 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); qcom_rng_dev = rng; + ret = crypto_register_rng(&qcom_rng_alg); if (ret) { dev_err(&pdev->dev, "Register crypto rng failed: %d\n", ret); @@ -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);