Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp570574pxu; Tue, 6 Oct 2020 13:21:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxma4guQkG1Evw45x04AAxJFIhqNTU5nr8dCO7Z/uajDzd7ucN6SpWKF3VDo+HUCMpAHoCs X-Received: by 2002:a17:906:640d:: with SMTP id d13mr1297772ejm.223.1602015689023; Tue, 06 Oct 2020 13:21:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602015689; cv=none; d=google.com; s=arc-20160816; b=Uk9LRjP3wUzX2rYVZeSOKdFidaW1zvvcdPEog55N9vX40u8ZnDk0t8SjEjp5trHJ1V 03EMfFEWHSFpAjtfPj+uiqw5pbHMa5sVdVrk5Dx6YZmy2krOQhPtf2nd5cqJCaRJKxhB 34IkvNjiM5wL0PoEIRpVju75lwB4DeiCYDsoEFotWiD6d8o9edbCwoXHLkrRTDzOu4as zlfiuTgJATimo4kzPlgZ/nPRJHUF5F6SYrenmYSXBCL6vYyF6rx4QF6CfFbn1O+m4+j0 9ZGsUwM3SBFHt67CLuY2b+DxFqrCgj8gAGnaTSK77oi5/CNgxAskTjAofjpRWK0flIrK O/qA== 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=UlCBswRvdAvBThWWe0gmUvZlpMD1P0QEvrX+Q8vuhSE=; b=pek7QAWfY3/vWh7n/CBW8nOClsBXxj7N6tyTOZHRR7IwBg+30PC9xJGTqftW6PVXA2 tHL0fK2jS6+T7GeopKaEgOk5pT8Eg0jq/SZd6Gt77tjkGzERVuZeFwDwFhWuLmSJ1Nuq Gly7s+VilRP2rawI9IPakMVWy89E3CYtCusEumjQVK0+nQKSriD8371n2Aud/EfjqqWB SwJuxGLkLAGAVZx92shg3M6d7M7JJ5Z3Nyq3/rnY6epBzlooVn0pCwp5dmF5KMqBJoex 8f6LXB1MUcU62u+2kuhIyHOQVKBO4CGSmbjf9CX9E4ytF4lSmBtt9zqqE/grB0YVn60g QOrA== 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 qc17si2896155ejb.555.2020.10.06.13.21.06; Tue, 06 Oct 2020 13:21:29 -0700 (PDT) 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 S1727223AbgJFUSw (ORCPT + 99 others); Tue, 6 Oct 2020 16:18:52 -0400 Received: from foss.arm.com ([217.140.110.172]:56218 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725962AbgJFUSu (ORCPT ); Tue, 6 Oct 2020 16:18:50 -0400 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 947001500; Tue, 6 Oct 2020 13:18:49 -0700 (PDT) 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 276FA3F71F; Tue, 6 Oct 2020 13:18:48 -0700 (PDT) From: Andre Przywara To: Catalin Marinas , Will Deacon Cc: Mark Rutland , Mark Brown , Ard Biesheuvel , Richard Henderson , Lorenzo Pieralisi , Sudeep Holla , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] firmware: smccc: Add SMCCC TRNG function call IDs Date: Tue, 6 Oct 2020 21:18:07 +0100 Message-Id: <20201006201808.37665-2-andre.przywara@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201006201808.37665-1-andre.przywara@arm.com> References: <20201006201808.37665-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[1], defines an ARM SMCCC based interface to a true random number generator, provided by firmware. Add the definitions of the SMCCC function IDs, as defined by the spec. [1] https://developer.arm.com/documentation/den0098/latest/ 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 15c706fb0a37..95aae50eaab4 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -99,6 +99,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