From patchwork Tue Jun 2 08:14:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neal Liu X-Patchwork-Id: 11583363 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B32A912 for ; Tue, 2 Jun 2020 08:15:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 330D72077D for ; Tue, 2 Jun 2020 08:15:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="Ayp5EPbz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725811AbgFBIPD (ORCPT ); Tue, 2 Jun 2020 04:15:03 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:32303 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725969AbgFBIPD (ORCPT ); Tue, 2 Jun 2020 04:15:03 -0400 X-UUID: ff0a8006aa3c4cccaa61a2de3c5c5dcf-20200602 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=MbF+LRzExa+XY/pBtDs6ophTBP7J5P1UhRlTOBIVSUM=; b=Ayp5EPbzHxXWe0W59NethZ6tLIRxQN/3dsP7Nb2bZAh2nImDno9/5J5HztFRF+h0TExeyoUYposQKC2BSFJwk4ysdKl6XOnN7HrB42bLkDYjRzwsikDDq9Ip4OJhaARjUpSslGVFK/QE2XYnenLDO8sKGRhUmQHCfMydCxGV99o=; X-UUID: ff0a8006aa3c4cccaa61a2de3c5c5dcf-20200602 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 587594661; Tue, 02 Jun 2020 16:15:00 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 2 Jun 2020 16:14:59 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 2 Jun 2020 16:14:58 +0800 From: Neal Liu To: Matt Mackall , Herbert Xu , Rob Herring , Matthias Brugger , Sean Wang , Arnd Bergmann , Greg Kroah-Hartman CC: Neal Liu , , , , , lkml , , Crystal Guo Subject: [PATCH v6 1/2] dt-bindings: rng: add bindings for sec-rng Date: Tue, 2 Jun 2020 16:14:37 +0800 Message-ID: <1591085678-22764-2-git-send-email-neal.liu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1591085678-22764-1-git-send-email-neal.liu@mediatek.com> References: <1591085678-22764-1-git-send-email-neal.liu@mediatek.com> MIME-Version: 1.0 X-MTK: N Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Add bindings for ARM TrustZone based Security Random Number Generator. Signed-off-by: Neal Liu --- Documentation/devicetree/bindings/rng/sec-rng.yaml | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/rng/sec-rng.yaml diff --git a/Documentation/devicetree/bindings/rng/sec-rng.yaml b/Documentation/devicetree/bindings/rng/sec-rng.yaml new file mode 100644 index 0000000..7f4ae50 --- /dev/null +++ b/Documentation/devicetree/bindings/rng/sec-rng.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# # Copyright 2020 MediaTek Inc. +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/rng/sec-rng.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Security Random Number Generator + +description: | + sec-rng is a security random number generator which provides a generic + interface to get hardware rnd from Secure state. The Secure state can be + Arm Trusted Firmware(ATF), Trusted Execution Environment(TEE), or even + EL2 hypervisor. + +maintainer: + - Neal Liu + +properties: + compatible: + enum: + - arm,sec-rng + + method: + description: The method of calling to Secure state + enum: + - smc + - hvc + + method-fid: + description: The function number within the SMC and HVC function identifier + maxItems: 1 + + quality: + description: Estimation of true entropy in RNG's bitstream per 1024 bits + maxItems: 1 + +required: + - compatible + - methods + - method-fid + - quality + +additionalProperties: false + +examples: + - | + hwrng: hwrng { + compatible = "arm,sec-rng"; + method = "smc"; + method-fid = /bits/ 16 <0x26a>; + quality = /bits/ 16 <900>; + };