From patchwork Wed May 23 14:14:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 136665 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp953215lji; Wed, 23 May 2018 07:14:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqKkfvKOu8GX3HnxHX40PCwGwpugLkbmhDIND36mhXPuogeSlg78PiM8MHqXbL4cBVlbyhE X-Received: by 2002:a17:902:a70b:: with SMTP id w11-v6mr3136646plq.342.1527084894350; Wed, 23 May 2018 07:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527084894; cv=none; d=google.com; s=arc-20160816; b=l5jpb2xyidy2TGxfepCipP8V4V4uTXFWRSpF9vOfnYN/F8YKFquv2Qguds6gA/yqTY 2gSUiYXr+Wbz+rSOt6OW5aQqpNLBLuGk8ucZbax6uOrJA5v+xwTrtw/UxQWEtpm/isJf TU7GNZmuiA3sHBnC8zk8pXa2yoRydbPCqkeFbe1Qdg+NKFgSovvVVYZWyOxfer8Qhpvg 1MAlhPQVsQHacUnYFkp1r9mGiZ08+AtHA0S+iWTilsfI8dIDk5My9X0Cp5pzPCoG7pg1 RnfARBben4EYOQEQKc7UL5b/AhtITmQFKaVmMO8LOlpTUSperNCTsjbOxQSZGRmLnBQs Bl1Q== 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=1UtMSXynNfr1DifnJIMc2psehKqK5UnkBep0HAJGnQg=; b=lRmKSSChA+l/NPyHHrHghHuJPMS1miaxUod45pCGLjQA0wMI2O7aQxsn+92R7euN26 xN0iHEn6vHlPbG8bMLoXNQMk/Zb18J4xF5abLVvHpqg4Bb4WC3LsZ/zVW9BUxxCmXewI /RyrLXcf2ja7wUm2CNYwodMDkg2DfD4Bzjq129VLBS8O07TAyrsOv3XotYwePBTnV5Vy atH3Mhh5w6nah7Z9/5cQW6s/MPna2MMAe3abfyC90FCmBUaBTnksRjh4Do/ohMp/Zfyr DyJcn9U7yvozBOKkoava3TyNJZvYE/J0sPScgFfjvCe8aiqAXHsEVmqY33lX6wp+3HYY 2SYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KpU5okbe; 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 v8-v6si18733420plo.306.2018.05.23.07.14.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 07:14:54 -0700 (PDT) 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=KpU5okbe; 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 E7BF6207E4DFC; Wed, 23 May 2018 07:14:53 -0700 (PDT) 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: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-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 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: [edk2] [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: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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