From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.129]) by mx.groups.io with SMTP id smtpd.web11.4129.1607505878050001257 for ; Wed, 09 Dec 2020 01:24:38 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=oYMGao+3; spf=pass (domain: os.amperecomputing.com, ip: 40.107.220.129, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UTxyii7ZaIif/Vjy08i70U14mC6ZALGdeYinbEA3dJZyEL+vXdrt0J106a/9VM3XlOcK3FdT1UDMa/aHhSqGtdb+cpFJFagLG7D6588XT/kFEqpltyFqJvIy0CG0+yCch2hED3ygL0zaraaPADchhkCo4mM5offtWw4QsFKnAIoRU888elcNiM6Vf2Cr9mdkGz4cmOMt0/1ekZQbzobF5f5yyDjBc8CcSOrNU/Ti5pMmRhDRh4PA2ciebtxNlco72Pt8qKisAONWnTZEgB8YXEimDDYtTcEwYI+oqUrwT48Ap1tvFaQA8AiYQE9Ovr7oq83iu59o0zCTSwIDFcfKnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aBmWH0ANOgltVgvclRLid1ZEy8e8nYwIZkZNDx9gAj4=; b=X7NzJmKlDkU7zhLKKEV12D8TYCuVk1LuqQ329pyWBPSeDmedBaUzAX/bWETjWq220v4bUSzK6Z5irIaDpDFjDseHYdX+1gfFZ8FDQkXsEsFrvCD+epooxWKyLpnnYjOF4LEeHnfw+6JNHj+Q8pqP/tjbUTcbygKakyJtB27Bu8R4VT9cniAczOzi1CL0JD5JLL8OQGV6OoscgTZduaaZVDBqUwgH2VkustdJvLS9Ze+Q1MyRJCraat0ri3XD2xvq6+X9ikekl/Ovmbb9T3crHzTe5GsET7lmoTdfGxPiiWUMH6g6ptkrzkLnxAyKDX/TjuBwIFfA3Oj0uf13j5rVUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aBmWH0ANOgltVgvclRLid1ZEy8e8nYwIZkZNDx9gAj4=; b=oYMGao+3ku7r/yk/c9nfNoKVrjoaHqLxGHP+K5xw8DzMmyv4aQwfwobBhxDNQalICkZi7xAccopWUs+iuH1sYgfPomA4wl6PCh1wEc3SPFCvYZCGwpeXfoQMGKPd27y9Ra8CP9wvCuUiM8de8W9CNV1hH8QAhrA3LzKe1rW5S4I= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM6PR01MB5849.prod.exchangelabs.com (2603:10b6:5:205::20) by DM6PR01MB5609.prod.exchangelabs.com (2603:10b6:5:157::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.21; Wed, 9 Dec 2020 09:24:36 +0000 Received: from DM6PR01MB5849.prod.exchangelabs.com ([fe80::c814:9a08:5c2e:4076]) by DM6PR01MB5849.prod.exchangelabs.com ([fe80::c814:9a08:5c2e:4076%5]) with mapi id 15.20.3632.023; Wed, 9 Dec 2020 09:24:36 +0000 From: "Nhi Pham" To: devel@edk2.groups.io Cc: Vu Nguyen Subject: [edk2-platforms][PATCH 17/34] Silicon/Ampere: Add Random Number Generator Support Date: Wed, 9 Dec 2020 16:25:14 +0700 Message-Id: <20201209092531.30867-18-nhi@os.amperecomputing.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201209092531.30867-1-nhi@os.amperecomputing.com> References: <20201209092531.30867-1-nhi@os.amperecomputing.com> X-Originating-IP: [118.69.219.201] X-ClientProxiedBy: HK0PR01CA0054.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::18) To DM6PR01MB5849.prod.exchangelabs.com (2603:10b6:5:205::20) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sw004.amperecomputing.com (118.69.219.201) by HK0PR01CA0054.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Wed, 9 Dec 2020 09:24:35 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae991be5-01dd-4f28-57c5-08d89c243f59 X-MS-TrafficTypeDiagnostic: DM6PR01MB5609: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2y1k8/Js7JpmLYrwe3kuvFn/UOxoX8tWYBo87jhJziCMaIGYCfUxuGcgvkVrKu9ftgQPNdzweh4MPUPM0h/4CYte8hdKSJaJqTMUD7xGsU7zork98n7qYnUAOBDw9CwHMDubKsZOi7uESb0+0RmpTMLn8Rny3Fy/PfK73Gkyjmcabs+uju0qefNLV4DqhnyBpwx0R3b4k4C8nwrd4fE76GT4jEEXwLG9kHFybJ2IkiVMwGhy9dZI4DHvCwu41VsMVLMF2h1PIemRUcdUXFbpWxDS+7SI9md6gJ+Db9M//B1M6Qkoea4DKgPmR5HvBPJLZxMIj2LVKTMQYU+/jubn9j9eC7bWnrs34r6CTKGcvHJ+nsFaMNNKqVtABj3nCMo3/bPLkyvOyXXtR4tOJR+AveLEK0n0zQ3uE9n1HfbG1owUQgL+9RL8UKnOn8WMwF7x X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR01MB5849.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(136003)(346002)(366004)(5660300002)(956004)(508600001)(52116002)(30864003)(66946007)(6916009)(2616005)(1076003)(19627235002)(86362001)(6512007)(66476007)(26005)(8936002)(16526019)(107886003)(6666004)(186003)(6486002)(8676002)(6506007)(83380400001)(2906002)(34490700003)(66556008)(4326008)(44824005)(14943795004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?6PDKjnalmAb1fwh/TjLxD9s7fHSkMKH7C01rrvrFslnlBlg+6j7nPy0jgXjt?= =?us-ascii?Q?2uyspmAgQvr8BEuWDf89e/1ytLT6Rk6SErVpeXEYgHPxADhjRrtuT2TREMQf?= =?us-ascii?Q?oaNnd/TtgtcCWACnnx0QhxE3Fo8FIEPeg1zwu8t8BWVTRmvFqXc4/UpIBzMa?= =?us-ascii?Q?oTe2lTL+yZnlkZrqwASUnzsoykHMCE9CtgtGV9o3LHVitXIoyGdFxpozPPtH?= =?us-ascii?Q?ztyXmPnAZU3dJXCMNoPdMEczNSD9ejlzO1rQeCDZWwkG2mBTu7q82ad33w2j?= =?us-ascii?Q?g/gUhUlF+T6eKLj/WeOsDhkW4/9OUZda2ShVrt6Bdh8OkCDAdlIzn5FHOawX?= =?us-ascii?Q?KZFmvaT3z8HsQj+2F8PrN51qa3V0dWIVS/Da9Kb1AYyhOJfQd8c8QbprWSWq?= =?us-ascii?Q?fYHjHAN9TwU468tnKyaXnva67EZJQAdlpbG8vugMS5y/BfT8RT+CME3MlEln?= =?us-ascii?Q?SghhkpNK1EluKmabZD/TA6etq4tI2rE8HZMeknnRUcxN8HZwpwCqvnsktZDK?= =?us-ascii?Q?PmB6x2u7aMPki5mKsrqFUuytjili1B/rh6xPnWWh1ukDVa1qdy1HIsFZG94C?= =?us-ascii?Q?AWr+G+/17P7UGJCUgfzPWsRhgWU7qSpaZjqteIGIXvbgIKOUiZ1V0prqzYJN?= =?us-ascii?Q?7Pvfsav9pOJKFsr0aUbJibJxPSJ6lyT8CoYj6cI0lC4Uui1G716H1rmy2JrO?= =?us-ascii?Q?eukR7NCICGjlPXOQK1ddSVXqfQeaey9aMeZOjo4D2tk3kgGH2eiWEiEmZrj4?= =?us-ascii?Q?WtBBk8DaMvpL4OW6LNgUDX/P5ZceKpEu1O8vwTSaT99pdX6Fw5bm9wnzt1g1?= =?us-ascii?Q?ktsf4ea7E3/Ll8tYnLp1m42W8OJ0BsmcdF/5lgxWUmdLDdBRpKPMKQ35ES7v?= =?us-ascii?Q?vcWiIKzsl1Ia2FqdWSecCqLkI3uhdpJ5Urn+vwESIkXOqS4XwGDz0sgu3f2z?= =?us-ascii?Q?dgd0dTx6gedcgiclfjE1xo/9c7gfBBDPr0RdwBlv36A3qB7PQIBmsAaghCNT?= =?us-ascii?Q?nbF3?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-AuthSource: DM6PR01MB5849.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2020 09:24:36.7801 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-Network-Message-Id: ae991be5-01dd-4f28-57c5-08d89c243f59 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I2qWbfbLHbJOuQL8Ec6bCrMuX3xAmuefyOtJddptFh33iIVi9OBwI4EoeMUpioABBy9SauAiNKCCClJENRgevpMRyHs8p/AxGkz8jYo6748= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB5609 Content-Type: text/plain From: Vu Nguyen This change adds support for gEfiRngProtocolGuid. Signed-off-by: Vu Nguyen --- Silicon/Ampere/AmpereAltraPkg/Ac01Pkg.dsc.inc | 5 + Platform/Ampere/JadePkg/Jade.fdf | 4 + Silicon/Ampere/Drivers/RngDxe/RngDxe.inf | 57 +++++ Silicon/Ampere/Drivers/RngDxe/RngDxe.c | 246 ++++++++++++++++++++ Silicon/Ampere/Drivers/RngDxe/RngDxe.uni | 10 + Silicon/Ampere/Drivers/RngDxe/RngDxeExtra.uni | 9 + 6 files changed, 331 insertions(+) diff --git a/Silicon/Ampere/AmpereAltraPkg/Ac01Pkg.dsc.inc b/Silicon/Ampere/AmpereAltraPkg/Ac01Pkg.dsc.inc index fab2d3fa800f..cb03f7fc076f 100755 --- a/Silicon/Ampere/AmpereAltraPkg/Ac01Pkg.dsc.inc +++ b/Silicon/Ampere/AmpereAltraPkg/Ac01Pkg.dsc.inc @@ -665,6 +665,11 @@ [Components.common] MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf Silicon/Ampere/AmpereAltraPkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf + # + # Random Number Generator Support + # + Silicon/Ampere/Drivers/RngDxe/RngDxe.inf + # # Bds # diff --git a/Platform/Ampere/JadePkg/Jade.fdf b/Platform/Ampere/JadePkg/Jade.fdf index bd005ccb09d3..f826b14d67d0 100755 --- a/Platform/Ampere/JadePkg/Jade.fdf +++ b/Platform/Ampere/JadePkg/Jade.fdf @@ -313,6 +313,10 @@ [FV.FvMain] # INF Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf + # Random Number Generator Support + # + INF Silicon/Ampere/Drivers/RngDxe/RngDxe.inf + # # UEFI application (Shell Embedded Boot Loader) # diff --git a/Silicon/Ampere/Drivers/RngDxe/RngDxe.inf b/Silicon/Ampere/Drivers/RngDxe/RngDxe.inf new file mode 100644 index 000000000000..f8f90a4580d4 --- /dev/null +++ b/Silicon/Ampere/Drivers/RngDxe/RngDxe.inf @@ -0,0 +1,57 @@ +## @file +# +# Copyright (c) 2020, Ampere Computing LLC. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = RngDxe + FILE_GUID = 67D6517B-7279-4F8E-B273-BDF3F7998016 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + ENTRY_POINT = RngDriverEntry + MODULE_UNI_FILE = RngDxe.uni + +[Sources.common] + RngDxe.c + +[Packages] + MdePkg/MdePkg.dec + ArmPkg/ArmPkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec + Silicon/Ampere/AmperePkg.dec + Silicon/Ampere/AmpereAltraPkg/Ac01Pkg.dec + +[LibraryClasses] + UefiLib + UefiBootServicesTableLib + BaseLib + DebugLib + UefiDriverEntryPoint + SMProLib + +[Guids] + gEfiRngAlgorithmRaw ## SOMETIMES_PRODUCES ## GUID # Unique ID of the algorithm for RNG + +[Protocols] + gEfiRngProtocolGuid ## PRODUCES + +[Depex] + TRUE + +[UserExtensions.TianoCore."ExtraFiles"] + RngDxeExtra.uni + +[FixedPcd] + gArmPlatformTokenSpaceGuid.PcdCoreCount + gArmPlatformTokenSpaceGuid.PcdClusterCount + + gAmpereTokenSpaceGuid.PcdTurboDefaultFreq + gAmpereTokenSpaceGuid.PcdSmproDb + gAmpereTokenSpaceGuid.PcdSmproDbBaseReg + gAmpereTokenSpaceGuid.PcdSmproEfuseShadow0 + gAmpereTokenSpaceGuid.PcdSmproI2cBmcBusAddr + gAmpereTokenSpaceGuid.PcdSmproNsMailboxIndex diff --git a/Silicon/Ampere/Drivers/RngDxe/RngDxe.c b/Silicon/Ampere/Drivers/RngDxe/RngDxe.c new file mode 100644 index 000000000000..baac9e8196b0 --- /dev/null +++ b/Silicon/Ampere/Drivers/RngDxe/RngDxe.c @@ -0,0 +1,246 @@ +/** @file + + Copyright (c) 2020, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Supported RNG Algorithms list by this driver. + */ +EFI_RNG_ALGORITHM mSupportedRngAlgorithms[] = { + EFI_RNG_ALGORITHM_RAW +}; + +enum { + SCP_RNG_GET_TRNG = 1 +}; + +EFI_STATUS +SMProRNGRead ( + IN UINT8 *Data, + IN UINTN DataLen + ) +{ + UINT32 Msg[3]; + EFI_STATUS Status; + + /* SMPro only supports 64bits at a time */ + if ((DataLen != sizeof (UINT64)) || (Data == NULL)) { + return EFI_INVALID_PARAMETER; + } + + Msg[0] = SMPRO_RNG_ENCODE_MSG (SCP_RNG_GET_TRNG, 0); + Msg[1] = 0; + Msg[2] = 0; + + Status = SMProDBWr ( + SMPRO_NS_RNG_MAILBOX_INDEX, + Msg[0], + Msg[1], + Msg[2], + SMPRO_DB_BASE_REG + ); + if (EFI_ERROR (Status)) { + return EFI_DEVICE_ERROR; + } + + Status = SMProDBRd ( + SMPRO_NS_RNG_MAILBOX_INDEX, + &Msg[0], + &Msg[1], + &Msg[2], + SMPRO_DB_BASE_REG + ); + if (EFI_ERROR (Status)) { + return EFI_DEVICE_ERROR; + } + + CopyMem (Data, &Msg[1], sizeof (Msg[1])); + CopyMem (Data + sizeof (Msg[1]), &Msg[2], sizeof (Msg[2])); + + return EFI_SUCCESS; +} + +/** + Returns information about the random number generation implementation. + + @param[in] This A pointer to the EFI_RNG_PROTOCOL instance. + @param[in,out] RNGAlgorithmListSize On input, the size in bytes of RNGAlgorithmList. + On output with a return code of EFI_SUCCESS, the size + in bytes of the data returned in RNGAlgorithmList. On output + with a return code of EFI_BUFFER_TOO_SMALL, + the size of RNGAlgorithmList required to obtain the list. + @param[out] RNGAlgorithmList A caller-allocated memory buffer filled by the driver + with one EFI_RNG_ALGORITHM element for each supported + RNG algorithm. The list must not change across multiple + calls to the same driver. The first algorithm in the list + is the default algorithm for the driver. + + @retval EFI_SUCCESS The RNG algorithm list was returned successfully. + @retval EFI_UNSUPPORTED The services is not supported by this driver. + @retval EFI_DEVICE_ERROR The list of algorithms could not be retrieved due to a + hardware or firmware error. + @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect. + @retval EFI_BUFFER_TOO_SMALL The buffer RNGAlgorithmList is too small to hold the result. + +**/ +EFI_STATUS +EFIAPI +RngGetInfo ( + IN EFI_RNG_PROTOCOL *This, + IN OUT UINTN *RNGAlgorithmListSize, + OUT EFI_RNG_ALGORITHM *RNGAlgorithmList + ) +{ + EFI_STATUS Status; + UINTN RequiredSize; + + if ((This == NULL) || (RNGAlgorithmListSize == NULL)) { + return EFI_INVALID_PARAMETER; + } + + RequiredSize = sizeof (mSupportedRngAlgorithms); + if (*RNGAlgorithmListSize < RequiredSize) { + Status = EFI_BUFFER_TOO_SMALL; + } else { + if (RNGAlgorithmList != NULL) { + CopyMem (RNGAlgorithmList, mSupportedRngAlgorithms, RequiredSize); + Status = EFI_SUCCESS; + } else { + Status = EFI_INVALID_PARAMETER; + } + } + *RNGAlgorithmListSize = RequiredSize; + + return Status; +} + +/** + Produces and returns an RNG value using either the default or specified RNG algorithm. + + @param[in] This A pointer to the EFI_RNG_PROTOCOL instance. + @param[in] RNGAlgorithm A pointer to the EFI_RNG_ALGORITHM that identifies the RNG + algorithm to use. May be NULL in which case the function will + use its default RNG algorithm. + @param[in] RNGValueLength The length in bytes of the memory buffer pointed to by + RNGValue. The driver shall return exactly this numbers of bytes. + @param[out] RNGValue A caller-allocated memory buffer filled by the driver with the + resulting RNG value. + + @retval EFI_SUCCESS The RNG value was returned successfully. + @retval EFI_UNSUPPORTED The algorithm specified by RNGAlgorithm is not supported by + this driver. + @retval EFI_DEVICE_ERROR An RNG value could not be retrieved due to a hardware or + firmware error. + @retval EFI_NOT_READY There is not enough random data available to satisfy the length + requested by RNGValueLength. + @retval EFI_INVALID_PARAMETER RNGValue is NULL or RNGValueLength is zero. + +**/ +EFI_STATUS +EFIAPI +RngGetRNG ( + IN EFI_RNG_PROTOCOL *This, + IN EFI_RNG_ALGORITHM *RNGAlgorithm, OPTIONAL + IN UINTN RNGValueLength, + OUT UINT8 *RNGValue + ) +{ + UINTN Count, Length; + UINT64 TmpVal64; + EFI_STATUS Status = EFI_UNSUPPORTED; + + if ((RNGValueLength == 0) || (RNGValue == NULL)) { + return EFI_INVALID_PARAMETER; + } + + if (RNGAlgorithm == NULL) { + /* + * Use the default RNG algorithm if RNGAlgorithm is NULL. + */ + RNGAlgorithm = &gEfiRngAlgorithmRaw; + } + + if (CompareGuid (RNGAlgorithm, &gEfiRngAlgorithmRaw)) { + /* FIXME: Linux kernel only passes 64bits which violate UEFI Spec */ + /* + * When a DRBG is used on the output of a entropy source, + * its security level must be at least 256 bits according to UEFI Spec. + */ + /*if (RNGValueLength < 32) { + return EFI_INVALID_PARAMETER; + }*/ + + for (Count = 0; Count < (RNGValueLength / sizeof (TmpVal64)) + 1; Count++) { + Length = sizeof (TmpVal64); + if (Count == (RNGValueLength / sizeof (TmpVal64))) { + Length = RNGValueLength % sizeof (TmpVal64); + } + + if (Length != 0) { + Status = SMProRNGRead ((UINT8 *)&TmpVal64, sizeof (TmpVal64)); + if (EFI_ERROR (Status)) { + return EFI_NOT_READY; + } + CopyMem (RNGValue + Count * sizeof (TmpVal64), &TmpVal64, Length); + } + } + Status = EFI_SUCCESS; + } + + return Status; +} + +/* + * The Random Number Generator (RNG) protocol + */ +EFI_RNG_PROTOCOL mRng = { + RngGetInfo, + RngGetRNG +}; + +/** + The user Entry Point for the Random Number Generator (RNG) driver. + + @param[in] ImageHandle The firmware allocated handle for the EFI image. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval EFI_NOT_SUPPORTED Platform does not support RNG. + @retval Other Some error occurs when executing this entry point. + +**/ +EFI_STATUS +EFIAPI +RngDriverEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + + // + // Install UEFI RNG (Random Number Generator) Protocol + // + Handle = NULL; + Status = gBS->InstallMultipleProtocolInterfaces ( + &Handle, + &gEfiRngProtocolGuid, + &mRng, + NULL + ); + + return Status; +} diff --git a/Silicon/Ampere/Drivers/RngDxe/RngDxe.uni b/Silicon/Ampere/Drivers/RngDxe/RngDxe.uni new file mode 100644 index 000000000000..3f3b48f2036a --- /dev/null +++ b/Silicon/Ampere/Drivers/RngDxe/RngDxe.uni @@ -0,0 +1,10 @@ +// +// Copyright (c) 2020, Ampere Computing LLC. All rights reserved.
+// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// + + +#string STR_MODULE_ABSTRACT #language en-US "Produces UEFI Random Number Generator protocol" + +#string STR_MODULE_DESCRIPTION #language en-US "This module will produce UEFI Random Number Generator protocol." diff --git a/Silicon/Ampere/Drivers/RngDxe/RngDxeExtra.uni b/Silicon/Ampere/Drivers/RngDxe/RngDxeExtra.uni new file mode 100644 index 000000000000..f629e4b65e75 --- /dev/null +++ b/Silicon/Ampere/Drivers/RngDxe/RngDxeExtra.uni @@ -0,0 +1,9 @@ +// +// Copyright (c) 2020, Ampere Computing LLC. All rights reserved.
+// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// + +#string STR_PROPERTIES_MODULE_NAME +#language en-US +"Ampere UEFI Random Number Generator DXE" -- 2.17.1