From patchwork Fri Feb 23 15:40:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 129395 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp744896lja; Fri, 23 Feb 2018 07:41:22 -0800 (PST) X-Google-Smtp-Source: AH8x225QyiQW9HP1z66Jt1ZtVOg8yjpA5YUqxTfbfNw9tfQfMBsyHHQ3/jRxPynsz0YKDJr2a/db X-Received: by 2002:a17:902:bcc6:: with SMTP id o6-v6mr2136423pls.16.1519400481963; Fri, 23 Feb 2018 07:41:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519400481; cv=none; d=google.com; s=arc-20160816; b=K1KNGMUpuVntQOx0xCpj6/5xhEgnyQ6H7WEEkpQ5bQwh7OscxWE9X7goQNVI4L+l6z wZ2dpHDRF0Q1LNEROLYKgNnXuS3jMRSv5RPsnPAAwEHTUtaSKywbLzEiBSdCZtruGYAs vaV4dHR6swvhz9uya41w51bPesOkisHo/6I1sS7g965c151HGwoBEntJBrzQQih9QYeW 61owUaB0GBM9Tt29ZcSWZ6Tvit32Xpnpe7NgcKi1NIUYRYBZyaoMaGrxQZlHbpWDkCYz bN+/Mn0SSnxkf8XXg7MJQreQJQZ8aMIMLKKQdj+FoL5oqmpCfwH2xoeVbaDJwvzSEUyQ I2eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=VoqkCkguxWAii4fVIKfjRCBKahHPybtYbz/92XhIPqo=; b=moFBbYY0OQKQ0unBYwIHbINI96Nv0H2tSObaDqKmzNitaMn1UIksUlbziE0HoyV1B1 a3iua+JlliX1+grrzmP2ljEgdbLz2ANMcpakuB0/ds+qP4/gJH+sbWaR0FdbPslLabKc /Km0FaLfX0taS12sY4E88bVpCvmJRuTdzeyts8JnSrOLbUXwffvRSuDhgPTtaUUrs5P3 VrRJRA3zSRl0zJ0MhV4iU6HC8eNivON+3jJwavVsTpZr5TsKZQ991jmV/u+5GoENufyG 0TKBl68AydOs2l8zwiIi/cCPEOlmv5UisDayeDoGY6Svsm1IgtE8JUciXPPKUTQD0g5z Fj8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=I6tUtHQI; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id y6-v6si1911364plk.705.2018.02.23.07.41.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 07:41:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=I6tUtHQI; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6D43E222630AE; Fri, 23 Feb 2018 07:35:18 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::241; helo=mail-wr0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A8AD321FD73F7 for ; Fri, 23 Feb 2018 07:35:14 -0800 (PST) Received: by mail-wr0-x241.google.com with SMTP id f14so14515202wre.8 for ; Fri, 23 Feb 2018 07:41:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gx2TwPY0zoLBprBpvispsMP1S0T3TDTaNNHwcFI4nEs=; b=I6tUtHQIov330G6k6otXmDlo3XBpNJGNDyPPjkrVb0lDWEH7uBytfxxvrVBGGLL7Xx QwiGcpo6gmIOpSADcQQ/OwpM2jB030suP8JIj2oNT2JVaA7XpXPNHd01WwW1KARzYL4p 1sBJmKiqS6T7/r8UqzsmzNVmmeccVHPoJVImk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gx2TwPY0zoLBprBpvispsMP1S0T3TDTaNNHwcFI4nEs=; b=AQEXiHGo1X/W7XgXtzy0aEdqMHkL7x+rYbiXibb3bOV+b4EHILglkXTzdSB4snUx6J N1p/t5v6Jhw1LHmwNobSzGVaP6XnibQyU6NX1Sn2mQIg+fIyTrzXWc6UJP6h8eqgvh1l mqcf3qXxdQljqiBhXPgy5horPiUSoVuYPLWzR23zVnB/sDAc4UN6c5s30G55ICSxZ2Fr 1oTc3Fb+jOOX/Su1v4rXu+cZu1UhGKjxCzKGlS3Y+yQqNt/yDqg8QNdFnvdvz/ejXks2 K6+Spght2L5sw0nIG6rXzbaNasnFHNj3LOwE3ZPH8qIaSS1Gp3ZFQhlNl8Ykuxa66vWR zxRA== X-Gm-Message-State: APf1xPDKDp8Vv7Yh+xVEON7tBhyUaDe1npzQbDeAkksNGgcRbvDsPWKh iYhrnLP88fQFbbZ9IoDTo2rWhqLp3Ko= X-Received: by 10.223.179.211 with SMTP id x19mr2014899wrd.175.1519400474514; Fri, 23 Feb 2018 07:41:14 -0800 (PST) Received: from localhost.localdomain ([196.90.4.100]) by smtp.gmail.com with ESMTPSA id 188sm2273215wmg.29.2018.02.23.07.41.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 07:41:13 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 23 Feb 2018 15:40:51 +0000 Message-Id: <20180223154052.9828-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180223154052.9828-1-ard.biesheuvel@linaro.org> References: <20180223154052.9828-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH edk2-platforms v3 5/6] Platform/96Boards: add driver for low speed (LS) connector X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" This adds a driver that manages the 96Boards LS connector, i.e, it installs a HII page to configure the type of mezzanine that is installed in the slot, and it exposes this information via the LS connector protocol. It is also in charge of applying the overlay to the platform device tree at end of DXE. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Platform/96Boards/96Boards.dec | 3 + Platform/96Boards/Include/Guid/FormSet.h | 23 ++ Platform/96Boards/LsConnectorDxe/LsConnectorDxe.c | 221 ++++++++++++++++++++ Platform/96Boards/LsConnectorDxe/LsConnectorDxe.h | 32 +++ Platform/96Boards/LsConnectorDxe/LsConnectorDxe.inf | 57 +++++ Platform/96Boards/LsConnectorDxe/LsConnectorHii.uni | 27 +++ Platform/96Boards/LsConnectorDxe/LsConnectorHii.vfr | 45 ++++ 7 files changed, 408 insertions(+) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Platform/96Boards/96Boards.dec b/Platform/96Boards/96Boards.dec index fa8e639b1a11..49641828aa60 100644 --- a/Platform/96Boards/96Boards.dec +++ b/Platform/96Boards/96Boards.dec @@ -37,6 +37,9 @@ [Guids] g96BoardsI2c1MasterGuid = { 0xcf64ac46, 0xd0be, 0x4a69, { 0x90, 0xa2, 0xf2, 0x82, 0x5b, 0x92, 0x25, 0x61 } } g96BoardsSpiMasterGuid = { 0x9703fd99, 0xe638, 0x42b8, { 0xab, 0x81, 0x52, 0x61, 0x1b, 0xf7, 0xf7, 0x5d } } + # GUID for the HII configuration form + g96BoardsFormsetGuid = { 0x7500c9d2, 0x9203, 0x4a37, { 0x84, 0xbb, 0x92, 0xa9, 0xce, 0x34, 0x38, 0xbd } } + [PcdsFixedAtBuild] # ASCII DT paths to the I2C parent nodes of the 96boards LS connector g96BoardsTokenSpaceGuid.PcdI2c0Parent|""|VOID*|0x00000001 diff --git a/Platform/96Boards/Include/Guid/FormSet.h b/Platform/96Boards/Include/Guid/FormSet.h new file mode 100644 index 000000000000..a0475e641d69 --- /dev/null +++ b/Platform/96Boards/Include/Guid/FormSet.h @@ -0,0 +1,23 @@ +/** @file + + Copyright (c) 2018, Linaro Limited. All rights reserved. + + This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __96BOARDS_FORMSET_H__ +#define __96BOARDS_FORMSET_H__ + +#define NINETY_SIX_BOARDS_FORMSET_GUID \ + { 0x7500c9d2, 0x9203, 0x4a37, { 0x84, 0xbb, 0x92, 0xa9, 0xce, 0x34, 0x38, 0xbd } } + +extern EFI_GUID g96BoardsFormsetGuid; + +#endif // __96BOARDS_FORMSET_H__ diff --git a/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.c b/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.c new file mode 100644 index 000000000000..f19d95635056 --- /dev/null +++ b/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.c @@ -0,0 +1,221 @@ +/** @file + + Copyright (c) 2018, Linaro, Ltd. All rights reserved. + + This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "LsConnectorDxe.h" + +extern UINT8 LsConnectorHiiBin[]; +extern UINT8 LsConnectorDxeStrings[]; + +typedef struct { + VENDOR_DEVICE_PATH VendorDevicePath; + EFI_DEVICE_PATH_PROTOCOL End; +} HII_VENDOR_DEVICE_PATH; + +STATIC HII_VENDOR_DEVICE_PATH m96BoardsDxeVendorDevicePath = { + { + { + HARDWARE_DEVICE_PATH, + HW_VENDOR_DP, + { + (UINT8) (sizeof (VENDOR_DEVICE_PATH)), + (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) + } + }, + NINETY_SIX_BOARDS_FORMSET_GUID + }, + { + END_DEVICE_PATH_TYPE, + END_ENTIRE_DEVICE_PATH_SUBTYPE, + { + (UINT8) (END_DEVICE_PATH_LENGTH), + (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8) + } + } +}; + +STATIC LS_CONNECTOR_PROTOCOL mLsConnector; +STATIC EFI_EVENT EndOfDxeEvent; + +STATIC +EFI_STATUS +InstallHiiPages ( + VOID + ) +{ + EFI_STATUS Status; + EFI_HII_HANDLE HiiHandle; + EFI_HANDLE DriverHandle; + + DriverHandle = NULL; + Status = gBS->InstallMultipleProtocolInterfaces (&DriverHandle, + &gEfiDevicePathProtocolGuid, + &m96BoardsDxeVendorDevicePath, + NULL); + if (EFI_ERROR (Status)) { + return Status; + } + + HiiHandle = HiiAddPackages (&g96BoardsFormsetGuid, + DriverHandle, + LsConnectorDxeStrings, + LsConnectorHiiBin, + NULL); + + if (HiiHandle == NULL) { + gBS->UninstallMultipleProtocolInterfaces (DriverHandle, + &gEfiDevicePathProtocolGuid, + &m96BoardsDxeVendorDevicePath, + NULL); + return EFI_OUT_OF_RESOURCES; + } + return EFI_SUCCESS; +} + +STATIC +VOID +EFIAPI +ApplyDeviceTreeOverlay ( + EFI_EVENT Event, + VOID *Context + ) +{ + VOID *Dtb; + MEZZANINE_PROTOCOL *Mezzanine; + EFI_STATUS Status; + + // + // Find the DTB in the configuration table array. If it isn't there, just + // bail without an error: we may be running on an ACPI platform even if + // this driver does not support it [yet]. + // + Status = EfiGetSystemConfigurationTable (&gFdtTableGuid, &Dtb); + if (Status == EFI_NOT_FOUND) { + return; + } + ASSERT_EFI_ERROR (Status); + + Status = gBS->LocateProtocol (&g96BoardsMezzanineProtocolGuid, NULL, + (VOID **)&Mezzanine); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_INFO, "%a: no mezzanine driver active\n", __FUNCTION__)); + return; + } + + Status = Mezzanine->ApplyDeviceTreeOverlay (Mezzanine, Dtb); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "%a: failed to apply DT overlay - %r\n", __FUNCTION__, + Status)); + } +} + +/** + The entry point for 96BoardsDxe driver. + + @param[in] ImageHandle The image handle of the driver. + @param[in] SystemTable The system table. + + @retval EFI_ALREADY_STARTED The driver already exists in system. + @retval EFI_OUT_OF_RESOURCES Fail to execute entry point due to lack of + resources. + @retval EFI_SUCCES All the related protocols are installed on + the driver. + +**/ +EFI_STATUS +EFIAPI +EntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + NINETY_SIX_BOARDS_CONFIG_DATA ConfigData; + UINTN BufferSize; + + // + // Get the current config settings from the EFI variable. + // + BufferSize = sizeof (ConfigData); + Status = gRT->GetVariable (NINETY_SIX_BOARDS_CONFIG_VARIABLE_NAME, + &g96BoardsFormsetGuid, NULL, &BufferSize, &ConfigData); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_INFO, "%a: no config data found\n", __FUNCTION__)); + ConfigData.MezzanineType = MEZZANINE_NONE; + } + + if (!EFI_ERROR (Status) && + ConfigData.MezzanineType >= MEZZANINE_MAX) { + DEBUG ((DEBUG_WARN, + "%a: invalid value for %s, defaulting to MEZZANINE_NONE\n", + __FUNCTION__, NINETY_SIX_BOARDS_CONFIG_VARIABLE_NAME)); + ConfigData.MezzanineType = MEZZANINE_NONE; + Status = EFI_INVALID_PARAMETER; // trigger setvar below + } + + // + // Write the newly selected value back to the variable store. + // + if (EFI_ERROR (Status)) { + ZeroMem (&ConfigData.Reserved, sizeof (ConfigData.Reserved)); + Status = gRT->SetVariable (NINETY_SIX_BOARDS_CONFIG_VARIABLE_NAME, + &g96BoardsFormsetGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, + sizeof (ConfigData), &ConfigData); + + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: gRT->SetVariable () failed - %r\n", + __FUNCTION__, Status)); + return Status; + } + } + + switch (ConfigData.MezzanineType) { + case MEZZANINE_SECURE96: + mLsConnector.MezzanineType = MezzanineSecure96; + break; + default: + mLsConnector.MezzanineType = MezzanineUnknown; + } + + Status = gBS->InstallProtocolInterface (&ImageHandle, + &g96BoardsLsConnectorProtocolGuid, + EFI_NATIVE_INTERFACE, + &mLsConnector); + if (EFI_ERROR (Status)) { + return Status; + } + + Status = gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_NOTIFY, + ApplyDeviceTreeOverlay, + NULL, + &gEfiEndOfDxeEventGroupGuid, + &EndOfDxeEvent); + ASSERT_EFI_ERROR (Status); + + return InstallHiiPages (); +} diff --git a/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.h b/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.h new file mode 100644 index 000000000000..c2a21c52b7a2 --- /dev/null +++ b/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.h @@ -0,0 +1,32 @@ +/** @file + + Copyright (c) 2018, Linaro Limited. All rights reserved. + + This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __LSCONNECTOR_DXE_H__ +#define __LSCONNECTOR_DXE_H__ + +#include +#include + +#define MEZZANINE_NONE 0x0 +#define MEZZANINE_SECURE96 0x1 +#define MEZZANINE_MAX 0x2 + +#define NINETY_SIX_BOARDS_CONFIG_VARIABLE_NAME L"NinetySixBoardsConfig" + +typedef struct { + UINT8 MezzanineType; + UINT8 Reserved[7]; +} NINETY_SIX_BOARDS_CONFIG_DATA; + +#endif // __LSCONNECTOR_DXE_H__ diff --git a/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.inf b/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.inf new file mode 100644 index 000000000000..1bf528ceaa84 --- /dev/null +++ b/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.inf @@ -0,0 +1,57 @@ +## @file +# +# Copyright (c) 2018, Linaro, Ltd. All rights reserved.
+# +# This program and the accompanying materials are licensed and made +# available under the terms and conditions of the BSD License which +# accompanies this distribution. The full text of the license may be +# found at http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR +# IMPLIED. +# +## + +[Defines] + INF_VERSION = 0x0001001A + BASE_NAME = LsConnectorDxe + FILE_GUID = 3f68e889-cb77-4efc-bc84-afa0a64ad26e + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + ENTRY_POINT = EntryPoint + +[Sources] + LsConnectorDxe.c + LsConnectorDxe.h + LsConnectorHii.vfr + LsConnectorHii.uni + +[Packages] + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + Platform/96Boards/96Boards.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + HiiLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + UefiRuntimeServicesTableLib + +[Protocols] + g96BoardsLsConnectorProtocolGuid ## PRODUCES + g96BoardsMezzanineProtocolGuid ## CONSUMES + +[Guids] + gEfiEndOfDxeEventGroupGuid + gFdtTableGuid + g96BoardsFormsetGuid + +[Depex] + gEfiVariableArchProtocolGuid AND + gEfiVariableWriteArchProtocolGuid diff --git a/Platform/96Boards/LsConnectorDxe/LsConnectorHii.uni b/Platform/96Boards/LsConnectorDxe/LsConnectorHii.uni new file mode 100644 index 000000000000..23f4c5859207 --- /dev/null +++ b/Platform/96Boards/LsConnectorDxe/LsConnectorHii.uni @@ -0,0 +1,27 @@ +/** @file + + Copyright (c) 2018, Linaro, Ltd. All rights reserved. + + This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#langdef en-US "English" + +#string STR_FORM_SET_TITLE #language en-US "96boards Mezzanine options" +#string STR_FORM_SET_TITLE_HELP #language en-US "Configure the installed 96boards mezzanine" + +#string STR_MAIN_FORM_TITLE #language en-US "96boards Mezzanine options" +#string STR_NULL_STRING #language en-US "" + +#string STR_MEZZANINE_SELECT_PROMPT #language en-US "96boards mezzanine" +#string STR_MEZZANINE_SELECT_HELP #language en-US "The type of mezzanine board plugged into the 96boards LS connector" + +#string STR_MEZZANINE_NONE #language en-US "None/Unknown" +#string STR_MEZZANINE_SECURE96 #language en-US "Secure96" diff --git a/Platform/96Boards/LsConnectorDxe/LsConnectorHii.vfr b/Platform/96Boards/LsConnectorDxe/LsConnectorHii.vfr new file mode 100644 index 000000000000..c4dd69db8e2f --- /dev/null +++ b/Platform/96Boards/LsConnectorDxe/LsConnectorHii.vfr @@ -0,0 +1,45 @@ +/** @file + + Copyright (c) 2018, Linaro, Ltd. All rights reserved. + + This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include "LsConnectorDxe.h" + +#include + +formset + guid = NINETY_SIX_BOARDS_FORMSET_GUID, + title = STRING_TOKEN(STR_FORM_SET_TITLE), + help = STRING_TOKEN(STR_FORM_SET_TITLE_HELP), + classguid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID, + + efivarstore NINETY_SIX_BOARDS_CONFIG_DATA, + attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attributes + name = NinetySixBoardsConfig, + guid = NINETY_SIX_BOARDS_FORMSET_GUID; + + form formid = 0x1000, + title = STRING_TOKEN(STR_MAIN_FORM_TITLE); + + oneof varid = NinetySixBoardsConfig.MezzanineType, + prompt = STRING_TOKEN(STR_MEZZANINE_SELECT_PROMPT), + help = STRING_TOKEN(STR_MEZZANINE_SELECT_HELP), + flags = NUMERIC_SIZE_1 | INTERACTIVE | RESET_REQUIRED, + option text = STRING_TOKEN(STR_MEZZANINE_NONE), value = MEZZANINE_NONE, flags = DEFAULT; + option text = STRING_TOKEN(STR_MEZZANINE_SECURE96), value = MEZZANINE_SECURE96, flags = 0; + endoneof; + + subtitle text = STRING_TOKEN(STR_NULL_STRING); + + endform; + +endformset;