From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.127]) by mx.groups.io with SMTP id smtpd.web09.5185.1635932425220901364 for ; Wed, 03 Nov 2021 02:40:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=iVQT/h/8; spf=pass (domain: os.amperecomputing.com, ip: 40.107.237.127, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BJjhIYuuGXhihUt9tzN3Io8y5zukyQrspOzaSBHFdv54J3pkxq+G930/HYSGq+dqsoeHhjDJJP/q6FFF/5/MRASg4eVI0vXO7/zfia13BdOGg0c0uzgmEUGOdEfYZf1ZDy9vGH2+OZN/zcLz8v6CWsulM/BZnfV66NnV6FZppf9d3E9MHc9hpOah8N27isTKVdpQ0v4kcSyAJt+yfI4Vp/fVVpA4rXcvKHxYBqAinZD0OP9Y/2SBIpZe0JbgiKcOMyekgYPKCXB4SU0UQm1PiCxjvP0JeZ1PqVdiDb43zi03tDju6praBy19ezg5x4bT5DEhuAPGinbhmdsf95VbNw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RmOsqz5aSDKgWhve+hAgDvMWsBfHruFo3lLy9i536VE=; b=O8ILllz+slk0obYls/7lQPDK3MQRH+VZwKOc7R+Ic5lAZYD7OdBV6m0wp4CHc0K5RY3ZX+er+pin3HVe8DyScE+049qLm7Ndm9sw8qnuSZA/hJKQ9pfuHPonekeGJbddmQbg++w4q36r6kJRO75i7yJ1gZD6RMKcR/NmhLj5/dgoHtb+KcnEVbAXCcxDH0z8WAF0dNu6Int+zE4KpcqKggR3IfU6znBc7wNVGAdMMaOv8R+gompMA8i0w8NfY+zuxQ2nYQ1j5gbwa6PrOPHZrbWXpSEhds36sA4vgCZ1Bb3fFfLOL+ahNE/M4eWGkxaG7y7WZmPFkwXgoEXasTMJTA== 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=RmOsqz5aSDKgWhve+hAgDvMWsBfHruFo3lLy9i536VE=; b=iVQT/h/8u8e+Xaz8vuevp1Z1rkpfL2YcTSqFxQIMA6IRUpktkYgXdZe8UR0C/cODMUDJGW+luwhHa0h39L6eidEXRaqNjBdXyBdhyFjc+p4VsGW23fQ013s+RNvLmvZ8afsRo5Z/kwxv6BvSM8oVAZZd3iEJhLMYA4RaiHxx2gs= Authentication-Results: nuviainc.com; dkim=none (message not signed) header.d=none;nuviainc.com; dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by PH0PR01MB7333.prod.exchangelabs.com (2603:10b6:510:dd::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 3 Nov 2021 09:40:23 +0000 Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::254c:9533:7f35:aee]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::254c:9533:7f35:aee%5]) with mapi id 15.20.4669.011; Wed, 3 Nov 2021 09:40:23 +0000 Message-ID: Date: Wed, 3 Nov 2021 16:36:25 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [edk2-platforms][PATCH v4 31/31] AmpereAltraPkg: Add configuration screen for Watchdog timer To: Leif Lindholm Cc: devel@edk2.groups.io, patches@amperecomputing.com, vunguyen@os.amperecomputing.com, Thang Nguyen , Chuong Tran , Phong Vo , Michael D Kinney , Ard Biesheuvel , Nate DeSimone References: <20211022061809.31087-1-nhi@os.amperecomputing.com> <20211022061809.31087-32-nhi@os.amperecomputing.com> <20211026130316.jom3friceqnky6qp@leviathan> From: "Nhi Pham" In-Reply-To: <20211026130316.jom3friceqnky6qp@leviathan> X-ClientProxiedBy: HKAPR03CA0004.apcprd03.prod.outlook.com (2603:1096:203:c8::9) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 Received: from [192.168.1.3] (113.188.173.157) by HKAPR03CA0004.apcprd03.prod.outlook.com (2603:1096:203:c8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.5 via Frontend Transport; Wed, 3 Nov 2021 09:40:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3b775e2d-8578-49ab-bbbf-08d99eadf51e X-MS-TrafficTypeDiagnostic: PH0PR01MB7333: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YnJzOg5wvFPsRTY3amQvjQdHW7nQwr2GLjWEcB4Ft7p3UIn3xrD05yzXUvNDiW16G+hUjwbIPRdyEZ0T6FMTfoJBMG93DECoOxBnT0gRVuUloFDHyusCESI6yvYVeaW996KuLMPpC1sauK8VRus4h7USClQ54HMYwxNjgU3f1+1UfO01qKlVVnMZnAXFAZlqHLyTzetGfKpZwJ2ENiZsu0mDTLJoLramFBNI//Ep7WXBXQlyoOdcS//9sWyASvW9i2JTTh/+Tm1fWNo8jZglwiXe5S7uXcpRRFBybrTd62bisLrdjtbwJ+oBUxG6Ez19URJJfBIIwdH0b+Mjl/c8ygoPwNtYgUZ4ROVe/0IygEjrXXKpBxYiIogevVVyhEOc8I9j4W68WRMBE+AT5XWKcpLzzTLRImhrUQnr55wqkty/cLGdRnRq1pDxMG1z18MUecpyBAPpXoMuhlzADZp073JNz108LyEESSid1LlbOJQVjfPd2hZ8FPyAkhW9NrJvHGZQFETMqkHebv/j0BatQf6IUAlFt2EOsWDkLKEKo/AF9m2siQoGXv9liBkRs75BVaLMdFsCpNhyhtj77jdG4Yq5tF+cdZq4BMND8wvuzhARU3cFyPmM4PUuXcrGp9FzxfsqShWR30dXklHmwQ1ZCt7wg6NmEb44FNme8yx6cqAcCxaUpn4iYlUJBpA7Ui3N7iwMqwLu4m58An5p30ALBE7stI5e8YFinyztfhaza46XsF/LX1nRQ1HNgJKl9sdFl2Omt3rHH4/KUB0K5MZtCfAIziNwkGWnEiLMi6DqlRVkbhYtryqg4vtB45WzAHdI7lhjkDdKs6HCPU4XMDmixLnq+WlfQrZwOYe2Tp2oXF+46I0Rph21fXCgtoyDfWTY X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7287.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(6666004)(30864003)(38350700002)(66946007)(2906002)(2616005)(86362001)(38100700002)(52116002)(6486002)(53546011)(16576012)(186003)(54906003)(8676002)(5660300002)(508600001)(316002)(31696002)(83380400001)(66476007)(31686004)(66556008)(26005)(6916009)(66574015)(4326008)(956004)(8936002)(290074003)(9186005)(171213001)(45980500001)(43740500002)(44824005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RSsxUlAybGxyTk1oSmNQYkZSMUprU2Q5ZUJ0dTM5a0IxdnZ5V08xZkdmUE1I?= =?utf-8?B?YlBDMXdTaGNSeXZBRWJhMlptR1JFTFBDcWhyRzRsWTk4SVFVcVU4VlQ3YWla?= =?utf-8?B?eTF6UkdOVFl5ZjZVdlVraG9DWG9Pdk5IQmlWNEI2b0FmblJoRkxOZDJBNXdY?= =?utf-8?B?a0dxWGpNSG55RFVqVnRxOHFkaXY2cEFKNVlqSXBCalRJVFVIWUl4aEU0SExF?= =?utf-8?B?dU5RdDNIRGwrWmJNU0JHZkpzU1pJVXQ5aEx4cHVHYThjREYwdTdkdW8venhE?= =?utf-8?B?d1Nsd2xWZk1rRmtJZERSZFZQWHd0WmlScmxCMHd5ZkUxeVVsNWZIbTlkSHBL?= =?utf-8?B?eHk5UG5LODRhV2traVVCdlFlTDhGZ2x5bGFLb0k5b085dG9pY3l6ay9lVTk3?= =?utf-8?B?Wkgvamx6dUxUR2doU0NUcGxDVTEvMHFyaTl3NmJqS01UY2lFOGhRdi9WS1JO?= =?utf-8?B?Q243bU8wRGswbmVwOHRWUTBWYyt1NkJKeTg2UGxVYjRwcWVrSzBFWk5ISEYz?= =?utf-8?B?eG5vNDhva0pIQkM3dytqS1dPRE1SNHdGK3hYSDlvRmFndzM0WllNZ3NjTUpq?= =?utf-8?B?emxSUHJlZ0I2cTdpZC85K24yd2djMGcxYXdERFZPaFZQeGVjbXpGL01GZVVB?= =?utf-8?B?RUpUQnJ4TGhWbmQ5NzNsQzJncWNUVGRPRERlbHpRaGlmK3dmRksrWSszQk84?= =?utf-8?B?Y1VCMVRya2wxNnlLVjBOVEtzbTdNbkczMXEzMkNITVhVakRUUHcrNU52Z25T?= =?utf-8?B?ajNiVFlPWk9Mb3NTUTVaUU9tczBJVi9QWVBtMW5BR2RTYS9HYnA0ZEVGeE5p?= =?utf-8?B?SnNyUWlXWU90R2tVS3hsV21VK09WUEpXaTM1ZGRyWjFhNlIwNitLSkpnSFEr?= =?utf-8?B?ZngzdXZMSERIcG1xTkdrYnlvaHY1Y1o2RzJacWR6YXBhOXVyTFVleTZ4c1RI?= =?utf-8?B?dGorbm5TUUxUTnllNUtrTUFuL3FGaUYwaStSZHRZb1kwYytKM0VNNmFuTzhQ?= =?utf-8?B?elhwaFlYbjNzWUFZOHE1VXFVSWJvVjAwbzJSRFlHU1hHZGQ5UXZmZXYxQjFl?= =?utf-8?B?MHV1M2VZTWlxRi94dTJ1ZUJHNDBvRHRQQWsxcnplWnZ5QWRlL3dvRC82UjJC?= =?utf-8?B?TjJpZXc1VmNvSWhndURUeC81RnpZSUd4YWYvQXp4NnBOUW9RbElwbEhabWZo?= =?utf-8?B?V2N0cHhFMU5Yb3dsZ2hUQldCV1hQSk5Ia3JiUmQ5VzQyWnh0SWJyQmxOYXJR?= =?utf-8?B?QjdMcVV2T01WY3pneGxjNWZ1V1MvOVZ5Yk5iMzZaK0ZHOE1IeE1tY1dXeHVr?= =?utf-8?B?bFNjVmN3N2xmaXZ1eFE1bkZOODU3VFc5Y05SVzhZMDhlVmowOU9SamhHdVBP?= =?utf-8?B?MzYzUUFpZUxPTStQQkZXbTllT3Vvd25CUXpUelFUYlN5QjBSbnRzSTYwZHh5?= =?utf-8?B?V1M1Mlc1NFBwejZKYUd3T1JsYVRFNWR5SzBFckEzV2JrVm5ZMEl2em5CSEFV?= =?utf-8?B?d2p0MWZSOTNHKzZ1ckEvVEhiZU1GMU1hcWxYNXVCTVdhK25UbVFZWEtlbUJO?= =?utf-8?B?UDFIeDJzMXlNVG5JVlVVdDlxVXlxdm5jV2IrRmJqa3F0WGNTc3lURTd1VXpn?= =?utf-8?B?L1NjU29NV0t2S3NMTVZ3bVc3TTlUSVFWUll3RnFDclhMS0tTYWp6MVc2TDNh?= =?utf-8?B?ZmgvZzdFbnd0RWhkWTVPUkx0a3A0WjNvUkFrUDRlb0pIQjl2czFBenczMmhy?= =?utf-8?B?cDRSNFVuTWs5V2V3b3pIclJidlRLTmk2cWdmVmh5NTRJelZieFlLajI3TVdU?= =?utf-8?B?bC96NlhJeUFLcWlldDVWZzQ2VGNBZ051aG5lNmM3OEw1M0dYRHMvYUMzb29W?= =?utf-8?B?RG45WGtnQmhoQUxaTjFVVEVmSUh0LzlmTktaZVdZT0IxaVJVeWUrUUVzcG5o?= =?utf-8?B?bGRQRVE3cDBLKzVCWHpyTnhER1RkMm1vUDljTjR3aWtKS0lPcEJOakFPSGlD?= =?utf-8?B?cFdDTDVycGVDQkxZN3lDQlNtWjg3UnE1empXKzdkNXJjMHArbWlCaytJdjUv?= =?utf-8?B?WUJBVXU2aWNnbGVsVEJMK2szTjBMczBjZW81WHdhaFNMdUdSR01TOU5MMzcz?= =?utf-8?B?VGN2M0ZpVE8zQ2RtbXBjR1d6ZHpQaWQrWHk0U2lWSndzUU1OMG9WV0VhY1lV?= =?utf-8?B?b2V2RUQyQ252S1JOa0tTWDBqUGgvVm9ZTS9FZ1FTMUNlZWpKaTRKYXFOVE0y?= =?utf-8?Q?XLdPjvqPDyDv1V5Cof2BH1JL9P1IRrDevFh69mItNI=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b775e2d-8578-49ab-bbbf-08d99eadf51e X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 09:40:23.2322 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TgW+eKCSX4f9UDMffZ0o59ActoH+vjXDxSie2Oa0ZCZozbklLFvXbi3IZr4aMlfmQ5foAtdrmWmKViStHEX8RvP32/Vo//02/r9CT3SMGOk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7333 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 26/10/2021 20:03, Leif Lindholm wrote: > On Fri, Oct 22, 2021 at 13:18:09 +0700, Nhi Pham wrote: >> From: Vu Nguyen >> >> There are secure and non-secure watchdog timers supported in the Mt. >> Jade system. They are used to monitor the system booting like system >> firmware, UEFI, and OS. The system will be reset if the timer expires. >> So, this patch adds the configuration screen for the watchdog timer >> which provides options to configure the timeout of these timers. >> >> By default, the values of these options are 5 minutes. >> >> Cc: Thang Nguyen >> Cc: Chuong Tran >> Cc: Phong Vo >> Cc: Leif Lindholm >> Cc: Michael D Kinney >> Cc: Ard Biesheuvel >> Cc: Nate DeSimone >> >> Signed-off-by: Nhi Pham > I don't think my comments about FailSafeDxe have an impact on this. I will remove the Timeout setting for UEFI WDT option as it is not available when removing the FailSafe. Thanks, Nhi > If you disagree, we can discuss, but I think I can give this one > Acked-by: Leif Lindholm > in its current state regardless of the outcome of my feedback on the > earlier patch. > > / > Leif > >> --- >> Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec | 3 + >> Platform/Ampere/JadePkg/Jade.dsc | 1 + >> Platform/Ampere/JadePkg/Jade.fdf | 1 + >> Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.inf | 50 +++ >> Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.h | 73 +++ >> Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigNVDataStruct.h | 27 ++ >> Silicon/Ampere/AmpereAltraPkg/Include/Guid/WatchdogConfigHii.h | 19 + >> Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigVfr.vfr | 58 +++ >> Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.c | 470 ++++++++++++++++++++ >> Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigStrings.uni | 26 ++ >> 10 files changed, 728 insertions(+) >> >> diff --git a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec >> index d795c9229691..d43bf1a6f296 100644 >> --- a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec >> +++ b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec >> @@ -70,3 +70,6 @@ [Guids] >> >> ## Include/Guid/AcpiConfigHii.h >> gAcpiConfigFormSetGuid = { 0x0ceb6764, 0xd415, 0x4b01, { 0xa8, 0x43, 0xd1, 0x01, 0xbc, 0xb0, 0xd8, 0x29 } } >> + >> + ## Include/Guid/WatchdogConfigHii.h >> + gWatchdogConfigFormSetGuid = { 0xC3F8EC6E, 0x95EE, 0x460C, { 0xA4, 0x8D, 0xEA, 0x54, 0x2F, 0xFF, 0x01, 0x61 } } >> diff --git a/Platform/Ampere/JadePkg/Jade.dsc b/Platform/Ampere/JadePkg/Jade.dsc >> index 980f431fc4de..eea3eec7f529 100644 >> --- a/Platform/Ampere/JadePkg/Jade.dsc >> +++ b/Platform/Ampere/JadePkg/Jade.dsc >> @@ -191,3 +191,4 @@ [Components.common] >> Silicon/Ampere/AmpereAltraPkg/Drivers/CpuConfigDxe/CpuConfigDxe.inf >> Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.inf >> Silicon/Ampere/AmpereAltraPkg/Drivers/RasConfigDxe/RasConfigDxe.inf >> + Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.inf >> diff --git a/Platform/Ampere/JadePkg/Jade.fdf b/Platform/Ampere/JadePkg/Jade.fdf >> index 1743c12dd68e..1a2b172cb776 100644 >> --- a/Platform/Ampere/JadePkg/Jade.fdf >> +++ b/Platform/Ampere/JadePkg/Jade.fdf >> @@ -361,5 +361,6 @@ [FV.FvMain] >> INF Silicon/Ampere/AmpereAltraPkg/Drivers/CpuConfigDxe/CpuConfigDxe.inf >> INF Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.inf >> INF Silicon/Ampere/AmpereAltraPkg/Drivers/RasConfigDxe/RasConfigDxe.inf >> + INF Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.inf >> >> !include Silicon/Ampere/AmpereSiliconPkg/FvRules.fdf.inc >> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.inf b/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.inf >> new file mode 100644 >> index 000000000000..3ed37bfb15da >> --- /dev/null >> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.inf >> @@ -0,0 +1,50 @@ >> +## @file >> +# >> +# Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
>> +# >> +# SPDX-License-Identifier: BSD-2-Clause-Patent >> +# >> +## >> + >> +[Defines] >> + INF_VERSION = 0x0001001B >> + BASE_NAME = WatchdogConfigDxe >> + FILE_GUID = 135A0CA5-4851-4EF5-9E1A-C6E4610C39A9 >> + MODULE_TYPE = DXE_DRIVER >> + VERSION_STRING = 1.0 >> + ENTRY_POINT = WatchdogConfigInitialize >> + >> +[Sources.common] >> + WatchdogConfigNVDataStruct.h >> + WatchdogConfigVfr.vfr >> + WatchdogConfigStrings.uni >> + WatchdogConfigDxe.c >> + WatchdogConfigDxe.h >> + >> +[Packages] >> + MdeModulePkg/MdeModulePkg.dec >> + MdePkg/MdePkg.dec >> + Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec >> + Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec >> + >> +[LibraryClasses] >> + BaseLib >> + DebugLib >> + DevicePathLib >> + HiiLib >> + NVParamLib >> + PrintLib >> + UefiBootServicesTableLib >> + UefiDriverEntryPoint >> + >> +[Guids] >> + gPlatformManagerFormsetGuid >> + gWatchdogConfigFormSetGuid >> + >> +[Protocols] >> + gEfiDevicePathProtocolGuid ## CONSUMES >> + gEfiHiiConfigRoutingProtocolGuid ## CONSUMES >> + gEfiHiiConfigAccessProtocolGuid ## PRODUCES >> + >> +[Depex] >> + TRUE >> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.h b/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.h >> new file mode 100644 >> index 000000000000..95fc6c8f6269 >> --- /dev/null >> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.h >> @@ -0,0 +1,73 @@ >> +/** @file >> + >> + Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
>> + >> + SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#ifndef WATCHDOG_CONFIG_DXE_H_ >> +#define WATCHDOG_CONFIG_DXE_H_ >> + >> +#include >> + >> +#include >> +#include >> + >> +#include "WatchdogConfigNVDataStruct.h" >> + >> +// >> +// This is the generated IFR binary data for each formset defined in VFR. >> +// >> +extern UINT8 WatchdogConfigVfrBin[]; >> + >> +// >> +// This is the generated String package data for all .UNI files. >> +// >> +extern UINT8 WatchdogConfigDxeStrings[]; >> + >> +#define WATCHDOG_CONFIG_PRIVATE_SIGNATURE SIGNATURE_32 ('W', 'D', 'T', 'C') >> + >> +typedef struct { >> + UINTN Signature; >> + >> + EFI_HANDLE DriverHandle; >> + EFI_HII_HANDLE HiiHandle; >> + WATCHDOG_CONFIG_VARSTORE_DATA Configuration; >> + >> + // >> + // Consumed protocol >> + // >> + EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; >> + >> + // >> + // Produced protocol >> + // >> + EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess; >> +} WATCHDOG_CONFIG_PRIVATE_DATA; >> + >> +#define WATCHDOG_CONFIG_PRIVATE_FROM_THIS(a) CR (a, WATCHDOG_CONFIG_PRIVATE_DATA, ConfigAccess, WATCHDOG_CONFIG_PRIVATE_SIGNATURE) >> + >> +#pragma pack(1) >> + >> +/// >> +/// HII specific Vendor Device Path definition. >> +/// >> +typedef struct { >> + VENDOR_DEVICE_PATH VendorDevicePath; >> + EFI_DEVICE_PATH_PROTOCOL End; >> +} HII_VENDOR_DEVICE_PATH; >> + >> +#pragma pack() >> + >> +EFI_STATUS >> +WatchdogConfigNvParamSet ( >> + IN WATCHDOG_CONFIG_VARSTORE_DATA *VarStoreConfig >> + ); >> + >> +EFI_STATUS >> +WatchdogConfigNvParamGet ( >> + OUT WATCHDOG_CONFIG_VARSTORE_DATA *VarStoreConfig >> + ); >> + >> +#endif /* WATCHDOG_CONFIG_DXE_H_ */ >> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigNVDataStruct.h b/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigNVDataStruct.h >> new file mode 100644 >> index 000000000000..470a2821ffe7 >> --- /dev/null >> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigNVDataStruct.h >> @@ -0,0 +1,27 @@ >> +/** @file >> + >> + Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
>> + >> + SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#ifndef WATCHDOG_CONFIG_NV_DATA_STRUCT_H_ >> +#define WATCHDOG_CONFIG_NV_DATA_STRUCT_H_ >> + >> +#include >> + >> +#define WATCHDOG_CONFIG_VARSTORE_ID 0x1234 >> +#define WATCHDOG_CONFIG_FORM_ID 0x1235 >> + >> +#define NWDT_UEFI_DEFAULT_VALUE 300 // 5 minutes >> +#define SWDT_DEFAULT_VALUE 300 // 5 minutes >> + >> +#pragma pack(1) >> +typedef struct { >> + UINT32 WatchdogTimerUEFITimeout; >> + UINT32 SecureWatchdogTimerTimeout; >> +} WATCHDOG_CONFIG_VARSTORE_DATA; >> +#pragma pack() >> + >> +#endif /* WATCHDOG_CONFIG_NV_DATA_STRUCT_H_ */ >> diff --git a/Silicon/Ampere/AmpereAltraPkg/Include/Guid/WatchdogConfigHii.h b/Silicon/Ampere/AmpereAltraPkg/Include/Guid/WatchdogConfigHii.h >> new file mode 100644 >> index 000000000000..16319d61a759 >> --- /dev/null >> +++ b/Silicon/Ampere/AmpereAltraPkg/Include/Guid/WatchdogConfigHii.h >> @@ -0,0 +1,19 @@ >> +/** @file >> + >> + Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
>> + >> + SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#ifndef WATCHDOG_CONFIG_HII_H_ >> +#define WATCHDOG_CONFIG_HII_H_ >> + >> +#define WATCHDOG_CONFIG_FORMSET_GUID \ >> + { \ >> + 0xC3F8EC6E, 0x95EE, 0x460C, { 0xA4, 0x8D, 0xEA, 0x54, 0x2F, 0xFF, 0x01, 0x61 } \ >> + } >> + >> +extern EFI_GUID gWatchdogConfigFormSetGuid; >> + >> +#endif /* WATCHDOG_CONFIG_HII_H_ */ >> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigVfr.vfr b/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigVfr.vfr >> new file mode 100644 >> index 000000000000..48f2aef227f6 >> --- /dev/null >> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigVfr.vfr >> @@ -0,0 +1,58 @@ >> +/** @file >> + >> + Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
>> + >> + SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#include "WatchdogConfigNVDataStruct.h" >> + >> +formset >> + guid = WATCHDOG_CONFIG_FORMSET_GUID, >> + title = STRING_TOKEN(STR_WATCHDOG_CONFIG_FORM), >> + help = STRING_TOKEN(STR_WATCHDOG_CONFIG_FORM_HELP), >> + classguid = gPlatformManagerFormsetGuid, >> + >> + // >> + // Define a variable Storage >> + // >> + varstore WATCHDOG_CONFIG_VARSTORE_DATA, >> + varid = WATCHDOG_CONFIG_VARSTORE_ID, >> + name = WatchdogConfigNVData, >> + guid = WATCHDOG_CONFIG_FORMSET_GUID; >> + >> + form >> + formid = WATCHDOG_CONFIG_FORM_ID, >> + title = STRING_TOKEN(STR_WATCHDOG_CONFIG_FORM); >> + subtitle text = STRING_TOKEN(STR_WATCHDOG_CONFIG_FORM_HELP); >> + >> + oneof varid = WatchdogConfigNVData.WatchdogTimerUEFITimeout, >> + prompt = STRING_TOKEN(STR_NWDT_TIMEOUT_UEFI), >> + help = STRING_TOKEN(STR_NWDT_TIMEOUT_UEFI_HELP), >> + flags = RESET_REQUIRED, >> + option text = STRING_TOKEN (STR_WDT_TIME_DISABLE), value = 0, flags = 0; >> + option text = STRING_TOKEN (STR_WDT_TIME_5MIN), value = 300, flags = 0; >> + option text = STRING_TOKEN (STR_WDT_TIME_6MIN), value = 360, flags = 0; >> + option text = STRING_TOKEN (STR_WDT_TIME_10MIN), value = 600, flags = 0; >> + option text = STRING_TOKEN (STR_WDT_TIME_15MIN), value = 900, flags = 0; >> + option text = STRING_TOKEN (STR_WDT_TIME_20MIN), value = 1200, flags = 0; >> + default = NWDT_UEFI_DEFAULT_VALUE, >> + endoneof; >> + >> + oneof varid = WatchdogConfigNVData.SecureWatchdogTimerTimeout, >> + prompt = STRING_TOKEN(STR_SWDT_TIMEOUT), >> + help = STRING_TOKEN(STR_SWDT_TIMEOUT_HELP), >> + flags = RESET_REQUIRED, >> + option text = STRING_TOKEN (STR_WDT_TIME_DISABLE), value = 0, flags = 0; >> + option text = STRING_TOKEN (STR_WDT_TIME_5MIN), value = 300, flags = 0; >> + option text = STRING_TOKEN (STR_WDT_TIME_6MIN), value = 360, flags = 0; >> + option text = STRING_TOKEN (STR_WDT_TIME_10MIN), value = 600, flags = 0; >> + option text = STRING_TOKEN (STR_WDT_TIME_15MIN), value = 900, flags = 0; >> + option text = STRING_TOKEN (STR_WDT_TIME_20MIN), value = 1200, flags = 0; >> + default = SWDT_DEFAULT_VALUE, >> + endoneof; >> + >> + endform; >> + >> +endformset; >> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.c b/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.c >> new file mode 100644 >> index 000000000000..004a605c2f21 >> --- /dev/null >> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigDxe.c >> @@ -0,0 +1,470 @@ >> +/** @file >> + >> + Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
>> + >> + SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include "WatchdogConfigDxe.h" >> + >> +CHAR16 WatchDogConfigVarstoreDataName[] = L"WatchdogConfigNVData"; >> + >> +EFI_HANDLE mDriverHandle = NULL; >> +WATCHDOG_CONFIG_PRIVATE_DATA *mPrivateData = NULL; >> + >> +HII_VENDOR_DEVICE_PATH mWatchdogConfigHiiVendorDevicePath = { >> + { >> + { >> + HARDWARE_DEVICE_PATH, >> + HW_VENDOR_DP, >> + { >> + (UINT8)(sizeof (VENDOR_DEVICE_PATH)), >> + (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8) >> + } >> + }, >> + WATCHDOG_CONFIG_FORMSET_GUID >> + }, >> + { >> + END_DEVICE_PATH_TYPE, >> + END_ENTIRE_DEVICE_PATH_SUBTYPE, >> + { >> + (UINT8)(END_DEVICE_PATH_LENGTH), >> + (UINT8)((END_DEVICE_PATH_LENGTH) >> 8) >> + } >> + } >> +}; >> + >> +EFI_STATUS >> +WatchdogConfigNvParamGet ( >> + OUT WATCHDOG_CONFIG_VARSTORE_DATA *VarStoreConfig >> + ) >> +{ >> + EFI_STATUS Status; >> + UINT32 Value; >> + BOOLEAN SetDefault; >> + >> + SetDefault = FALSE; >> + Status = NVParamGet ( >> + NV_SI_WDT_BIOS_EXP_MINS, >> + NV_PERM_ATF | NV_PERM_BIOS | NV_PERM_MANU | NV_PERM_BMC, >> + &Value >> + ); >> + if (EFI_ERROR (Status)) { >> + VarStoreConfig->WatchdogTimerUEFITimeout = NWDT_UEFI_DEFAULT_VALUE; >> + if (Status == EFI_NOT_FOUND) { >> + SetDefault = TRUE; >> + } else { >> + ASSERT (FALSE); >> + } >> + } else { >> + VarStoreConfig->WatchdogTimerUEFITimeout = Value * 60; >> + } >> + >> + Status = NVParamGet ( >> + NV_SI_SEC_WDT_BIOS_EXP_MINS, >> + NV_PERM_ATF | NV_PERM_BIOS | NV_PERM_MANU | NV_PERM_BMC, >> + &Value >> + ); >> + if (EFI_ERROR (Status)) { >> + VarStoreConfig->SecureWatchdogTimerTimeout = SWDT_DEFAULT_VALUE; >> + if (Status == EFI_NOT_FOUND) { >> + SetDefault = TRUE; >> + } else { >> + ASSERT (FALSE); >> + } >> + } else { >> + VarStoreConfig->SecureWatchdogTimerTimeout = Value; >> + } >> + >> + if (SetDefault) { >> + WatchdogConfigNvParamSet (VarStoreConfig); >> + } >> + >> + return EFI_SUCCESS; >> +} >> + >> +EFI_STATUS >> +WatchdogConfigNvParamSet ( >> + IN WATCHDOG_CONFIG_VARSTORE_DATA *VarStoreConfig >> + ) >> +{ >> + EFI_STATUS Status; >> + UINT32 Value; >> + >> + Status = NVParamGet ( >> + NV_SI_WDT_BIOS_EXP_MINS, >> + NV_PERM_ATF | NV_PERM_BIOS | NV_PERM_MANU | NV_PERM_BMC, >> + &Value >> + ); >> + if (EFI_ERROR (Status) >> + || Value != (VarStoreConfig->WatchdogTimerUEFITimeout / 60)) >> + { >> + Status = NVParamSet ( >> + NV_SI_WDT_BIOS_EXP_MINS, >> + NV_PERM_ATF | NV_PERM_BIOS | NV_PERM_MANU | NV_PERM_BMC, >> + NV_PERM_BIOS | NV_PERM_MANU, >> + (VarStoreConfig->WatchdogTimerUEFITimeout / 60) >> + ); >> + if (EFI_ERROR (Status)) { >> + return Status; >> + } >> + } >> + >> + Status = NVParamGet ( >> + NV_SI_SEC_WDT_BIOS_EXP_MINS, >> + NV_PERM_ATF | NV_PERM_BIOS | NV_PERM_MANU | NV_PERM_BMC, >> + &Value >> + ); >> + if (EFI_ERROR (Status) >> + || Value != VarStoreConfig->SecureWatchdogTimerTimeout) >> + { >> + Status = NVParamSet ( >> + NV_SI_SEC_WDT_BIOS_EXP_MINS, >> + NV_PERM_ATF | NV_PERM_BIOS | NV_PERM_MANU | NV_PERM_BMC, >> + NV_PERM_BIOS | NV_PERM_MANU, >> + VarStoreConfig->SecureWatchdogTimerTimeout >> + ); >> + if (EFI_ERROR (Status)) { >> + return Status; >> + } >> + } >> + >> + return EFI_SUCCESS; >> +} >> + >> +/** >> + This function allows a caller to extract the current configuration for one >> + or more named elements from the target driver. >> + >> + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. >> + @param Request A null-terminated Unicode string in >> + format. >> + @param Progress On return, points to a character in the Request >> + string. Points to the string's null terminator if >> + request was successful. Points to the most recent >> + '&' before the first failing name/value pair (or >> + the beginning of the string if the failure is in >> + the first name/value pair) if the request was not >> + successful. >> + @param Results A null-terminated Unicode string in >> + format which has all values filled >> + in for the names in the Request string. String to >> + be allocated by the called function. >> + >> + @retval EFI_SUCCESS The Results is filled with the requested values. >> + @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results. >> + @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name. >> + @retval EFI_NOT_FOUND Routing data doesn't match any storage in this >> + driver. >> + >> +**/ >> +EFI_STATUS >> +EFIAPI >> +WatchdogConfigExtractConfig ( >> + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, >> + IN CONST EFI_STRING Request, >> + OUT EFI_STRING *Progress, >> + OUT EFI_STRING *Results >> + ) >> +{ >> + EFI_STATUS Status; >> + UINTN BufferSize; >> + WATCHDOG_CONFIG_PRIVATE_DATA *PrivateData; >> + EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; >> + EFI_STRING ConfigRequest; >> + EFI_STRING ConfigRequestHdr; >> + UINTN Size; >> + BOOLEAN AllocatedRequest; >> + >> + if (Progress == NULL || Results == NULL) { >> + return EFI_INVALID_PARAMETER; >> + } >> + >> + // >> + // Initialize the local variables. >> + // >> + ConfigRequestHdr = NULL; >> + ConfigRequest = NULL; >> + Size = 0; >> + *Progress = Request; >> + AllocatedRequest = FALSE; >> + >> + if ((Request != NULL) && !HiiIsConfigHdrMatch (Request, &gWatchdogConfigFormSetGuid, WatchDogConfigVarstoreDataName)) { >> + return EFI_NOT_FOUND; >> + } >> + >> + PrivateData = WATCHDOG_CONFIG_PRIVATE_FROM_THIS (This); >> + HiiConfigRouting = PrivateData->HiiConfigRouting; >> + >> + // >> + // Get current setting from NVParam. >> + // >> + Status = WatchdogConfigNvParamGet (&PrivateData->Configuration); >> + if (EFI_ERROR (Status)) { >> + return Status; >> + } >> + >> + // >> + // Convert buffer data to by helper function BlockToConfig() >> + // >> + BufferSize = sizeof (WATCHDOG_CONFIG_VARSTORE_DATA); >> + ConfigRequest = Request; >> + if ((Request == NULL) || (StrStr (Request, L"OFFSET") == NULL)) { >> + // >> + // Request has no request element, construct full request string. >> + // Allocate and fill a buffer large enough to hold the template >> + // followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator >> + // >> + ConfigRequestHdr = HiiConstructConfigHdr (&gWatchdogConfigFormSetGuid, WatchDogConfigVarstoreDataName, PrivateData->DriverHandle); >> + Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16); >> + ConfigRequest = AllocateZeroPool (Size); >> + ASSERT (ConfigRequest != NULL); >> + if (ConfigRequest == NULL) { >> + return EFI_OUT_OF_RESOURCES; >> + } >> + AllocatedRequest = TRUE; >> + UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize); >> + FreePool (ConfigRequestHdr); >> + } >> + >> + // >> + // Convert buffer data to by helper function BlockToConfig() >> + // >> + Status = HiiConfigRouting->BlockToConfig ( >> + HiiConfigRouting, >> + ConfigRequest, >> + (UINT8 *)&PrivateData->Configuration, >> + BufferSize, >> + Results, >> + Progress >> + ); >> + >> + // >> + // Free the allocated config request string. >> + // >> + if (AllocatedRequest) { >> + FreePool (ConfigRequest); >> + ConfigRequest = NULL; >> + } >> + >> + // >> + // Set Progress string to the original request string. >> + // >> + if (Request == NULL) { >> + *Progress = NULL; >> + } else if (StrStr (Request, L"OFFSET") == NULL) { >> + *Progress = Request + StrLen (Request); >> + } >> + >> + return Status; >> +} >> + >> +/** >> + This function processes the results of changes in configuration. >> + >> + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. >> + @param Configuration A null-terminated Unicode string in >> + format. >> + @param Progress A pointer to a string filled in with the offset of >> + the most recent '&' before the first failing >> + name/value pair (or the beginning of the string if >> + the failure is in the first name/value pair) or >> + the terminating NULL if all was successful. >> + >> + @retval EFI_SUCCESS The Results is processed successfully. >> + @retval EFI_INVALID_PARAMETER Configuration is NULL. >> + @retval EFI_NOT_FOUND Routing data doesn't match any storage in this >> + driver. >> + >> +**/ >> +EFI_STATUS >> +EFIAPI >> +WatchdogConfigRouteConfig ( >> + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, >> + IN CONST EFI_STRING Configuration, >> + OUT EFI_STRING *Progress >> + ) >> +{ >> + EFI_STATUS Status; >> + UINTN BufferSize; >> + WATCHDOG_CONFIG_PRIVATE_DATA *PrivateData; >> + EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; >> + >> + if (Configuration == NULL || Progress == NULL) { >> + return EFI_INVALID_PARAMETER; >> + } >> + >> + PrivateData = WATCHDOG_CONFIG_PRIVATE_FROM_THIS (This); >> + HiiConfigRouting = PrivateData->HiiConfigRouting; >> + *Progress = Configuration; >> + >> + // >> + // Check routing data in . >> + // Note: if only one Storage is used, then this checking could be skipped. >> + // >> + if (!HiiIsConfigHdrMatch (Configuration, &gWatchdogConfigFormSetGuid, WatchDogConfigVarstoreDataName)) { >> + return EFI_NOT_FOUND; >> + } >> + >> + // >> + // Get configuration data from NVParam >> + // >> + Status = WatchdogConfigNvParamGet (&PrivateData->Configuration); >> + if (EFI_ERROR (Status)) { >> + return Status; >> + } >> + >> + // >> + // Convert to buffer data by helper function ConfigToBlock() >> + // >> + BufferSize = sizeof (WATCHDOG_CONFIG_VARSTORE_DATA); >> + Status = HiiConfigRouting->ConfigToBlock ( >> + HiiConfigRouting, >> + Configuration, >> + (UINT8 *)&PrivateData->Configuration, >> + &BufferSize, >> + Progress >> + ); >> + if (EFI_ERROR (Status)) { >> + return Status; >> + } >> + >> + // >> + // Store configuration data back to NVParam >> + // >> + Status = WatchdogConfigNvParamSet (&PrivateData->Configuration); >> + if (EFI_ERROR (Status)) { >> + return Status; >> + } >> + >> + return Status; >> +} >> + >> +/** >> + This function processes the results of changes in configuration. >> + >> + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. >> + @param Action Specifies the type of action taken by the browser. >> + @param QuestionId A unique value which is sent to the original >> + exporting driver so that it can identify the type >> + of data to expect. >> + @param Type The type of value for the question. >> + @param Value A pointer to the data being sent to the original >> + exporting driver. >> + @param ActionRequest On return, points to the action requested by the >> + callback function. >> + >> + @retval EFI_SUCCESS The callback successfully handled the action. >> + @retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters. >> + >> +**/ >> +EFI_STATUS >> +EFIAPI >> +WatchdogConfigCallback ( >> + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, >> + IN EFI_BROWSER_ACTION Action, >> + IN EFI_QUESTION_ID QuestionId, >> + IN UINT8 Type, >> + IN EFI_IFR_TYPE_VALUE *Value, >> + OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest >> + ) >> +{ >> + if (Action != EFI_BROWSER_ACTION_CHANGING) { >> + // >> + // Do nothing for other UEFI Action. Only do call back when data is changed. >> + // >> + return EFI_UNSUPPORTED; >> + } >> + if (((Value == NULL) >> + && (Action != EFI_BROWSER_ACTION_FORM_OPEN) >> + && (Action != EFI_BROWSER_ACTION_FORM_CLOSE)) >> + || (ActionRequest == NULL)) >> + { >> + return EFI_INVALID_PARAMETER; >> + } >> + >> + return EFI_SUCCESS; >> +} >> + >> +EFI_STATUS >> +WatchdogConfigInitialize ( >> + IN EFI_HANDLE ImageHandle, >> + IN EFI_SYSTEM_TABLE *SystemTable >> + ) >> +{ >> + EFI_STATUS Status; >> + EFI_HII_HANDLE HiiHandle; >> + EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; >> + >> + // >> + // Initialize driver private data >> + // >> + mPrivateData = AllocateZeroPool (sizeof (WATCHDOG_CONFIG_PRIVATE_DATA)); >> + if (mPrivateData == NULL) { >> + return EFI_OUT_OF_RESOURCES; >> + } >> + >> + mPrivateData->Signature = WATCHDOG_CONFIG_PRIVATE_SIGNATURE; >> + >> + mPrivateData->ConfigAccess.ExtractConfig = WatchdogConfigExtractConfig; >> + mPrivateData->ConfigAccess.RouteConfig = WatchdogConfigRouteConfig; >> + mPrivateData->ConfigAccess.Callback = WatchdogConfigCallback; >> + >> + // >> + // Locate ConfigRouting protocol >> + // >> + Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **)&HiiConfigRouting); >> + if (EFI_ERROR (Status)) { >> + return Status; >> + } >> + mPrivateData->HiiConfigRouting = HiiConfigRouting; >> + >> + Status = gBS->InstallMultipleProtocolInterfaces ( >> + &mDriverHandle, >> + &gEfiDevicePathProtocolGuid, >> + &mWatchdogConfigHiiVendorDevicePath, >> + &gEfiHiiConfigAccessProtocolGuid, >> + &mPrivateData->ConfigAccess, >> + NULL >> + ); >> + ASSERT_EFI_ERROR (Status); >> + >> + mPrivateData->DriverHandle = mDriverHandle; >> + >> + // >> + // Publish our HII data >> + // >> + HiiHandle = HiiAddPackages ( >> + &gWatchdogConfigFormSetGuid, >> + mDriverHandle, >> + WatchdogConfigDxeStrings, >> + WatchdogConfigVfrBin, >> + NULL >> + ); >> + if (HiiHandle == NULL) { >> + gBS->UninstallMultipleProtocolInterfaces ( >> + mDriverHandle, >> + &gEfiDevicePathProtocolGuid, >> + &mWatchdogConfigHiiVendorDevicePath, >> + &gEfiHiiConfigAccessProtocolGuid, >> + &mPrivateData->ConfigAccess, >> + NULL >> + ); >> + return EFI_OUT_OF_RESOURCES; >> + } >> + >> + mPrivateData->HiiHandle = HiiHandle; >> + >> + return EFI_SUCCESS; >> +} >> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigStrings.uni b/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigStrings.uni >> new file mode 100644 >> index 000000000000..1d0f820e456f >> --- /dev/null >> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/WatchdogConfigDxe/WatchdogConfigStrings.uni >> @@ -0,0 +1,26 @@ >> +// >> +// Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
>> +// >> +// SPDX-License-Identifier: BSD-2-Clause-Patent >> +// >> + >> +#langdef en-US "English" >> + >> +#string STR_WATCHDOG_CONFIG_FORM #language en-US "Watchdog Configuration" >> +#string STR_WATCHDOG_CONFIG_FORM_HELP #language en-US "Watchdog Configuration" >> + >> +#string STR_WDT_TIME_DISABLE #language en-US "Disabled" >> +#string STR_WDT_TIME_3MIN #language en-US "3 minutes" >> +#string STR_WDT_TIME_4MIN #language en-US "4 minutes" >> +#string STR_WDT_TIME_5MIN #language en-US "5 minutes" >> +#string STR_WDT_TIME_6MIN #language en-US "6 minutes" >> +#string STR_WDT_TIME_10MIN #language en-US "10 minutes" >> +#string STR_WDT_TIME_15MIN #language en-US "15 minutes" >> +#string STR_WDT_TIME_20MIN #language en-US "20 minutes" >> + >> +#string STR_NWDT_TIMEOUT_OS #language en-US "OS Watchdog Timeout" >> +#string STR_NWDT_TIMEOUT_OS_HELP #language en-US "Timeout when boot OS." >> +#string STR_NWDT_TIMEOUT_UEFI #language en-US "UEFI Watchdog Timeout" >> +#string STR_NWDT_TIMEOUT_UEFI_HELP #language en-US "Timeout when boot UEFI" >> +#string STR_SWDT_TIMEOUT #language en-US "Secure Watchdog Timeout" >> +#string STR_SWDT_TIMEOUT_HELP #language en-US "Timeout when SCP will reset system if it doesn't receive response from ARMv8." >> -- >> 2.17.1 >>