Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp462150pxb; Thu, 5 Nov 2020 04:59:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxN65l5I9PthuOQDQ+/jFnM4nYRE0lmVvacgtlQXKdBPyH7cZ4EUq/1rXUHg7XLHFq3mQmV X-Received: by 2002:a50:951e:: with SMTP id u30mr2485354eda.197.1604581173802; Thu, 05 Nov 2020 04:59:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604581173; cv=none; d=google.com; s=arc-20160816; b=WKewN2LArD9e+0JsgjU3nbxt6cUkFrRQDRlxQI4qkjRS6FQTE56pIH8BJPFtrSp5Oc ziLOtQwU+sQZiT6+5UzZVU9uW8iPsf4PkDgQFqRCHMSA2lqWKcWyxVxLmbUejr2BsNBx DxQSbT847ec34s3frZRQTiF0iN5r+rEorRxIoZbDHo7Uzb0Oq2Rll+QktW4NFXqMIjbZ 93sy/qfbOn3NjUtv9wPDE971dgig2o5DSU3tRTpbhYSGfTUGduh30OmjEpj1wip7PJ7f b3Z8KYyYf71aaRWMhWXGoVXOj2kTmamPXOI7CQkwXFJFIrpxkj4woK4hT5kawwFH46ev PojA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=lJ718e2rlWtSNFkKhdcWSYJd1OTnNBL/oXEcdCM+K2g=; b=mCKfqoAjup1IAnJP4TkbgsStc1zRMK1UzO6r9qL5E4th/uxka+OFADMmw+lNyY8Dpz +A5B5EjMDwPTa+m+sAFmx+85ea77Q48uChCgPFX709vZBstfKwNL5aEfhFnqxaH/IxOa lQQQouLlwTKXdjmyZCGEBxrNyKGXIqqWkfGfP++Xr/sLoHv61alM/pMcIK6UrK+6IBEP 5XJAZ49KWDCmDahjqgEXKYTt4HQh+L5Gwo7gw2OVvVriORah14zFQHZMQlqCGIQY9yAd 5axj8lwFTRu/uYjtpU1grnzUXLxmAsqf6Zd0aqCClZ1OiHTvj3P7n+v5mGG52aWdNBKI 37ww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w12si1032959ejb.135.2020.11.05.04.59.10; Thu, 05 Nov 2020 04:59:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730968AbgKEM5O (ORCPT + 99 others); Thu, 5 Nov 2020 07:57:14 -0500 Received: from foss.arm.com ([217.140.110.172]:60094 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730922AbgKEM5I (ORCPT ); Thu, 5 Nov 2020 07:57:08 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5754314BF; Thu, 5 Nov 2020 04:57:07 -0800 (PST) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.195.35]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AD18D3F719; Thu, 5 Nov 2020 04:57:05 -0800 (PST) From: Andre Przywara To: Will Deacon , Catalin Marinas , Ard Biesheuvel , Russell King Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Sudeep Holla , Mark Rutland , Mark Brown , Lorenzo Pieralisi , Linus Walleij Subject: [PATCH v2 1/5] firmware: smccc: Add SMCCC TRNG function call IDs Date: Thu, 5 Nov 2020 12:56:52 +0000 Message-Id: <20201105125656.25259-2-andre.przywara@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201105125656.25259-1-andre.przywara@arm.com> References: <20201105125656.25259-1-andre.przywara@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel The ARM architected TRNG firmware interface, described in ARM spec DEN0098, define an ARM SMCCC based interface to a true random number generator, provided by firmware. Add the definitions of the SMCCC functions as defined by the spec. Signed-off-by: Ard Biesheuvel Signed-off-by: Andre Przywara --- include/linux/arm-smccc.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index f860645f6512..62c54234576c 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -102,6 +102,37 @@ ARM_SMCCC_OWNER_STANDARD_HYP, \ 0x21) +/* TRNG entropy source calls (defined by ARM DEN0098) */ +#define ARM_SMCCC_TRNG_VERSION \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_32, \ + ARM_SMCCC_OWNER_STANDARD, \ + 0x50) + +#define ARM_SMCCC_TRNG_FEATURES \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_32, \ + ARM_SMCCC_OWNER_STANDARD, \ + 0x51) + +#define ARM_SMCCC_TRNG_GET_UUID \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_32, \ + ARM_SMCCC_OWNER_STANDARD, \ + 0x52) + +#define ARM_SMCCC_TRNG_RND32 \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_32, \ + ARM_SMCCC_OWNER_STANDARD, \ + 0x53) + +#define ARM_SMCCC_TRNG_RND64 \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_64, \ + ARM_SMCCC_OWNER_STANDARD, \ + 0x53) + /* * Return codes defined in ARM DEN 0070A * ARM DEN 0070A is now merged/consolidated into ARM DEN 0028 C -- 2.17.1