From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::22c; helo=mail-wm0-x22c.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (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 66CD8207E4DF3 for ; Wed, 23 May 2018 07:14:52 -0700 (PDT) Received: by mail-wm0-x22c.google.com with SMTP id a67-v6so9395266wmf.3 for ; Wed, 23 May 2018 07:14:52 -0700 (PDT) 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=FdjCqlhXL6zkwLUE/C6/5cki6r8JGOOWIBYERdErCWQ=; b=KpU5okbe+I1Te4wrZFWRZVPmt6WaIXiRpnWjnoaFNjNHNLq2tsAa3YujIyMowLFjU3 BmfSrtgeK4F8xWtanoajdISF3/9J/ATnSEpRTsoXjVIN9sbgThl0wpmSTNtLd5MgmVF0 3W7U4Jo89cLL+zYVEhpDg2Y4GdVO4SvjegSoY= 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=FdjCqlhXL6zkwLUE/C6/5cki6r8JGOOWIBYERdErCWQ=; b=Mjfd2osDsF0M2J1EPe1eFpxRKARPj5F/0JvEt2uHCVDpYw3D/pguWfaBERRXEeFkwF /ggdDETq51a1Yw85fRp3GapA50YqgqdC49vEJzEVkE/3olSsA5xonKmsRI1ZXm8FeZLv Vi5skxG5PsCO3IA+cdlEG6dXS+5PUQFdMvNDGlY5ZYPW73s5Wf7jFTw2J0K23JEJpLNj gITez20dKoVtiT/dEqv5wcvbibfsV5l3pYghA4GagQ0ytw9Rg/Z90dzozixzaq4Rj49W ujp4sF7ZOyYjlQTlDJgJlPSBl7eRQ66djO8YsEiCmM0Twi5xRrqE+NVnSwMgeZpbMZPq +9Ng== X-Gm-Message-State: ALKqPwcGKK9+w1liwr7CV/gS1PmTK9PNVS1YXWgNMG3I3gwxHKVrfwU+ gqbRAyQDDBVzFEQtbnyPE5eCRAu6Aoc= X-Google-Smtp-Source: AB8JxZqpc1XMNepYcku0Yr/2SnkjnUzgy9q2hahKCZ8JO8MjnykLsp3epdQiuGzsgYR3RFXvxs1/8g== X-Received: by 2002:a1c:71dc:: with SMTP id d89-v6mr4239906wmi.26.1527084890390; Wed, 23 May 2018 07:14:50 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:3995:5470:200:1aff:fe1b:b328]) by smtp.gmail.com with ESMTPSA id o12-v6sm27347774wrf.31.2018.05.23.07.14.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 07:14:49 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, Ard Biesheuvel Date: Wed, 23 May 2018 16:14:41 +0200 Message-Id: <20180523141444.20033-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180523141444.20033-1-ard.biesheuvel@linaro.org> References: <20180523141444.20033-1-ard.biesheuvel@linaro.org> Subject: [PATCH edk2-platforms 1/4] Platform/DeveloperBox: add 96boards/Socionext logo X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2018 14:14:52 -0000 Add a nice splash screen with the Socionext and 96boards logos. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Binary omitted. File can be found here: http://people.linaro.org/~ard.biesheuvel/devbox/Logo.bmp Platform/Socionext/DeveloperBox/DeveloperBox.dsc | 2 +- Platform/Socionext/DeveloperBox/DeveloperBox.fdf | 2 +- Platform/Socionext/DeveloperBox/Logo/Logo.bmp | Bin 0 -> 1050122 bytes Platform/Socionext/DeveloperBox/Logo/Logo.c | 149 ++++++++++++++++++++ Platform/Socionext/DeveloperBox/Logo/Logo.idf | 15 ++ Platform/Socionext/DeveloperBox/Logo/LogoDxe.inf | 52 +++++++ 6 files changed, 218 insertions(+), 2 deletions(-) diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc index 24b2925bf954..e7068a5b629c 100644 --- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc +++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc @@ -504,7 +504,7 @@ [Components.common] MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf - MdeModulePkg/Logo/LogoDxe.inf + Platform/Socionext/DeveloperBox/Logo/LogoDxe.inf MdeModulePkg/Universal/PCD/Dxe/Pcd.inf { diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.fdf b/Platform/Socionext/DeveloperBox/DeveloperBox.fdf index 1b8de4c3823a..9e06abb38682 100644 --- a/Platform/Socionext/DeveloperBox/DeveloperBox.fdf +++ b/Platform/Socionext/DeveloperBox/DeveloperBox.fdf @@ -116,7 +116,7 @@ [FV.FvMain] INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf - INF MdeModulePkg/Logo/LogoDxe.inf + INF Platform/Socionext/DeveloperBox/Logo/LogoDxe.inf INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf # diff --git a/Platform/Socionext/DeveloperBox/Logo/Logo.bmp b/Platform/Socionext/DeveloperBox/Logo/Logo.bmp new file mode 100644 index 000000000000..bf87981ee71e Binary files /dev/null and b/Platform/Socionext/DeveloperBox/Logo/Logo.bmp differ diff --git a/Platform/Socionext/DeveloperBox/Logo/Logo.c b/Platform/Socionext/DeveloperBox/Logo/Logo.c new file mode 100644 index 000000000000..03bf748efd73 --- /dev/null +++ b/Platform/Socionext/DeveloperBox/Logo/Logo.c @@ -0,0 +1,149 @@ +/** @file + Logo DXE Driver, install Edkii Platform Logo protocol. + + Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
+ 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 + +typedef struct { + EFI_IMAGE_ID ImageId; + EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE Attribute; + INTN OffsetX; + INTN OffsetY; +} LOGO_ENTRY; + +STATIC EFI_HII_IMAGE_EX_PROTOCOL *mHiiImageEx; +STATIC EFI_HII_HANDLE mHiiHandle; +STATIC LOGO_ENTRY mLogos[] = { + { + IMAGE_TOKEN (IMG_LOGO), + EdkiiPlatformLogoDisplayAttributeCenter, + 0, + 0 + } +}; + +/** + Load a platform logo image and return its data and attributes. + + @param This The pointer to this protocol instance. + @param Instance The visible image instance is found. + @param Image Points to the image. + @param Attribute The display attributes of the image returned. + @param OffsetX The X offset of the image regarding the Attribute. + @param OffsetY The Y offset of the image regarding the Attribute. + + @retval EFI_SUCCESS The image was fetched successfully. + @retval EFI_NOT_FOUND The specified image could not be found. +**/ +STATIC +EFI_STATUS +EFIAPI +GetImage ( + IN EDKII_PLATFORM_LOGO_PROTOCOL *This, + IN OUT UINT32 *Instance, + OUT EFI_IMAGE_INPUT *Image, + OUT EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE *Attribute, + OUT INTN *OffsetX, + OUT INTN *OffsetY + ) +{ + UINT32 Current; + + if (Instance == NULL || Image == NULL || + Attribute == NULL || OffsetX == NULL || OffsetY == NULL) { + return EFI_INVALID_PARAMETER; + } + + Current = *Instance; + if (Current >= ARRAY_SIZE (mLogos)) { + return EFI_NOT_FOUND; + } + + (*Instance)++; + *Attribute = mLogos[Current].Attribute; + *OffsetX = mLogos[Current].OffsetX; + *OffsetY = mLogos[Current].OffsetY; + + return mHiiImageEx->GetImageEx (mHiiImageEx, mHiiHandle, + mLogos[Current].ImageId, Image); +} + +STATIC EDKII_PLATFORM_LOGO_PROTOCOL mPlatformLogo = { + GetImage +}; + +/** + Entrypoint of this module. + + This function is the entrypoint of this module. It installs the Edkii + Platform Logo protocol. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + +**/ +EFI_STATUS +EFIAPI +InitializeLogo ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_HII_PACKAGE_LIST_HEADER *PackageList; + EFI_HII_DATABASE_PROTOCOL *HiiDatabase; + EFI_HANDLE Handle; + + Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, + (VOID **) &HiiDatabase); + ASSERT_EFI_ERROR (Status); + + Status = gBS->LocateProtocol (&gEfiHiiImageExProtocolGuid, NULL, + (VOID **) &mHiiImageEx); + ASSERT_EFI_ERROR (Status); + + // + // Retrieve HII package list from ImageHandle + // + Status = gBS->OpenProtocol (ImageHandle, &gEfiHiiPackageListProtocolGuid, + (VOID **) &PackageList, ImageHandle, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, + "HII Image Package with logo not found in PE/COFF resource section\n")); + return Status; + } + + // + // Publish HII package list to HII Database. + // + Status = HiiDatabase->NewPackageList (HiiDatabase, PackageList, NULL, + &mHiiHandle); + if (!EFI_ERROR (Status)) { + Handle = NULL; + Status = gBS->InstallMultipleProtocolInterfaces (&Handle, + &gEdkiiPlatformLogoProtocolGuid, &mPlatformLogo, NULL); + } + return Status; +} diff --git a/Platform/Socionext/DeveloperBox/Logo/Logo.idf b/Platform/Socionext/DeveloperBox/Logo/Logo.idf new file mode 100644 index 000000000000..43a17dff65ad --- /dev/null +++ b/Platform/Socionext/DeveloperBox/Logo/Logo.idf @@ -0,0 +1,15 @@ +// @file +// Platform Logo image definition 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. +// + +#image IMG_LOGO Logo.bmp diff --git a/Platform/Socionext/DeveloperBox/Logo/LogoDxe.inf b/Platform/Socionext/DeveloperBox/Logo/LogoDxe.inf new file mode 100644 index 000000000000..d25fd097eb10 --- /dev/null +++ b/Platform/Socionext/DeveloperBox/Logo/LogoDxe.inf @@ -0,0 +1,52 @@ +## @file +# The default logo bitmap picture shown on setup screen. +# +# Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
+# 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 = LogoDxe + FILE_GUID = 35ec7319-053b-45b8-8523-8666a662122c + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + + ENTRY_POINT = InitializeLogo +# +# This flag specifies whether HII resource section is generated into PE image. +# + UEFI_HII_RESOURCE_SECTION = TRUE + +[Sources] + Logo.bmp + Logo.c + Logo.idf + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + UefiBootServicesTableLib + UefiDriverEntryPoint + DebugLib + +[Protocols] + gEfiHiiDatabaseProtocolGuid ## CONSUMES + gEfiHiiImageExProtocolGuid ## CONSUMES + gEfiHiiPackageListProtocolGuid ## PRODUCES CONSUMES + gEdkiiPlatformLogoProtocolGuid ## PRODUCES + +[Depex] + gEfiHiiDatabaseProtocolGuid AND + gEfiHiiImageExProtocolGuid -- 2.17.0