From nobody Mon Dec 23 05:18:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1518707968396333.9838304193253; Thu, 15 Feb 2018 07:19:28 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3704B220F33F8; Thu, 15 Feb 2018 07:08:34 -0800 (PST) Received: from mail-pl0-x241.google.com (mail-pl0-x241.google.com [IPv6:2607:f8b0:400e:c01::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 7EC31220F33CF for ; Thu, 15 Feb 2018 07:08:32 -0800 (PST) Received: by mail-pl0-x241.google.com with SMTP id g18so10559844plo.7 for ; Thu, 15 Feb 2018 07:14:25 -0800 (PST) Received: from localhost.localdomain ([64.64.108.76]) by smtp.gmail.com with ESMTPSA id l64sm47498857pfg.62.2018.02.15.07.14.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Feb 2018 07:14:23 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c01::241; helo=mail-pl0-x241.google.com; envelope-from=haojian.zhuang@linaro.org; receiver=edk2-devel@lists.01.org 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=v/Z0ffj2aSMFvfhhvjY/h6zXMRnbH42dHbG9BoBnP3E=; b=Sw8NSk3gMZu9PR3vbFicbVdUtxh6POARlPsGuBZqRR3rtULtON1ly2qPs7upPWPYCI ogeWaH0VUbKUgFgOS2T2FURumgzfpYHE2AEDLqpVbgjY2xZOkrTzJPRKv1NfIbtRJibS 0r32hSYmoUNJy5/9dsIG2CmTUukLC+kir/odE= 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=v/Z0ffj2aSMFvfhhvjY/h6zXMRnbH42dHbG9BoBnP3E=; b=DldZk+z5ejGtViaq9X8tASpiV/GSxEeAtKM3M+XxcBBLnZhU/RebOswhcRSOzgZrZQ qz+I/3qmfF7bLpM9rO1zZCCeuYiLuM/VWN7qoIL+FuU6dt5BLY40xNPGg3As1/s0xRGc sZ3g1J/sQylI1pLJZDEH2n0erUMstzubxW/ClMUPqQYg1kSkoYJDpJsHKy3YaokiD4Fe RU1pyBjAjew1cB9XfFDHYjBRFzGH398ZQGvTBShP72Q3fJYyhH5xilPBvU2NjbPao+je DSmbrn5pH4FwBSqL+eXFN8SgIs7lLnof8BmkYA4bH1Zy+bT+9Mbj2VcEydcst0K2Kc+7 r4og== X-Gm-Message-State: APf1xPBy0adtOLixLyCkBqQAd6kamcw26EODHYcwWK3eUgG2yDl/Gmw2 Sri6QpdrjpLejfuefo7NFQtY6tdMivc= X-Google-Smtp-Source: AH8x225/AtHWoNPvDFVatq5Q9sSmWAQ+RO1rPzrKW62VoQQwdjx5jgjEF+Vb06xoajSB0U+PsYvQGA== X-Received: by 2002:a17:902:2e03:: with SMTP id q3-v6mr2895424plb.362.1518707664502; Thu, 15 Feb 2018 07:14:24 -0800 (PST) From: Haojian Zhuang To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, linaro-uefi@lists.linaro.org Date: Thu, 15 Feb 2018 23:14:08 +0800 Message-Id: <1518707649-16912-2-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518707649-16912-1-git-send-email-haojian.zhuang@linaro.org> References: <1518707649-16912-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH 1/2] Platform/Hisilicon/HiKey960: add boot options 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: Haojian Zhuang MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add four boot options in emu variable region. They are "Boot on SD", "Grub", "Android Boot" and "Android Fastboot". Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- Platform/Hisilicon/HiKey960/HiKey960.dsc | 3 + Platform/Hisilicon/HiKey960/HiKey960.fdf | 241 +++++++++++++++++++++++++++= +++- 2 files changed, 242 insertions(+), 2 deletions(-) diff --git a/Platform/Hisilicon/HiKey960/HiKey960.dsc b/Platform/Hisilicon/= HiKey960/HiKey960.dsc index 98289c0..a6864c1 100644 --- a/Platform/Hisilicon/HiKey960/HiKey960.dsc +++ b/Platform/Hisilicon/HiKey960/HiKey960.dsc @@ -78,6 +78,9 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|FALSE =20 [PcdsFixedAtBuild.common] + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0x1AD88048 + gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x7FB8 + gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4 =20 gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Alpha" diff --git a/Platform/Hisilicon/HiKey960/HiKey960.fdf b/Platform/Hisilicon/= HiKey960/HiKey960.fdf index 655032a..af10430 100644 --- a/Platform/Hisilicon/HiKey960/HiKey960.fdf +++ b/Platform/Hisilicon/HiKey960/HiKey960.fdf @@ -26,12 +26,12 @@ =20 [FD.BL33_AP_UEFI] BaseAddress =3D 0x1AC98000|gArmTokenSpaceGuid.PcdFdBaseAddress # The ba= se address of the Firmware in NOR Flash. -Size =3D 0x000F0000|gArmTokenSpaceGuid.PcdFdSize # The si= ze in bytes of the FLASH Device +Size =3D 0x00100000|gArmTokenSpaceGuid.PcdFdSize # The si= ze in bytes of the FLASH Device ErasePolarity =3D 1 =20 # This one is tricky, it must be: BlockSize * NumBlocks =3D Size BlockSize =3D 0x00001000 -NumBlocks =3D 0xF0 +NumBlocks =3D 0x100 =20 ##########################################################################= ###### # @@ -53,6 +53,243 @@ NumBlocks =3D 0xF0 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize FV =3D FVMAIN_COMPACT =20 +0x000F0000|0x00008000 +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|gEfiMdeModule= PkgTokenSpaceGuid.PcdFlashNvStorageVariableSize +DATA =3D { + ## This is the EFI_FIRMWARE_VOLUME_HEADER + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + # FileSystemGuid: gEfiSystemNvDataFvGuid =3D + 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C, + 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50, + # FvLength: 0x8000 + 0x00, 0x80, 0x0, 0x00, 0x00, 0x00, 0x00, 0x00, + #Signature "_FVH" #Attributes + 0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00, + #HeaderLength #CheckSum #ExtHeaderOffset #Reserved #Revision + 0x48, 0x00, 0x36, 0x09, 0x00, 0x00, 0x00, 0x02, + #Blockmap[0]: 8 Blocks * 0x1000 Bytes / Block + 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + #Blockmap[1]: End + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + ## end of EFI_FIRMWARE_VOLUME_HEADER. + + ### Offset (0x48) ### + ## This is the VARIABLE_STORE_HEADER gEfiVariableGuid + 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41, + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d, + #Size: 0x8000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableS= ize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) =3D 0x7FB8 + 0xB8, 0x7F, 0x00, 0x00, + #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32 + 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + ### Offset (0x64) ### + ## This is the VARIABLE_HEADER + #StartId: VARIABLE_DATA #State: VAR_ADDED #Reserved + 0xAA, 0x55, 0x3F, 0x00, + #Attributes: EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS + 0x03, 0x00, 0x00, 0x00, + #NameSize: + 0x14, 0x00, 0x00, 0x00, + #DataSize: + 0x18, 0x00, 0x00, 0x00, + #VariableGuid: gEfiGlobalVariableGuid + 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, + 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, + ## End of VARIABLE_HEADER. Offset (0x84) + #VariableName: BootOrder + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, + 0x4F, 0x00, 0x72, 0x00, 0x64, 0x00, 0x65, 0x00, + 0x72, 0x00, 0x00, 0x00, + #Data + 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, + 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, + 0x08, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x0b, 0x00, + ### End of BootOrder. + + ### Offset (0xB0) ### + ## This is the VARIABLE_HEADER + #StartId: VARIABLE_DATA #State: VAR_ADDED #Reserved + 0xAA, 0x55, 0x3F, 0x00, + #Attributes: EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS + 0x03, 0x00, 0x00, 0x00, + #NameSize: + 0x12, 0x00, 0x00, 0x00, + #DataSize: + 0x42, 0x00, 0x00, 0x00, + #VariableGuid: gEfiGlobalVariableGuid + 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, + 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, + #VariableName: Boot0000 + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, + 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, + 0x00, 0x00, + ### Offset (0xE2), Size(0x32) ### + #Data: + #Attributes: LOAD_OPTION_ACTIVE + 0x01, 0x00, 0x00, 0x00, + #FilePathListLength + 0x26, 0x00, + #Description: "Boot on SD" + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, #Boot + 0x20, 0x00, 0x6F, 0x00, 0x6E, 0x00, 0x20, 0x00, # on=20 + 0x53, 0x00, 0x44, 0x00, 0x00, 0x00, #SD + #FilePathList (0x26) + 0x01, 0x04, 0x1D, 0x00, 0x5B, 0x90, 0x51, 0x0D, + 0x7E, 0xB7, 0x2A, 0x45, 0xA2, 0xC0, 0xEC, 0xA0, + 0xCC, 0x8D, 0x51, 0x4A, 0x00, 0xF0, 0x37, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1A, 0x05, + 0x00, 0x00, 0x7F, 0xFF, 0x04, 0x00, + ### Offset (0x124), Size (0x42) ### + ### End of Boot0000 + + ### Offset (0x124) ### + ## This is the VARIABLE_HEADER + #StartId: VARIABLE_DATA #State: VAR_ADDED #Reserved + 0xAA, 0x55, 0x3F, 0x00, + #Attributes: EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS + 0x03, 0x00, 0x00, 0x00, + #NameSize: + 0x12, 0x00, 0x00, 0x00, + #DataSize: + 0x93, 0x00, 0x00, 0x00, + #VariableGuid: gEfiGlobalVariableGuid + 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, + 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, + #VariableName: Boot0001 + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, + 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x31, 0x00, + 0x00, 0x00, + ### Offset (0x156). Size (0x32) ### + #Data: + #Attributes: LOAD_OPTION_ACTIVE + 0x01, 0x00, 0x00, 0x00, + #FilePathListLength + 0x83, 0x00, + #Description: "Grub" + 0x47, 0x00, 0x72, 0x00, 0x75, 0x00, 0x62, 0x00, #Grub + 0x00, 0x00, + #FilePathList (0x83) + 0x01, 0x04, 0x1D, 0x00, 0x5B, 0x90, 0x51, 0x0D, + 0x7E, 0xB7, 0x2A, 0x45, 0xA2, 0xC0, 0xEC, 0xA0, + 0xCC, 0x8D, 0x51, 0x4A, 0x00, 0x00, 0x3B, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x19, 0x06, + 0x00, 0x00, 0x03, 0x04, 0x01, 0x2A, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x21, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x96, 0x06, 0x34, 0xD3, 0x95, + 0x9B, 0x64, 0x4C, 0x8D, 0xF6, 0xE6, 0xD4, 0x54, + 0x8F, 0xBA, 0x41, 0x02, 0x02, 0x04, 0x04, 0x32, + 0x00, 0x5C, 0x00, 0x45, 0x00, 0x46, 0x00, 0x49, + 0x00, 0x5C, 0x00, 0x42, 0x00, 0x4F, 0x00, 0x4F, + 0x00, 0x54, 0x00, 0x5C, 0x00, 0x47, 0x00, 0x52, + 0x00, 0x55, 0x00, 0x42, 0x00, 0x41, 0x00, 0x41, + 0x00, 0x36, 0x00, 0x34, 0x00, 0x2E, 0x00, 0x45, + 0x00, 0x46, 0x00, 0x49, 0x00, 0x00, 0x00, 0x7F, + 0xFF, 0x04, 0x00, + ### Offset (0x1E9). Size (0x93) ### + ## End of Boot0001 + ### PADDING ### + 0x00, 0x00, 0x00, + + ### Offset (0x1EC) ### + ## This is the VARIABLE_HEADER + #StartId: VARIABLE_DATA #State: VAR_ADDED #Reserved + 0xAA, 0x55, 0x3F, 0x00, + #Attributes: EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS + 0x03, 0x00, 0x00, 0x00, + #NameSize: + 0x12, 0x00, 0x00, 0x00, + #DataSize: + 0x50, 0x00, 0x00, 0x00, + #VariableGuid: gEfiGlobalVariableGuid + 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, + 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, + #VariableName: Boot0002 + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, + 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x32, 0x00, + 0x00, 0x00, + ### Offset (0x220). Size (0x32) ### + #Data: + #Attributes: LOAD_OPTION_ACTIVE + 0x01, 0x00, 0x00, 0x00, + #FilePathListLength + 0x30, 0x00, + #Description: "Android Boot" + 0x41, 0x00, 0x6E, 0x00, 0x64, 0x00, 0x72, 0x00, #Andr + 0x6F, 0x00, 0x69, 0x00, 0x64, 0x00, 0x20, 0x00, #oid=20 + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, #Boot + 0x00, 0x00, + #FilePathList (AndroidBoot) + 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x00, 0x90, 0x20, 0xBF, 0x00, 0x00, 0x00, 0x00, + 0xBF, 0xDE, 0x8E, 0xBF, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x06, 0x14, 0x00, 0x36, 0x8B, 0x73, 0x3A, + 0xC5, 0xB9, 0x63, 0x47, 0xAB, 0xBD, 0x6C, 0xBD, + 0x4B, 0x25, 0xF9, 0xFF, 0x7F, 0xFF, 0x04, 0x00, + ### Offset (0x26E). Size (0x50) ### + ## End of Boot0002 + ### PADDING ### + 0x00, 0x00, + + ### Offset (0x270) ### + ## This is the VARIABLE_HEADER + #StartId: VARIABLE_DATA #State: VAR_ADDED #Reserved + 0xAA, 0x55, 0x3F, 0x00, + #Attributes: EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS + 0x03, 0x00, 0x00, 0x00, + #NameSize: + 0x12, 0x00, 0x00, 0x00, + #DataSize: + 0x58, 0x00, 0x00, 0x00, + #VariableGuid: gEfiGlobalVariableGuid + 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, + 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, + #VariableName: Boot0003 + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, + 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x33, 0x00, + 0x00, 0x00, + ### Offset (0x2A2). Size (0x32) ### + #Data: + #Attributes: LOAD_OPTION_ACTIVE + 0x01, 0x00, 0x00, 0x00, + #FilePathListLength + 0x30, 0x00, + #Description: "Android Fastboot" + 0x41, 0x00, 0x6E, 0x00, 0x64, 0x00, 0x72, 0x00, #Andr + 0x6F, 0x00, 0x69, 0x00, 0x64, 0x00, 0x20, 0x00, #oid=20 + 0x46, 0x00, 0x61, 0x00, 0x73, 0x00, 0x74, 0x00, #Fast + 0x62, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, #boot + 0x00, 0x00, + #FilePathList (AndroidFastboot) + 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x00, 0x90, 0x20, 0xBF, 0x00, 0x00, 0x00, 0x00, + 0xBF, 0xDE, 0x8E, 0xBF, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x06, 0x14, 0x00, 0x2A, 0x50, 0x88, 0x95, + 0x70, 0x53, 0xE3, 0x11, 0x86, 0x31, 0xD7, 0xC5, + 0x95, 0x13, 0x64, 0xC8, 0x7F, 0xFF, 0x04, 0x00, + ## Offset (0x2FA). Size (0x58) ### + ## End of Boot0003 + + 0x00 +} + +0x000F8000|0x00002000 +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|gEfiMdeModu= lePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize +#NV_FTW_WORKING +DATA =3D { + # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature =3D gEdkiiWorkingBl= ockSignatureGuid =3D + 0x2B, 0x29, 0x58, 0x9E, 0x68, 0x7C, 0x7D, 0x49, + 0xA0, 0xCE, 0x65, 0x0 , 0xFD, 0x9F, 0x1B, 0x95, + # Crc:UINT32 #WorkingBlockValid:1, WorkingBlockInvalid:1, Res= erved + 0xE2, 0x33, 0xF2, 0x03, 0xFE, 0xFF, 0xFF, 0xFF, + # WriteQueueSize: UINT64 #Size: 0x2000 - 0x20 (FTW_WORKING_HEADER) =3D 0= x1FE0 + 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +0x000FA000|0x00002000 +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|gEfiMdeModule= PkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize + =20 ##########################################################################= ###### # --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Mon Dec 23 05:18:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1518708968153741.8703921756069; Thu, 15 Feb 2018 07:36:08 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9E832220F33FB; Thu, 15 Feb 2018 07:08:37 -0800 (PST) Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (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 78E1E220F33CF for ; Thu, 15 Feb 2018 07:08:36 -0800 (PST) Received: by mail-pg0-x242.google.com with SMTP id g12so4434792pgs.0 for ; Thu, 15 Feb 2018 07:14:29 -0800 (PST) Received: from localhost.localdomain ([64.64.108.76]) by smtp.gmail.com with ESMTPSA id l64sm47498857pfg.62.2018.02.15.07.14.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Feb 2018 07:14:27 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c05::242; helo=mail-pg0-x242.google.com; envelope-from=haojian.zhuang@linaro.org; receiver=edk2-devel@lists.01.org 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=MzciDTOmDv9KmIDAYJHOuFyxVklOncsw5pKdm3JAb9s=; b=BZCuG9YHJ0CdO+VwGw6Z+dvO9W5hoTzr8krk73JhDBf4jqUeRG9wfmdalHmGe2puXv 8VzhgKBdD2Le3X/R2Qkjfg3BTRmZlB6wZ2rEizbIIkepwQrYZE0jZGvl79Ww9tpBndqK 07bUlAGn5kuVQP1nMrJ4sbje5jv2ucbrnglJU= 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=MzciDTOmDv9KmIDAYJHOuFyxVklOncsw5pKdm3JAb9s=; b=tz+hF8VHdW150sizRQ+7VLyurFJuyJL+ZPi9uwmqgTI1fc4UX75iDnVkhDAFny7LgK YuA2H4WVLsMX9UhHgY6AADk5mr+yI4k/796YNOkon3VfEyRe/qIWYZs5I++/z+s5cM8t mXWNir24K5iUOJirijGlSn6Qfea73pwKWSMMqtfjWlpp9nESF4cOE98guVfWxx4jCVJf FpgtUScjDUshJAVTI7w3UIMnIIA5GPh7O5r6SkhU1UXbX/Q8LJbYbdLL6km5n8f6bzdE UY37TAHdur20afBzh3YZAz6Pd/EF7GXN507Pymio3VJVVEE70cEbP0uxNusgsnMl16Ml UfyA== X-Gm-Message-State: APf1xPDjJfOe/m3UaHApLALI8xkzrf4zKHfdDhhfksZgOqfiezXE5RXP UVBQ33guUui2sfXIsJqVAjio/BHA1yE= X-Google-Smtp-Source: AH8x225kVUlO1Wv7/qMBmYjuHjb7JeHffQHK3gJwvqIvLm1EZDovL1w3FglubdTI0zAk/7UW7ylqcw== X-Received: by 10.99.43.73 with SMTP id r70mr2553209pgr.316.1518707668521; Thu, 15 Feb 2018 07:14:28 -0800 (PST) From: Haojian Zhuang To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, linaro-uefi@lists.linaro.org Date: Thu, 15 Feb 2018 23:14:09 +0800 Message-Id: <1518707649-16912-3-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518707649-16912-1-git-send-email-haojian.zhuang@linaro.org> References: <1518707649-16912-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH 2/2] Platform/Hisilicon/HiKey: add boot options 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: Haojian Zhuang MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add four boot options into emu variable region. They're "Boot on SD", "Grub", "Android Boot" and "Android Fastboot". Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- Platform/Hisilicon/HiKey/HiKey.dsc | 3 + Platform/Hisilicon/HiKey/HiKey.fdf | 239 +++++++++++++++++++++++++++++++++= +++- 2 files changed, 240 insertions(+), 2 deletions(-) diff --git a/Platform/Hisilicon/HiKey/HiKey.dsc b/Platform/Hisilicon/HiKey/= HiKey.dsc index b0f8a93..7db06b2 100644 --- a/Platform/Hisilicon/HiKey/HiKey.dsc +++ b/Platform/Hisilicon/HiKey/HiKey.dsc @@ -81,6 +81,9 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|FALSE =20 [PcdsFixedAtBuild.common] + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0x350F0048 + gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x7FB8 + gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4 =20 gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Alpha" diff --git a/Platform/Hisilicon/HiKey/HiKey.fdf b/Platform/Hisilicon/HiKey/= HiKey.fdf index 2a5c5a4..80b272c 100644 --- a/Platform/Hisilicon/HiKey/HiKey.fdf +++ b/Platform/Hisilicon/HiKey/HiKey.fdf @@ -26,12 +26,12 @@ =20 [FD.BL33_AP_UEFI] BaseAddress =3D 0x35000000|gArmTokenSpaceGuid.PcdFdBaseAddress # The ba= se address of the Firmware in NOR Flash. -Size =3D 0x000F0000|gArmTokenSpaceGuid.PcdFdSize # The si= ze in bytes of the FLASH Device +Size =3D 0x00100000|gArmTokenSpaceGuid.PcdFdSize # The si= ze in bytes of the FLASH Device ErasePolarity =3D 1 =20 # This one is tricky, it must be: BlockSize * NumBlocks =3D Size BlockSize =3D 0x00001000 -NumBlocks =3D 0xF0 +NumBlocks =3D 0x100 =20 ##########################################################################= ###### # @@ -53,6 +53,241 @@ NumBlocks =3D 0xF0 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize FV =3D FVMAIN_COMPACT =20 +0x000F0000|0x00008000 +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|gEfiMdeModule= PkgTokenSpaceGuid.PcdFlashNvStorageVariableSize +DATA =3D { + ## This is the EFI_FIRMWARE_VOLUME_HEADER + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + # FileSystemGuid: gEfiSystemNvDataFvGuid =3D + 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C, + 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50, + # FvLength: 0x8000 + 0x00, 0x80, 0x0, 0x00, 0x00, 0x00, 0x00, 0x00, + #Signature "_FVH" #Attributes + 0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00, + #HeaderLength #CheckSum #ExtHeaderOffset #Reserved #Revision + 0x48, 0x00, 0x36, 0x09, 0x00, 0x00, 0x00, 0x02, + #Blockmap[0]: 8 Blocks * 0x1000 Bytes / Block + 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + #Blockmap[1]: End + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + ## end of EFI_FIRMWARE_VOLUME_HEADER. + + ### Offset (0x48) ### + ## This is the VARIABLE_STORE_HEADER gEfiVariableGuid + 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41, + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d, + #Size: 0x8000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableS= ize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) =3D 0x7FB8 + 0xB8, 0x7F, 0x00, 0x00, + #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32 + 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + ### Offset (0x64) ### + ## This is the VARIABLE_HEADER + #StartId: VARIABLE_DATA #State: VAR_ADDED #Reserved + 0xAA, 0x55, 0x3F, 0x00, + #Attributes: EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS + 0x03, 0x00, 0x00, 0x00, + #NameSize: + 0x14, 0x00, 0x00, 0x00, + #DataSize: + 0x18, 0x00, 0x00, 0x00, + #VariableGuid: gEfiGlobalVariableGuid + 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, + 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, + ## End of VARIABLE_HEADER. Offset (0x84) + #VariableName: BootOrder + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, + 0x4F, 0x00, 0x72, 0x00, 0x64, 0x00, 0x65, 0x00, + 0x72, 0x00, 0x00, 0x00, + #Data + 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, + 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, + 0x08, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x0b, 0x00, + ### End of BootOrder. + + ### Offset (0xB0) ### + ## This is the VARIABLE_HEADER + #StartId: VARIABLE_DATA #State: VAR_ADDED #Reserved + 0xAA, 0x55, 0x3F, 0x00, + #Attributes: EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS + 0x03, 0x00, 0x00, 0x00, + #NameSize: + 0x12, 0x00, 0x00, 0x00, + #DataSize: + 0x42, 0x00, 0x00, 0x00, + #VariableGuid: gEfiGlobalVariableGuid + 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, + 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, + #VariableName: Boot0000 + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, + 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, + 0x00, 0x00, + ### Offset (0xE2), Size(0x32) ### + #Data: + #Attributes: LOAD_OPTION_ACTIVE + 0x01, 0x00, 0x00, 0x00, + #FilePathListLength + 0x26, 0x00, + #Description: "Boot on SD" + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, #Boot + 0x20, 0x00, 0x6F, 0x00, 0x6E, 0x00, 0x20, 0x00, # on=20 + 0x53, 0x00, 0x44, 0x00, 0x00, 0x00, #SD + #FilePathList (0x26) + 0x01, 0x04, 0x1D, 0x00, 0x5B, 0x90, 0x51, 0x0D, + 0x7E, 0xB7, 0x2A, 0x45, 0xA2, 0xC0, 0xEC, 0xA0, + 0xCC, 0x8D, 0x51, 0x4A, 0x00, 0xE0, 0x23, 0xF7, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1A, 0x05, + 0x00, 0x00, 0x7F, 0xFF, 0x04, 0x00, + ### Offset (0x124), Size (0x42) ### + ### End of Boot0000 + + ### Offset (0x124) ### + ## This is the VARIABLE_HEADER + #StartId: VARIABLE_DATA #State: VAR_ADDED #Reserved + 0xAA, 0x55, 0x3F, 0x00, + #Attributes: EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS + 0x03, 0x00, 0x00, 0x00, + #NameSize: + 0x12, 0x00, 0x00, 0x00, + #DataSize: + 0x9A, 0x00, 0x00, 0x00, + #VariableGuid: gEfiGlobalVariableGuid + 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, + 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, + #VariableName: Boot0001 + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, + 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x31, 0x00, + 0x00, 0x00, + ### Offset (0x156). Size (0x32) ### + #Data: + #Attributes: LOAD_OPTION_ACTIVE + 0x01, 0x00, 0x00, 0x00, + #FilePathListLength + 0x8A, 0x00, + #Description: "Grub" + 0x47, 0x00, 0x72, 0x00, 0x75, 0x00, 0x62, 0x00, #Grub + 0x00, 0x00, + #FilePathList (0x8A) + 0x01, 0x04, 0x1D, 0x00, 0x5B, 0x90, 0x51, 0x0D, + 0x7E, 0xB7, 0x2A, 0x45, 0xA2, 0xC0, 0xEC, 0xA0, + 0xCC, 0x8D, 0x51, 0x4A, 0x00, 0xD0, 0x23, 0xF7, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1D, 0x05, + 0x00, 0x00, 0x01, 0x05, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x01, 0x2A, 0x00, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3C, 0x21, 0x0F, 0x5C, 0xE1, 0x17, + 0x49, 0x41, 0x88, 0xC8, 0x8B, 0x50, 0xFB, 0x4E, + 0xC7, 0x0E, 0x02, 0x02, 0x04, 0x04, 0x32, 0x00, + 0x5C, 0x00, 0x45, 0x00, 0x46, 0x00, 0x49, 0x00, + 0x5C, 0x00, 0x42, 0x00, 0x4F, 0x00, 0x4F, 0x00, + 0x54, 0x00, 0x5C, 0x00, 0x47, 0x00, 0x52, 0x00, + 0x55, 0x00, 0x42, 0x00, 0x41, 0x00, 0x41, 0x00, + 0x36, 0x00, 0x34, 0x00, 0x2E, 0x00, 0x45, 0x00, + 0x46, 0x00, 0x49, 0x00, 0x00, 0x00, 0x7F, 0xFF, + 0x04, 0x00, + ### Offset (0x1F0). Size (0x9A) ### + ## End of Boot0001 + + ### Offset (0x1F0) ### + ## This is the VARIABLE_HEADER + #StartId: VARIABLE_DATA #State: VAR_ADDED #Reserved + 0xAA, 0x55, 0x3F, 0x00, + #Attributes: EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS + 0x03, 0x00, 0x00, 0x00, + #NameSize: + 0x12, 0x00, 0x00, 0x00, + #DataSize: + 0x4C, 0x00, 0x00, 0x00, + #VariableGuid: gEfiGlobalVariableGuid + 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, + 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, + #VariableName: Boot0002 + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, + 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x32, 0x00, + 0x00, 0x00, + ### Offset (0x222). Size (0x32) ### + #Data: + #Attributes: LOAD_OPTION_ACTIVE + 0x01, 0x00, 0x00, 0x00, + #FilePathListLength + 0x2C, 0x00, + #Description: "Android Boot" + 0x41, 0x00, 0x6E, 0x00, 0x64, 0x00, 0x72, 0x00, #Andr + 0x6F, 0x00, 0x69, 0x00, 0x64, 0x00, 0x20, 0x00, #oid=20 + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, #Boot + 0x00, 0x00, + #FilePathList (AndroidBoot) + 0x04, 0x07, 0x14, 0x00, 0x69, 0xD4, 0xB7, 0x69, + 0xA2, 0x55, 0xD8, 0x49, 0xA4, 0x26, 0x42, 0xBF, + 0xB2, 0x2F, 0x5B, 0x9D, 0x04, 0x06, 0x14, 0x00, + 0x36, 0x8B, 0x73, 0x3A, 0xC5, 0xB9, 0x63, 0x47, + 0xAB, 0xBD, 0x6C, 0xBD, 0x4B, 0x25, 0xF9, 0xFF, + 0x7F, 0xFF, 0x04, 0x00, + ### Offset (0x26E). Size (0x4C) ### + ## End of Boot0002 + ### PADDING ### + 0x00, 0x00, + + ### Offset (0x270) ### + ## This is the VARIABLE_HEADER + #StartId: VARIABLE_DATA #State: VAR_ADDED #Reserved + 0xAA, 0x55, 0x3F, 0x00, + #Attributes: EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS + 0x03, 0x00, 0x00, 0x00, + #NameSize: + 0x12, 0x00, 0x00, 0x00, + #DataSize: + 0x54, 0x00, 0x00, 0x00, + #VariableGuid: gEfiGlobalVariableGuid + 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, + 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, + #VariableName: Boot0003 + 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, + 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x33, 0x00, + 0x00, 0x00, + ### Offset (0x2A2). Size (0x32) ### + #Data: + #Attributes: LOAD_OPTION_ACTIVE + 0x01, 0x00, 0x00, 0x00, + #FilePathListLength + 0x2C, 0x00, + #Description: "Android Fastboot" + 0x41, 0x00, 0x6E, 0x00, 0x64, 0x00, 0x72, 0x00, #Andr + 0x6F, 0x00, 0x69, 0x00, 0x64, 0x00, 0x20, 0x00, #oid=20 + 0x46, 0x00, 0x61, 0x00, 0x73, 0x00, 0x74, 0x00, #Fast + 0x62, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, #boot + 0x00, 0x00, + #FilePathList (AndroidFastboot) + 0x04, 0x07, 0x14, 0x00, 0x69, 0xD4, 0xB7, 0x69, + 0xA2, 0x55, 0xD8, 0x49, 0xA4, 0x26, 0x42, 0xBF, + 0xB2, 0x2F, 0x5B, 0x9D, 0x04, 0x06, 0x14, 0x00, + 0x2A, 0x50, 0x88, 0x95, 0x70, 0x53, 0xE3, 0x11, + 0x86, 0x31, 0xD7, 0xC5, 0x95, 0x13, 0x64, 0xC8, + 0x7F, 0xFF, 0x04, 0x00, + ## Offset (0x2F6). Size (0x54) ### + ## End of Boot0003 + + 0x00 +} + +0x000F8000|0x00002000 +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|gEfiMdeModu= lePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize +#NV_FTW_WORKING +DATA =3D { + # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature =3D gEdkiiWorkingBl= ockSignatureGuid =3D + 0x2B, 0x29, 0x58, 0x9E, 0x68, 0x7C, 0x7D, 0x49, + 0xA0, 0xCE, 0x65, 0x0 , 0xFD, 0x9F, 0x1B, 0x95, + # Crc:UINT32 #WorkingBlockValid:1, WorkingBlockInvalid:1, Res= erved + 0xE2, 0x33, 0xF2, 0x03, 0xFE, 0xFF, 0xFF, 0xFF, + # WriteQueueSize: UINT64 #Size: 0x2000 - 0x20 (FTW_WORKING_HEADER) =3D 0= x1FE0 + 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +0x000FA000|0x00002000 +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|gEfiMdeModule= PkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize =20 ##########################################################################= ###### # --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel