diff --git a/BootShim/AARCH64/BootShim.S b/BootShim/AARCH64/BootShim.S index a4f7d67fd..6319efbef 100644 --- a/BootShim/AARCH64/BootShim.S +++ b/BootShim/AARCH64/BootShim.S @@ -1,61 +1,41 @@ _Head: - /* Set _Entry address */ - adr x1, _Payload - - /* Jump to the real code */ - b _Start - - /* Fake Linux kernel header */ + adr x1, _Payload /* Set _Entry address */ + b _Start /* Jump to the real code */ _StackBase: - /* Text Offset */ - .quad UEFI_BASE + .quad UEFI_BASE /* Text Offset */ _StackSize: - /* Image Size */ - .quad UEFI_SIZE - - /* Flags */ - .quad 0 - - /* Reserved */ - .quad 0 - - /* Reserved */ - .quad 0 - - /* Reserved */ - .quad 0 - - /* ARM64 Magic */ - .ascii "ARM\x64" - - /* Reserved */ - .long 0 + .quad UEFI_SIZE /* Image Size */ + .quad 0 /* Flags */ + .quad 0 /* Reserved */ + .quad 0 /* Reserved */ + .quad 0 /* Reserved */ + .ascii "ARM\x64" /* ARM64 Magic */ + .long 0 /* Reserved */ _Start: - mov x4, x1 - ldr x5, _StackBase - cmp x4, x5 - beq _Entry - ldr x6, _StackSize + mov x4, x1 + ldr x5, _StackBase + cmp x4, x5 + beq _Entry + ldr x6, _StackSize _CopyLoop: - ldp x2, x3, [x4], #16 - stp x2, x3, [x5], #16 - subs x6, x6, #16 - b.ne _CopyLoop - ldr x5, _StackBase + ldp x2, x3, [x4], #16 + stp x2, x3, [x5], #16 + subs x6, x6, #16 + b.ne _CopyLoop + ldr x5, _StackBase _Entry: - br x5 + br x5 _Dead: - /* We should never get here */ - b _Dead + b _Dead /* We should never get here */ .text .align 4 _Payload: - /* Your code will get ran right after this binary */ \ No newline at end of file + /* Your code will get ran right after this binary */ diff --git a/BootShim/ARM/BootShim.S b/BootShim/ARM/BootShim.S index 177d868c1..9e337f264 100644 --- a/BootShim/ARM/BootShim.S +++ b/BootShim/ARM/BootShim.S @@ -32,4 +32,4 @@ UefiSize: .align 4 _Payload: - /* code will get ran right after this binary */ \ No newline at end of file + /* code will get ran right after this binary */ diff --git a/Platforms/Asus/i005dPkg/Include/APRIORI.inc b/Platforms/Asus/i005dPkg/Include/APRIORI.inc index db1d4d458..b96b21336 100644 --- a/Platforms/Asus/i005dPkg/Include/APRIORI.inc +++ b/Platforms/Asus/i005dPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/i005d/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Asus/i005dPkg/Include/DXE.inc b/Platforms/Asus/i005dPkg/Include/DXE.inc index 08501de24..4ab2104bc 100644 --- a/Platforms/Asus/i005dPkg/Include/DXE.inc +++ b/Platforms/Asus/i005dPkg/Include/DXE.inc @@ -27,7 +27,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/i005d/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/i005d/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf diff --git a/Platforms/Asus/i005dPkg/Include/RAW.inc b/Platforms/Asus/i005dPkg/Include/RAW.inc index 706c668c8..6e2f7d3d3 100644 --- a/Platforms/Asus/i005dPkg/Include/RAW.inc +++ b/Platforms/Asus/i005dPkg/Include/RAW.inc @@ -1,179 +1,174 @@ -FILE FREEFORM = DDE58710-41CD-4306-DBFB-3FA90BB1D2DD { + FILE FREEFORM = DDE58710-41CD-4306-DBFB-3FA90BB1D2DD { SECTION UI = "uefiplat.cfg" SECTION RAW = Binaries/i005d/RawFiles/uefiplat.cfg -} + } -FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { + FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { SECTION UI = "BDS_Menu.cfg" SECTION RAW = Binaries/i005d/RawFiles/BDS_Menu.cfg -} + } -FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { + FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { SECTION UI = "SecParti.cfg" SECTION RAW = Binaries/i005d/RawFiles/SecParti.cfg -} + } -FILE FREEFORM = A91D838E-A5FA-4138-825D-455E23030794 { - SECTION UI = "logo1.bmp" - SECTION RAW = Binaries/i005d/RawFiles/logo1.bmp -} - -FILE FREEFORM = 8CAE2C55-FC5A-410B-812B-8CA22F572F36 { + FILE FREEFORM = 8CAE2C55-FC5A-410B-812B-8CA22F572F36 { SECTION UI = "Panel_truly_wqxga_dsc_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_truly_wqxga_dsc_cmd.xml -} + } -FILE FREEFORM = 13AC9DC9-0092-4374-AE1A-06FF35950FD0 { + FILE FREEFORM = 13AC9DC9-0092-4374-AE1A-06FF35950FD0 { SECTION UI = "Panel_truly_wqxga_dsc_vid.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_truly_wqxga_dsc_vid.xml -} + } -FILE FREEFORM = FC6315F9-F8FE-4222-A1E3-226DF55D7592 { + FILE FREEFORM = FC6315F9-F8FE-4222-A1E3-226DF55D7592 { SECTION UI = "Panel_truly_wqxga_dual_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_truly_wqxga_dual_cmd.xml -} + } -FILE FREEFORM = 95E7B040-26A2-4511-9ABB-1D95D6DA7082 { + FILE FREEFORM = 95E7B040-26A2-4511-9ABB-1D95D6DA7082 { SECTION UI = "Panel_truly_wqxga_dual_vid.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_truly_wqxga_dual_vid.xml -} + } -FILE FREEFORM = 8BC595B7-391A-4A9A-8256-5B9983B30392 { + FILE FREEFORM = 8BC595B7-391A-4A9A-8256-5B9983B30392 { SECTION UI = "Panel_sharp_4k_dsc_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_sharp_4k_dsc_cmd.xml -} + } -FILE FREEFORM = 19B58ACD-B1F8-4078-B9A5-A33584B680E2 { + FILE FREEFORM = 19B58ACD-B1F8-4078-B9A5-A33584B680E2 { SECTION UI = "Panel_sharp_4k_dsc_vid.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_sharp_4k_dsc_vid.xml -} + } -FILE FREEFORM = 0AE323D6-2EBE-11E8-8349-9BA636A0D80C { + FILE FREEFORM = 0AE323D6-2EBE-11E8-8349-9BA636A0D80C { SECTION UI = "Panel_sharp_1080p_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_sharp_1080p_cmd.xml -} + } -FILE FREEFORM = 87273B42-311D-11E8-9324-DFB2DADFC3D1 { + FILE FREEFORM = 87273B42-311D-11E8-9324-DFB2DADFC3D1 { SECTION UI = "Panel_truly_1080p_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_truly_1080p_cmd.xml -} + } -FILE FREEFORM = BAFD3200-311D-11E8-8651-0FB3CACF38FB { + FILE FREEFORM = BAFD3200-311D-11E8-8651-0FB3CACF38FB { SECTION UI = "Panel_truly_1080p_vid.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_truly_1080p_vid.xml -} + } -FILE FREEFORM = 88CA5ABF-D0AC-4093-A68C-0CFAE1EF9635 { + FILE FREEFORM = 88CA5ABF-D0AC-4093-A68C-0CFAE1EF9635 { SECTION UI = "Panel_boe_amoled_wqhd_dsc_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd.xml -} + } -FILE FREEFORM = 6523A5C9-91CB-45C0-A2DC-25997CF23369 { + FILE FREEFORM = 6523A5C9-91CB-45C0-A2DC-25997CF23369 { SECTION UI = "Panel_boe_amoled_wqhd_dsc_vid.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_boe_amoled_wqhd_dsc_vid.xml -} + } -FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BE { + FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BE { SECTION UI = "Panel_boe_amoled_fhd_dsc_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_boe_amoled_fhd_dsc_cmd.xml -} + } -FILE FREEFORM = 8F276EE4-E75E-4C3B-8BCC-C37771E26478 { + FILE FREEFORM = 8F276EE4-E75E-4C3B-8BCC-C37771E26478 { SECTION UI = "Panel_nt36860_wqhd_dsc_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_nt36860_wqhd_dsc_cmd.xml -} + } -FILE FREEFORM = 6F2D4884-D8A0-11E9-AF7A-D77B1FE990EC { + FILE FREEFORM = 6F2D4884-D8A0-11E9-AF7A-D77B1FE990EC { SECTION UI = "Panel_nt36860_wqhd_dsc_vid.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_nt36860_wqhd_dsc_vid.xml -} + } -FILE FREEFORM = 81CE7295-491D-4E3F-AAA7-AB43FEF2F615 { + FILE FREEFORM = 81CE7295-491D-4E3F-AAA7-AB43FEF2F615 { SECTION UI = "Panel_r66451_60hz_fhd_plus_dsc_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_r66451_60hz_fhd_plus_dsc_cmd.xml -} + } -FILE FREEFORM = 81CE7295-491D-4E3F-AAA7-AB43FEF2F692 { + FILE FREEFORM = 81CE7295-491D-4E3F-AAA7-AB43FEF2F692 { SECTION UI = "Panel_r66451_fhd_plus_60hz_dsc_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_r66451_fhd_plus_60hz_dsc_cmd.xml -} + } -FILE FREEFORM = 8297C793-9861-422C-9F67-D447AF1EA812 { + FILE FREEFORM = 8297C793-9861-422C-9F67-D447AF1EA812 { SECTION UI = "Panel_r66451_120hz_fhd_plus_dsc_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_cmd.xml -} + } -FILE FREEFORM = 61156380-EB8A-4618-940F-AB9BDEA1EEC2 { + FILE FREEFORM = 61156380-EB8A-4618-940F-AB9BDEA1EEC2 { SECTION UI = "Panel_r66451_120hz_fhd_plus_dsc_cmd_hdk.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_cmd_hdk.xml -} + } -FILE FREEFORM = 44B09226-C2B4-45ED-AA6F-6686DB103978 { + FILE FREEFORM = 44B09226-C2B4-45ED-AA6F-6686DB103978 { SECTION UI = "Panel_r66451_120hz_fhd_plus_dsc_vid.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_vid.xml -} + } -FILE FREEFORM = D3F8580C-CCB8-4804-BB03-776E7B542FC2 { + FILE FREEFORM = D3F8580C-CCB8-4804-BB03-776E7B542FC2 { SECTION UI = "Panel_secondary_truly_1080p_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_secondary_truly_1080p_cmd.xml -} + } -FILE FREEFORM = D192FEE9-6A04-4BE8-ABFE-5534E2B457EC { + FILE FREEFORM = D192FEE9-6A04-4BE8-ABFE-5534E2B457EC { SECTION UI = "Panel_secondary_truly_1080p_vid.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_secondary_truly_1080p_vid.xml -} + } -FILE FREEFORM = 13594E78-635E-49C9-80C7-F2A3EF8D959B { + FILE FREEFORM = 13594E78-635E-49C9-80C7-F2A3EF8D959B { SECTION UI = "Panel_r66451_60hz_fhd_plus_dsc_cmd_cphy.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_r66451_60hz_fhd_plus_dsc_cmd_cphy.xml -} + } -FILE FREEFORM = 40C19F7E-C171-4C05-9C56-DE6E30AED8C9 { + FILE FREEFORM = 40C19F7E-C171-4C05-9C56-DE6E30AED8C9 { SECTION UI = "Panel_r66451_90hz_fhd_plus_dsc_vid_cphy.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_r66451_90hz_fhd_plus_dsc_vid_cphy.xml -} + } -FILE FREEFORM = C32CB97A-D116-4D64-83B9-6BA1236057AD { + FILE FREEFORM = C32CB97A-D116-4D64-83B9-6BA1236057AD { SECTION UI = "Panel_boe_amoled_wqhd_dsc_cmd_demura.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd_demura.xml -} + } -FILE FREEFORM = 453D4CEB-2EC9-49A6-8EEC-B233EB679591 { + FILE FREEFORM = 453D4CEB-2EC9-49A6-8EEC-B233EB679591 { SECTION UI = "Panel_boe_amoled_wqhd_dsc_vid_demura.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_boe_amoled_wqhd_dsc_vid_demura.xml -} + } -FILE FREEFORM = 602CFFCD-8A5E-438E-B432-BF1A656A2561 { + FILE FREEFORM = 602CFFCD-8A5E-438E-B432-BF1A656A2561 { SECTION UI = "Panel_secondary_r66451_fhd_plus_dsc_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_secondary_r66451_fhd_plus_dsc_cmd.xml -} + } -FILE FREEFORM = 0DF473F9-CF32-44E8-A52C-33EF988152B9 { + FILE FREEFORM = 0DF473F9-CF32-44E8-A52C-33EF988152B9 { SECTION UI = "Panel_ams667uu07_fhd_plus_dsc_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_ams667uu07_fhd_plus_dsc_cmd.xml -} + } -FILE FREEFORM = A6CB1258-12CE-465C-B3ED-8EE3513F144A { + FILE FREEFORM = A6CB1258-12CE-465C-B3ED-8EE3513F144A { SECTION UI = "Panel_ams678_fhd_plus_dsc_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_ams678_fhd_plus_dsc_cmd.xml -} + } -FILE FREEFORM = FB80B86D-644F-4F32-8203-6645B535CD7D { + FILE FREEFORM = FB80B86D-644F-4F32-8203-6645B535CD7D { SECTION UI = "Panel_ams678_er2_fhd_plus_dsc_cmd.xml" SECTION RAW = Binaries/i005d/RawFiles/Panel_ams678_er2_fhd_plus_dsc_cmd.xml -} + } -FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { + FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { SECTION UI = "uefipil.cfg" SECTION RAW = Binaries/i005d/RawFiles/uefipil.cfg -} + } -FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { + FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { SECTION UI = "QcomChargerCfg.cfg" SECTION RAW = Binaries/i005d/RawFiles/QcomChargerCfg.cfg -} + } -FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { + FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/i005d/RawFiles/BATTERY.PROVISION -} + } diff --git a/Platforms/Asus/i005dPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c b/Platforms/Asus/i005dPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c index 602281467..daac2188d 100644 --- a/Platforms/Asus/i005dPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c +++ b/Platforms/Asus/i005dPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c @@ -21,7 +21,8 @@ gDeviceMemoryDescriptorEx[] = { {"Sched Heap", 0x9F400000, 0x00400000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, {"FV Region", 0x9F800000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, {"ABOOT FV", 0x9FA00000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN}, - {"UEFI FD", 0x9FC00000, 0x00300000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, + {"FD Reserved", 0x9FC00000, 0x00100000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, + {"UEFI FD", 0x9FD00000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, {"SEC Heap", 0x9FF00000, 0x0008C000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, {"CPU Vectors", 0x9FF8C000, 0x00001000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, {"MMU PageTables", 0x9FF8D000, 0x00003000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, diff --git a/Platforms/Asus/i005dPkg/PlatformBuild.py b/Platforms/Asus/i005dPkg/PlatformBuild.py index 47b047179..a0622dac6 100644 --- a/Platforms/Asus/i005dPkg/PlatformBuild.py +++ b/Platforms/Asus/i005dPkg/PlatformBuild.py @@ -1,14 +1,13 @@ - ## -# Script to Build Asus ROG Phone 5 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -16,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("i005dPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -46,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("i005dPkg/i005d.dsc", {}) - def GetName(self): + def GetName (self): return "i005d" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "i005dPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "i005d", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "i005dPkg/i005d.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "i005d", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "i005dPkg/i005d.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -240,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Asus/i005dPkg/i005d.dec b/Platforms/Asus/i005dPkg/i005d.dec index ad7c5b183..e69de29bb 100644 --- a/Platforms/Asus/i005dPkg/i005d.dec +++ b/Platforms/Asus/i005dPkg/i005d.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = i005d - PACKAGE_GUID = DD9B11D5-D3A2-45A7-ADA2-6EF6EBB9CCC8 - PACKAGE_VERSION = 0.1 - -[Guids] - gi005dTokenSpaceGuid = { 0xDD9B11D5, 0xD3A2, 0x45A7, { 0xAD, 0xA2, 0x6E, 0xF6, 0xEB, 0xB9, 0xCC, 0xC8 } } diff --git a/Platforms/Asus/i005dPkg/i005d.dsc b/Platforms/Asus/i005dPkg/i005d.dsc index b6d68ef20..7e243b8a8 100644 --- a/Platforms/Asus/i005dPkg/i005d.dsc +++ b/Platforms/Asus/i005dPkg/i005d.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8350 # 1 = SM8350-AB # 2 = SM8350-AC + # SOC_TYPE = 0 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"alfaonyt" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"alfaonyt" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -65,11 +67,14 @@ gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferHeight|2448 gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferColorDepth|32 + # XBL Protocol + gQcomPkgTokenSpaceGuid.PcdScheduleInterfaceAddr|0x9FC37968 + # Dynamic RAM Start Address gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xE7400000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/LG/caymanslmPkg/Include/APRIORI.inc b/Platforms/LG/caymanslmPkg/Include/APRIORI.inc index ff0602a9d..f62d62c7a 100644 --- a/Platforms/LG/caymanslmPkg/Include/APRIORI.inc +++ b/Platforms/LG/caymanslmPkg/Include/APRIORI.inc @@ -16,7 +16,6 @@ APRIORI DXE { # Core Drivers INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf @@ -42,7 +41,7 @@ APRIORI DXE { INF QcomPkg/Drivers/ClockSpeedUpDxe/ClockSpeedUpDxe.inf -!if $(USE_DISPLAYDXE) == 1 +!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1 INF Binaries/caymanslm/QcomPkg/Drivers/CPRDxe/CPRDxe.inf !endif @@ -98,7 +97,7 @@ APRIORI DXE { INF Binaries/caymanslm/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.inf INF Binaries/caymanslm/QcomPkg/Drivers/TsensDxe/TsensDxe.inf -!if $(USE_DISPLAYDXE) == 1 +!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1 INF Binaries/caymanslm/QcomPkg/Drivers/DisplayDxe/DisplayDxe.inf !else INF SiliciumPkg/Drivers/SimpleFbDxe/SimpleFbDxe.inf diff --git a/Platforms/LG/caymanslmPkg/Include/DXE.inc b/Platforms/LG/caymanslmPkg/Include/DXE.inc index be998a1e2..95ef7635a 100644 --- a/Platforms/LG/caymanslmPkg/Include/DXE.inc +++ b/Platforms/LG/caymanslmPkg/Include/DXE.inc @@ -28,7 +28,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/caymanslm/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/caymanslm/QcomPkg/Drivers/SmemDxe/SmemDxe.inf @@ -39,7 +38,7 @@ INF Binaries/caymanslm/QcomPkg/Drivers/NpaDxe/NpaDxe.inf INF Binaries/caymanslm/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.inf INF Binaries/caymanslm/QcomPkg/Drivers/RpmhDxe/RpmhDxe.inf -!if $(USE_DISPLAYDXE) == 1 +!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1 INF Binaries/caymanslm/QcomPkg/Drivers/CPRDxe/CPRDxe.inf !endif INF Binaries/caymanslm/QcomPkg/Drivers/PdcDxe/PdcDxe.inf @@ -62,7 +61,7 @@ INF Binaries/caymanslm/QcomPkg/Drivers/UFSDxe/UFSDxe.inf INF Binaries/caymanslm/QcomPkg/Drivers/TLMMDxe/TLMMDxe.inf -!if $(USE_DISPLAYDXE) == 1 +!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1 INF Binaries/caymanslm/QcomPkg/Drivers/DisplayDxe/DisplayDxe.inf !else INF SiliciumPkg/Drivers/SimpleFbDxe/SimpleFbDxe.inf diff --git a/Platforms/LG/caymanslmPkg/Include/RAW.inc b/Platforms/LG/caymanslmPkg/Include/RAW.inc index f2b055722..d5459cf67 100644 --- a/Platforms/LG/caymanslmPkg/Include/RAW.inc +++ b/Platforms/LG/caymanslmPkg/Include/RAW.inc @@ -1,112 +1,44 @@ -FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { + FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { SECTION UI = "BDS_Menu.cfg" SECTION RAW = Binaries/caymanslm/RawFiles/BDS_Menu.cfg -} + } - -FILE FREEFORM = A91D838E-A5FA-4138-825D-455E23030794 { - SECTION UI = "logo1.bmp" - SECTION RAW = Binaries/caymanslm/RawFiles/logo1.bmp -} - - -FILE FREEFORM = 3E5584ED-05D4-4267-9048-0D47F76F4248 { - SECTION UI = "battery_symbol_Soc10.bmp" - SECTION RAW = Binaries/caymanslm/RawFiles/battery_symbol_Soc10.bmp -} - - -FILE FREEFORM = 4753E815-DDD8-402D-BF69-9B8C4EB7573E { - SECTION UI = "battery_symbol_NoBattery.bmp" - SECTION RAW = Binaries/caymanslm/RawFiles/battery_symbol_NoBattery.bmp -} - - -FILE FREEFORM = 03DED53E-BECD-428F-9F79-5ABA64C58445 { - SECTION UI = "battery_symbol_Nocharger.bmp" - SECTION RAW = Binaries/caymanslm/RawFiles/battery_symbol_Nocharger.bmp -} - - -FILE FREEFORM = 8B86CD38-C772-4FCF-85AA-345B2B3C1AB4 { - SECTION UI = "battery_symbol_LowBatteryCharging.bmp" - SECTION RAW = Binaries/caymanslm/RawFiles/battery_symbol_LowBatteryCharging.bmp -} - - -FILE FREEFORM = 3FD97907-93F1-4349-AF3C-3B68B0A5E626 { - SECTION UI = "battery_symbol_LowBattery.bmp" - SECTION RAW = Binaries/caymanslm/RawFiles/battery_symbol_LowBattery.bmp -} - - -FILE FREEFORM = E2EA5A4F-98BD-4203-AB49-399505DDFB7D { - SECTION UI = "tsens_thermal_symbol.bmp" - SECTION RAW = Binaries/caymanslm/RawFiles/tsens_thermal_symbol.bmp -} - - -FILE FREEFORM = C72FB1A9-5527-4E13-BAC4-F671D0330145 { - SECTION UI = "tsens_thermal_err_symbol.bmp" - SECTION RAW = Binaries/caymanslm/RawFiles/tsens_thermal_err_symbol.bmp -} - - -FILE FREEFORM = B0F8D1BE-5353-4812-B1F6-07E7768204CC { - SECTION UI = "battery_symbol_DebugBoot.bmp" - SECTION RAW = Binaries/caymanslm/RawFiles/battery_symbol_DebugBoot.bmp -} - - -FILE FREEFORM = F9E8F683-E065-4E09-B4F9-0230D7CECD08 { - SECTION UI = "battery_symbol_DebugStay.bmp" - SECTION RAW = Binaries/caymanslm/RawFiles/battery_symbol_DebugStay.bmp -} - - -FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { + FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { SECTION UI = "SecParti.cfg" SECTION RAW = Binaries/caymanslm/RawFiles/SecParti.cfg -} + } - -FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { + FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { SECTION UI = "QcomChargerCfg.cfg" SECTION RAW = Binaries/caymanslm/RawFiles/QcomChargerCfg.cfg -} - + } -FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { + FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/caymanslm/RawFiles/BATTERY.PROVISION -} + } - -FILE FREEFORM = 1B7A7BD2-E660-4555-9274-F982BDA93A3C { + FILE FREEFORM = 1B7A7BD2-E660-4555-9274-F982BDA93A3C { SECTION UI = "BATTERY_JUDY_LN.PROVISION" SECTION RAW = Binaries/caymanslm/RawFiles/BATTERY_JUDY_LN.PROVISION -} - + } -FILE FREEFORM = 9D9736C7-F498-487B-9C13-24402A525D3A { + FILE FREEFORM = 9D9736C7-F498-487B-9C13-24402A525D3A { SECTION UI = "BATTERY_JUDY_P.PROVISION" SECTION RAW = Binaries/caymanslm/RawFiles/BATTERY_JUDY_P.PROVISION -} + } - -FILE FREEFORM = 613A099D-74AB-4610-A8FB-22F09FD2EEC1 { + FILE FREEFORM = 613A099D-74AB-4610-A8FB-22F09FD2EEC1 { SECTION UI = "BATTERY_JUDY_PN.PROVISION" SECTION RAW = Binaries/caymanslm/RawFiles/BATTERY_JUDY_PN.PROVISION -} - + } -FILE FREEFORM = 80B3733D-0CA9-45A3-B69B-C3B7C36CD535 { + FILE FREEFORM = 80B3733D-0CA9-45A3-B69B-C3B7C36CD535 { SECTION UI = "BATTERY_STYLE3LM.PROVISION" SECTION RAW = Binaries/caymanslm/RawFiles/BATTERY_STYLE3LM.PROVISION -} - + } -FILE FREEFORM = DF68C3EA-B1BF-4BA5-BF8C-24BABD3B242F { + FILE FREEFORM = DF68C3EA-B1BF-4BA5-BF8C-24BABD3B242F { SECTION UI = "BATTERY_CAYMANLM.PROVISION" SECTION RAW = Binaries/caymanslm/RawFiles/BATTERY_CAYMANLM.PROVISION -} + } diff --git a/Platforms/LG/caymanslmPkg/PlatformBuild.py b/Platforms/LG/caymanslmPkg/PlatformBuild.py index 20f39f1ec..8021f16d7 100644 --- a/Platforms/LG/caymanslmPkg/PlatformBuild.py +++ b/Platforms/LG/caymanslmPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build LG Velvet UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("caymanslmPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("caymanslmPkg/caymanslm.dsc", {}) - def GetName(self): + def GetName (self): return "caymanslm" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "caymanslmPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "caymanslm", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "caymanslmPkg/caymanslm.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "caymanslm", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "caymanslmPkg/caymanslm.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/LG/caymanslmPkg/caymanslm.dec b/Platforms/LG/caymanslmPkg/caymanslm.dec index be582903e..e69de29bb 100644 --- a/Platforms/LG/caymanslmPkg/caymanslm.dec +++ b/Platforms/LG/caymanslmPkg/caymanslm.dec @@ -1,11 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = caymanslm - PACKAGE_GUID = ef79c823-7988-42a1-8087-742f78a4734d - PACKAGE_VERSION = 1.0 - -[Includes.common] - Include # Root include for the package - -[Guids.common] - gcaymanslmTokenSpaceGuid = { 0xef79c823, 0x7988, 0x42a1, { 0x80, 0x87, 0x74, 0x2f, 0x78, 0xa4, 0x73, 0x4d } } diff --git a/Platforms/LG/caymanslmPkg/caymanslm.dsc b/Platforms/LG/caymanslmPkg/caymanslm.dsc index 3853f8056..79f9145ff 100644 --- a/Platforms/LG/caymanslmPkg/caymanslm.dsc +++ b/Platforms/LG/caymanslmPkg/caymanslm.dsc @@ -25,23 +25,30 @@ BUILD_TARGETS = RELEASE|DEBUG SKUID_IDENTIFIER = DEFAULT FLASH_DEFINITION = caymanslmPkg/caymanslm.fdf - USE_DISPLAYDXE = 0 + USE_CUSTOM_DISPLAY_DRIVER = 0 AB_SLOT_SUPPORT = 0 + HAS_BUILD_IN_KEYBOARD = 0 + +[BuildOptions] + *_*_*_CC_FLAGS = -DAB_SLOT_SUPPORT=$(AB_SLOT_SUPPORT) -DHAS_BUILD_IN_KEYBOARD=$(HAS_BUILD_IN_KEYBOARD) [LibraryClasses.common] DeviceMemoryMapLib|caymanslmPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.inf DeviceConfigurationMapLib|caymanslmPkg/Library/DeviceConfigurationMapLib/DeviceConfigurationMapLib.inf [PcdsFixedAtBuild.common] - # Device Specific - gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Starting Address + # DDR Start Address + gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Leandro Friedrich" # Device Maintainer + # Device Maintainer + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Leandro Friedrich" + # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 + # UEFI Stack Addresses gEmbeddedTokenSpaceGuid.PcdPrePiStackBase|0x9FF90000 - gEmbeddedTokenSpaceGuid.PcdPrePiStackSize|0x00040000 # 256K stack + gEmbeddedTokenSpaceGuid.PcdPrePiStackSize|0x00040000 # SmBios gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor|"LG" @@ -55,13 +62,13 @@ gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferHeight|2460 gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferColorDepth|32 - # Dynamic RAM + # Dynamic RAM Start Address gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xA0000000 - # SD Card - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + # SD Card Slot + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE - # Usb Init + # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE [PcdsDynamicDefault.common] diff --git a/Platforms/Lenovo/9707fPkg/9707f.dec b/Platforms/Lenovo/9707fPkg/9707f.dec index 4ece591a1..e69de29bb 100644 --- a/Platforms/Lenovo/9707fPkg/9707f.dec +++ b/Platforms/Lenovo/9707fPkg/9707f.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = 9707f - PACKAGE_GUID = CC6036DC-CA51-493F-B5DD-1A475103CBCE - PACKAGE_VERSION = 0.1 - -[Guids] - g9707fTokenSpaceGuid = { 0xCC6036DC, 0xCA51, 0x493F, { 0xB5, 0xDD, 0x1A, 0x47, 0x51, 0x03, 0xCB, 0xCE } } diff --git a/Platforms/Lenovo/9707fPkg/9707f.dsc b/Platforms/Lenovo/9707fPkg/9707f.dsc index f8735f6e6..66fe3feb5 100644 --- a/Platforms/Lenovo/9707fPkg/9707f.dsc +++ b/Platforms/Lenovo/9707fPkg/9707f.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8250 # 1 = SM8250-AB # 2 = SM8250-AC + # SOC_TYPE = 2 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"CloudSweets" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"CloudSweets" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xA0000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Lenovo/9707fPkg/Include/APRIORI.inc b/Platforms/Lenovo/9707fPkg/Include/APRIORI.inc index f78db5f36..9c4f41788 100644 --- a/Platforms/Lenovo/9707fPkg/Include/APRIORI.inc +++ b/Platforms/Lenovo/9707fPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/9707f/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Lenovo/9707fPkg/Include/DXE.inc b/Platforms/Lenovo/9707fPkg/Include/DXE.inc index 4fa82702e..1a39dc0c8 100644 --- a/Platforms/Lenovo/9707fPkg/Include/DXE.inc +++ b/Platforms/Lenovo/9707fPkg/Include/DXE.inc @@ -30,7 +30,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/9707f/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/9707f/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Lenovo/9707fPkg/Include/RAW.inc b/Platforms/Lenovo/9707fPkg/Include/RAW.inc index 115e808fd..298009d61 100644 --- a/Platforms/Lenovo/9707fPkg/Include/RAW.inc +++ b/Platforms/Lenovo/9707fPkg/Include/RAW.inc @@ -131,4 +131,4 @@ FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/9707f/RawFiles/BATTERY.PROVISION - } \ No newline at end of file + } diff --git a/Platforms/Lenovo/9707fPkg/PlatformBuild.py b/Platforms/Lenovo/9707fPkg/PlatformBuild.py index 484ce8b59..82a1a6243 100644 --- a/Platforms/Lenovo/9707fPkg/PlatformBuild.py +++ b/Platforms/Lenovo/9707fPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Lenovo Legion Tab Y700 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("9707fPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("9707fPkg/9707f.dsc", {}) - def GetName(self): + def GetName (self): return "9707f" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "9707fPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "9707f", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "9707fPkg/9707f.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "9707f", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "9707fPkg/9707f.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Lenovo/VenusTZPkg/PlatformBuild.py b/Platforms/Lenovo/VenusTZPkg/PlatformBuild.py index d0060b536..539565309 100644 --- a/Platforms/Lenovo/VenusTZPkg/PlatformBuild.py +++ b/Platforms/Lenovo/VenusTZPkg/PlatformBuild.py @@ -1,6 +1,4 @@ ## -# Script to Build Lenovo IdeaPad Yoga 11 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -9,6 +7,7 @@ import logging import os import uuid + from io import StringIO from pathlib import Path @@ -16,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("VenusTZPkg") ArchSupported = ("ARM") TargetsSupported = ("DEBUG", "RELEASE") @@ -46,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("VenusTZPkg/VenusTZ.dsc", {}) - def GetName(self): + def GetName (self): return "VenusTZ" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="ARM", - help="Optional - CSV of architecture to build. ARM is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="ARM", help="Optional - CSV of architecture to build. ARM is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "ARM": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "VenusTZPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "VenusTZ", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "VenusTZPkg/VenusTZ.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "ARM", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") - self.env.SetValue("BLD_*_DEVICE_MODEL", self.env.GetValue("DEVICE_MODEL"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "VenusTZ", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "VenusTZPkg/VenusTZ.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "ARM", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -240,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Lenovo/VenusTZPkg/VenusTZ.dec b/Platforms/Lenovo/VenusTZPkg/VenusTZ.dec index cec8bf348..e69de29bb 100644 --- a/Platforms/Lenovo/VenusTZPkg/VenusTZ.dec +++ b/Platforms/Lenovo/VenusTZPkg/VenusTZ.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = VenusTZ - PACKAGE_GUID = F9287658-DC58-4EE4-9606-9A3CFE9A0105 - PACKAGE_VERSION = 1.0 - -[Guids] - gVenusTZTokenSpaceGuid = { 0xF9287658, 0xDC58, 0x4EE4, { 0x96, 0x06, 0x9A, 0x3C, 0xFE, 0x9A, 0x01, 0x05 } } diff --git a/Platforms/Lenovo/VenusTZPkg/VenusTZ.dsc b/Platforms/Lenovo/VenusTZPkg/VenusTZ.dsc index da383c04b..c0dc352f6 100644 --- a/Platforms/Lenovo/VenusTZPkg/VenusTZ.dsc +++ b/Platforms/Lenovo/VenusTZPkg/VenusTZ.dsc @@ -26,14 +26,18 @@ USE_CUSTOM_DISPLAY_DRIVER = 0 HAS_BUILD_IN_KEYBOARD = 1 + # # 0 = T30L # 1 = T30 # 2 = AP33 # 3 = T33 + # SOC_TYPE = 1 + # # 0 = DDR3-L # 1 = LPDDR2 + # RAM_MODEL = 0 [BuildOptions] @@ -49,7 +53,7 @@ gArmTokenSpaceGuid.PcdSystemMemorySize|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"No Maintainer" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"No Maintainer" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80200000 diff --git a/Platforms/Lenovo/j706fPkg/Include/RAW.inc b/Platforms/Lenovo/j706fPkg/Include/RAW.inc index 5ce2f6de7..797f7e07e 100644 --- a/Platforms/Lenovo/j706fPkg/Include/RAW.inc +++ b/Platforms/Lenovo/j706fPkg/Include/RAW.inc @@ -1,129 +1,79 @@ FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { - SECTION UI = "BDS_Menu.cfg" - SECTION RAW = Binaries/j706f/RawFiles/BDS_Menu.cfg - } - - FILE FREEFORM = A91D838E-A5FA-4138-825D-455E23030794 { - SECTION UI = "logo1.bmp" - SECTION RAW = Binaries/j706f/RawFiles/logo1.bmp + SECTION UI = "BDS_Menu.cfg" + SECTION RAW = Binaries/j706f/RawFiles/BDS_Menu.cfg } FILE FREEFORM = A1ACFF5E-33C7-4B09-890B-3C181D93CB11 { - SECTION UI = "Panel_rm69380_amoled_2k_cmd.xml" - SECTION RAW = Binaries/j706f/RawFiles/Panel_rm69380_amoled_2k_cmd.xml + SECTION UI = "Panel_rm69380_amoled_2k_cmd.xml" + SECTION RAW = Binaries/j706f/RawFiles/Panel_rm69380_amoled_2k_cmd.xml } FILE FREEFORM = 001E2FB8-93E7-4067-B52F-15D1C1E32664 { - SECTION UI = "Panel_rm69380_amoled_2k_video.xml" - SECTION RAW = Binaries/j706f/RawFiles/Panel_rm69380_amoled_2k_video.xml + SECTION UI = "Panel_rm69380_amoled_2k_video.xml" + SECTION RAW = Binaries/j706f/RawFiles/Panel_rm69380_amoled_2k_video.xml } FILE FREEFORM = E1310705-BB36-474C-B6EB-4861125C96E9 { - SECTION UI = "Panel_rm692e6_amoled_2k_cmd.xml" - SECTION RAW = Binaries/j706f/RawFiles/Panel_rm692e6_amoled_2k_cmd.xml + SECTION UI = "Panel_rm692e6_amoled_2k_cmd.xml" + SECTION RAW = Binaries/j706f/RawFiles/Panel_rm692e6_amoled_2k_cmd.xml } FILE FREEFORM = 88CA5ABF-D0AC-4093-A68C-0CFAE1EF9635 { - SECTION UI = "Panel_boe_amoled_wqhd_dsc_cmd.xml" - SECTION RAW = Binaries/j706f/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd.xml + SECTION UI = "Panel_boe_amoled_wqhd_dsc_cmd.xml" + SECTION RAW = Binaries/j706f/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd.xml } FILE FREEFORM = 45A8FDA2-4FAD-4234-BCDA-D1778611CE13 { - SECTION UI = "Panel_boe_amoled_wqhd_dsc_vid.xml" - SECTION RAW = Binaries/j706f/RawFiles/Panel_boe_amoled_wqhd_dsc_vid.xml + SECTION UI = "Panel_boe_amoled_wqhd_dsc_vid.xml" + SECTION RAW = Binaries/j706f/RawFiles/Panel_boe_amoled_wqhd_dsc_vid.xml } FILE FREEFORM = 92FA25C1-5EDD-4328-8924-A66F25F82500 { - SECTION UI = "Panel_boe_amoled_fhd_plus_dsc_cmd.xml" - SECTION RAW = Binaries/j706f/RawFiles/Panel_boe_amoled_fhd_plus_dsc_cmd.xml + SECTION UI = "Panel_boe_amoled_fhd_plus_dsc_cmd.xml" + SECTION RAW = Binaries/j706f/RawFiles/Panel_boe_amoled_fhd_plus_dsc_cmd.xml } FILE FREEFORM = 6343A5E1-E477-452A-B62C-1560C4CBD9F5 { - SECTION UI = "Panel_secondary_truly_1080p_cmd.xml" - SECTION RAW = Binaries/j706f/RawFiles/Panel_secondary_truly_1080p_cmd.xml + SECTION UI = "Panel_secondary_truly_1080p_cmd.xml" + SECTION RAW = Binaries/j706f/RawFiles/Panel_secondary_truly_1080p_cmd.xml } FILE FREEFORM = 151C5D22-957F-4861-A605-E27154BBDA25 { - SECTION UI = "Panel_secondary_truly_1080p_vid.xml" - SECTION RAW = Binaries/j706f/RawFiles/Panel_secondary_truly_1080p_vid.xml + SECTION UI = "Panel_secondary_truly_1080p_vid.xml" + SECTION RAW = Binaries/j706f/RawFiles/Panel_secondary_truly_1080p_vid.xml } FILE FREEFORM = 0155F46D-AE6B-45F3-9273-ED5234366857 { - SECTION UI = "Panel_sharp_wqhd_dualdsi_cmd.xml" - SECTION RAW = Binaries/j706f/RawFiles/Panel_sharp_wqhd_dualdsi_cmd.xml + SECTION UI = "Panel_sharp_wqhd_dualdsi_cmd.xml" + SECTION RAW = Binaries/j706f/RawFiles/Panel_sharp_wqhd_dualdsi_cmd.xml } FILE FREEFORM = 6AA4C932-31FA-4136-9F8F-0954BB55C2F3 { - SECTION UI = "Panel_sharp_wqhd_dualdsi_vid.xml" - SECTION RAW = Binaries/j706f/RawFiles/Panel_sharp_wqhd_dualdsi_vid.xml + SECTION UI = "Panel_sharp_wqhd_dualdsi_vid.xml" + SECTION RAW = Binaries/j706f/RawFiles/Panel_sharp_wqhd_dualdsi_vid.xml } FILE FREEFORM = CF65ABBD-9041-464B-84F4-2ACD1AC44A0D { - SECTION UI = "Panel_sharp_qsync_fhd_vid.xml" - SECTION RAW = Binaries/j706f/RawFiles/Panel_sharp_qsync_fhd_vid.xml + SECTION UI = "Panel_sharp_qsync_fhd_vid.xml" + SECTION RAW = Binaries/j706f/RawFiles/Panel_sharp_qsync_fhd_vid.xml } FILE FREEFORM = F898317F-88CE-4839-89ED-B80E94E4CBBC { - SECTION UI = "Panel_sharp_qsync_fhd_cmd.xml" - SECTION RAW = Binaries/j706f/RawFiles/Panel_sharp_qsync_fhd_cmd.xml - } - - FILE FREEFORM = 3E5584ED-05D4-4267-9048-0D47F76F4248 { - SECTION UI = "battery_symbol_Soc10.bmp" - SECTION RAW = Binaries/j706f/RawFiles/battery_symbol_Soc10.bmp - } - - FILE FREEFORM = 4753E815-DDD8-402D-BF69-9B8C4EB7573E { - SECTION UI = "battery_symbol_NoBattery.bmp" - SECTION RAW = Binaries/j706f/RawFiles/battery_symbol_NoBattery.bmp - } - - FILE FREEFORM = 03DED53E-BECD-428F-9F79-5ABA64C58445 { - SECTION UI = "battery_symbol_Nocharger.bmp" - SECTION RAW = Binaries/j706f/RawFiles/battery_symbol_Nocharger.bmp - } - - FILE FREEFORM = 8B86CD38-C772-4FCF-85AA-345B2B3C1AB4 { - SECTION UI = "battery_symbol_LowBatteryCharging.bmp" - SECTION RAW = Binaries/j706f/RawFiles/battery_symbol_LowBatteryCharging.bmp - } - - FILE FREEFORM = 3FD97907-93F1-4349-AF3C-3B68B0A5E626 { - SECTION UI = "battery_symbol_LowBattery.bmp" - SECTION RAW = Binaries/j706f/RawFiles/battery_symbol_LowBattery.bmp - } - - FILE FREEFORM = E2EA5A4F-98BD-4203-AB49-399505DDFB7D { - SECTION UI = "tsens_thermal_symbol.bmp" - SECTION RAW = Binaries/j706f/RawFiles/tsens_thermal_symbol.bmp - } - - FILE FREEFORM = C72FB1A9-5527-4E13-BAC4-F671D0330145 { - SECTION UI = "tsens_thermal_err_symbol.bmp" - SECTION RAW = Binaries/j706f/RawFiles/tsens_thermal_err_symbol.bmp - } - - FILE FREEFORM = B0F8D1BE-5353-4812-B1F6-07E7768204CC { - SECTION UI = "battery_symbol_DebugBoot.bmp" - SECTION RAW = Binaries/j706f/RawFiles/battery_symbol_DebugBoot.bmp - } - - FILE FREEFORM = F9E8F683-E065-4E09-B4F9-0230D7CECD08 { - SECTION UI = "battery_symbol_DebugStay.bmp" - SECTION RAW = Binaries/j706f/RawFiles/battery_symbol_DebugStay.bmp + SECTION UI = "Panel_sharp_qsync_fhd_cmd.xml" + SECTION RAW = Binaries/j706f/RawFiles/Panel_sharp_qsync_fhd_cmd.xml } FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { - SECTION UI = "SecParti.cfg" - SECTION RAW = Binaries/j706f/RawFiles/SecParti.cfg + SECTION UI = "SecParti.cfg" + SECTION RAW = Binaries/j706f/RawFiles/SecParti.cfg } FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { - SECTION UI = "uefipil.cfg" - SECTION RAW = Binaries/j706f/RawFiles/uefipil.cfg + SECTION UI = "uefipil.cfg" + SECTION RAW = Binaries/j706f/RawFiles/uefipil.cfg } FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { - SECTION UI = "QcomChargerCfg.cfg" - SECTION RAW = Binaries/j706f/RawFiles/QcomChargerCfg.cfg - } \ No newline at end of file + SECTION UI = "QcomChargerCfg.cfg" + SECTION RAW = Binaries/j706f/RawFiles/QcomChargerCfg.cfg + } diff --git a/Platforms/Lenovo/j706fPkg/PlatformBuild.py b/Platforms/Lenovo/j706fPkg/PlatformBuild.py index 1f42ca202..42927d543 100644 --- a/Platforms/Lenovo/j706fPkg/PlatformBuild.py +++ b/Platforms/Lenovo/j706fPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Lenovo Tab P11 Pro UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("j706fPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("j706fPkg/j706f.dsc", {}) - def GetName(self): + def GetName (self): return "j706f" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "j706fPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "j706f", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "j706fPkg/j706f.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "j706f", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "j706fPkg/j706f.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Lenovo/j706fPkg/j706f.dec b/Platforms/Lenovo/j706fPkg/j706f.dec index e1bfed815..e69de29bb 100644 --- a/Platforms/Lenovo/j706fPkg/j706f.dec +++ b/Platforms/Lenovo/j706fPkg/j706f.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = j706f - PACKAGE_GUID = EC1C4ABA-C35E-404F-B515-E616D5AA9BFF - PACKAGE_VERSION = 0.1 - -[Guids] - gj706fTokenSpaceGuid = { 0xEC1C4ABA, 0xC35E, 0x404F, { 0xB5, 0x15, 0xE6, 0x16, 0xD5, 0xAA, 0x9B, 0xFF } } diff --git a/Platforms/Lenovo/j706fPkg/j706f.dsc b/Platforms/Lenovo/j706fPkg/j706f.dsc index 3d7642dd9..546b34701 100644 --- a/Platforms/Lenovo/j706fPkg/j706f.dsc +++ b/Platforms/Lenovo/j706fPkg/j706f.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM7150-AA # 1 = SM7150-AB # 2 = SM7150-AC + # SOC_TYPE = 1 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"CloudSweets" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"CloudSweets" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xA2370000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Microsoft/oemkPkg/PlatformBuild.py b/Platforms/Microsoft/oemkPkg/PlatformBuild.py index b3d4ee19c..a2fa76eee 100644 --- a/Platforms/Microsoft/oemkPkg/PlatformBuild.py +++ b/Platforms/Microsoft/oemkPkg/PlatformBuild.py @@ -1,6 +1,4 @@ ## -# Script to Build Surface RT UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -9,6 +7,7 @@ import logging import os import uuid + from io import StringIO from pathlib import Path @@ -16,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("oemkPkg") ArchSupported = ("ARM") TargetsSupported = ("DEBUG", "RELEASE") @@ -46,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("oemkPkg/oemk.dsc", {}) - def GetName(self): + def GetName (self): return "oemk" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="ARM", - help="Optional - CSV of architecture to build. ARM is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="ARM", help="Optional - CSV of architecture to build. ARM is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "ARM": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "oemkPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "oemk", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "oemkPkg/oemk.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "ARM", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") - self.env.SetValue("BLD_*_DEVICE_MODEL", self.env.GetValue("DEVICE_MODEL"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "oemk", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "oemkPkg/oemk.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "ARM", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -240,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Microsoft/oemkPkg/oemk.dec b/Platforms/Microsoft/oemkPkg/oemk.dec index 7da0dff55..e69de29bb 100644 --- a/Platforms/Microsoft/oemkPkg/oemk.dec +++ b/Platforms/Microsoft/oemkPkg/oemk.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = oemk - PACKAGE_GUID = B4DCB236-A5F5-411D-91F4-E446D4A8D2E8 - PACKAGE_VERSION = 1.0 - -[Guids] - goemkTokenSpaceGuid = { 0xB4DCB236, 0xA5F5, 0x411D, { 0x91, 0xF4, 0xE4, 0x46, 0xD4, 0xA8, 0xD2, 0xE8 } } diff --git a/Platforms/Microsoft/oemkPkg/oemk.dsc b/Platforms/Microsoft/oemkPkg/oemk.dsc index dbae79f34..c3284a4a5 100644 --- a/Platforms/Microsoft/oemkPkg/oemk.dsc +++ b/Platforms/Microsoft/oemkPkg/oemk.dsc @@ -26,14 +26,18 @@ USE_CUSTOM_DISPLAY_DRIVER = 0 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = T30L # 1 = T30 # 2 = AP33 # 3 = T33 + # SOC_TYPE = 1 + # # 0 = DDR3-L # 1 = LPDDR2 + # RAM_MODEL = 1 [BuildOptions] @@ -48,7 +52,7 @@ gArmTokenSpaceGuid.PcdSystemMemorySize|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"No Maintainer" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"No Maintainer" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80200000 diff --git a/Platforms/Motorola/capripPkg/Include/APRIORI.inc b/Platforms/Motorola/capripPkg/Include/APRIORI.inc index 54fb7e1ab..d8f054614 100644 --- a/Platforms/Motorola/capripPkg/Include/APRIORI.inc +++ b/Platforms/Motorola/capripPkg/Include/APRIORI.inc @@ -20,7 +20,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/caprip/MbmPkg/Core/Drivers/MotBootFlagsDxe/MotBootFlagsDxe.inf INF Binaries/caprip/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Motorola/capripPkg/Include/DXE.inc b/Platforms/Motorola/capripPkg/Include/DXE.inc index 6b9311f83..cf62f7d13 100644 --- a/Platforms/Motorola/capripPkg/Include/DXE.inc +++ b/Platforms/Motorola/capripPkg/Include/DXE.inc @@ -36,7 +36,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/caprip/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/caprip/QcomPkg/Drivers/GLinkDxe/GLinkDxe.inf diff --git a/Platforms/Motorola/capripPkg/Include/RAW.inc b/Platforms/Motorola/capripPkg/Include/RAW.inc index 3a2eedfdf..8485acde9 100644 --- a/Platforms/Motorola/capripPkg/Include/RAW.inc +++ b/Platforms/Motorola/capripPkg/Include/RAW.inc @@ -21,4 +21,4 @@ FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/caprip/RawFiles/BATTERY.PROVISION - } \ No newline at end of file + } diff --git a/Platforms/Motorola/capripPkg/PlatformBuild.py b/Platforms/Motorola/capripPkg/PlatformBuild.py index 6e554c35e..43b3da906 100644 --- a/Platforms/Motorola/capripPkg/PlatformBuild.py +++ b/Platforms/Motorola/capripPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Motorola Moto G30 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("capripPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("capripPkg/caprip.dsc", {}) - def GetName(self): + def GetName (self): return "caprip" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "capripPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "caprip", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "capripPkg/caprip.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "caprip", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "capripPkg/caprip.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Motorola/capripPkg/caprip.dec b/Platforms/Motorola/capripPkg/caprip.dec index 4397ce8d9..e69de29bb 100644 --- a/Platforms/Motorola/capripPkg/caprip.dec +++ b/Platforms/Motorola/capripPkg/caprip.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = caprip - PACKAGE_GUID = 01132323-0EEB-46B1-A847-680594920C62 - PACKAGE_VERSION = 1.0 - -[Guids] - gcapripTokenSpaceGuid = { 0x01132323, 0x0EEB, 0x46B1, { 0xA8, 0x47, 0x68, 0x05, 0x94, 0x92, 0x0C, 0x62 } } diff --git a/Platforms/Motorola/capripPkg/caprip.dsc b/Platforms/Motorola/capripPkg/caprip.dsc index 8344f1f06..5f1e27496 100644 --- a/Platforms/Motorola/capripPkg/caprip.dsc +++ b/Platforms/Motorola/capripPkg/caprip.dsc @@ -39,7 +39,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"No Maintainer" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"No Maintainer" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x5FF8C000 @@ -64,7 +64,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0x68900000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Motorola/cebuPkg/Include/APRIORI.inc b/Platforms/Motorola/cebuPkg/Include/APRIORI.inc index c986c5e0b..eb4458344 100644 --- a/Platforms/Motorola/cebuPkg/Include/APRIORI.inc +++ b/Platforms/Motorola/cebuPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/cebu/MbmPkg/Core/Drivers/MotBootFlagsDxe/MotBootFlagsDxe.inf INF Binaries/cebu/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Motorola/cebuPkg/Include/DXE.inc b/Platforms/Motorola/cebuPkg/Include/DXE.inc index 3ccb52a86..e4caaa761 100644 --- a/Platforms/Motorola/cebuPkg/Include/DXE.inc +++ b/Platforms/Motorola/cebuPkg/Include/DXE.inc @@ -36,7 +36,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/cebu/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/cebu/QcomPkg/Drivers/GLinkDxe/GLinkDxe.inf diff --git a/Platforms/Motorola/cebuPkg/Include/RAW.inc b/Platforms/Motorola/cebuPkg/Include/RAW.inc index 31d138af5..75d1a545e 100644 --- a/Platforms/Motorola/cebuPkg/Include/RAW.inc +++ b/Platforms/Motorola/cebuPkg/Include/RAW.inc @@ -1,33 +1,24 @@ -FILE FREEFORM = DDE58710-41CD-4306-DBFB-3FA90BB1D2DD { - SECTION UI = "uefiplat.cfg" - SECTION RAW = Binaries/cebu/RawFiles/uefiplat.cfg -} - -FILE FREEFORM = 9BAE75D9-A217-4B31-9DCD-00D2609B6784 { + FILE FREEFORM = 9BAE75D9-A217-4B31-9DCD-00D2609B6784 { SECTION UI = "Panel_truly_nt36525_hd_plus_vid.xml" SECTION RAW = Binaries/cebu/RawFiles/Panel_truly_nt36525_hd_plus_vid.xml -} - + } -FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { + FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { SECTION UI = "SecParti.cfg" SECTION RAW = Binaries/cebu/RawFiles/SecParti.cfg -} - + } -FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { + FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { SECTION UI = "uefipil.cfg" SECTION RAW = Binaries/cebu/RawFiles/uefipil.cfg -} + } - -FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { + FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { SECTION UI = "QcomChargerCfg.cfg" SECTION RAW = Binaries/cebu/RawFiles/QcomChargerCfg.cfg -} - + } -FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { + FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/cebu/RawFiles/BATTERY.PROVISION -} + } diff --git a/Platforms/Motorola/cebuPkg/PlatformBuild.py b/Platforms/Motorola/cebuPkg/PlatformBuild.py index 79085df37..59185942e 100644 --- a/Platforms/Motorola/cebuPkg/PlatformBuild.py +++ b/Platforms/Motorola/cebuPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Motorola Moto G30 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("cebuPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -42,195 +38,138 @@ class CommonPlatform(): "Mu_Basecore", "Silicon/Arm/Mu_Tiano", "Silicon/Qualcomm", - "Silicon/Silicium", - "Binaries" + "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("cebuPkg/cebu.dsc", {}) - def GetName(self): + def GetName (self): return "cebu" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "cebuPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "cebu", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "cebuPkg/cebu.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "cebu", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "cebuPkg/cebu.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -240,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Motorola/cebuPkg/cebu.dec b/Platforms/Motorola/cebuPkg/cebu.dec index 5c69c6a15..e69de29bb 100644 --- a/Platforms/Motorola/cebuPkg/cebu.dec +++ b/Platforms/Motorola/cebuPkg/cebu.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = cebu - PACKAGE_GUID = e121c9cc-0f2f-4eac-afea-5df772c806ef - PACKAGE_VERSION = 1.0 - -[Guids] - gcapripTokenSpaceGuid = { 0x01132323, 0x0EEB, 0x46B1, { 0xA8, 0x47, 0x68, 0x05, 0x94, 0x92, 0x0C, 0x62 } } diff --git a/Platforms/Motorola/cebuPkg/cebu.dsc b/Platforms/Motorola/cebuPkg/cebu.dsc index 028ca245f..fd3d61639 100644 --- a/Platforms/Motorola/cebuPkg/cebu.dsc +++ b/Platforms/Motorola/cebuPkg/cebu.dsc @@ -41,7 +41,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"remtrik, hiprivsid" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"remtrik, hiprivsid" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x5FF8C000 @@ -66,7 +66,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0x60000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Nintendo/HAC-001Pkg/HAC-001.dec b/Platforms/Nintendo/HAC-001Pkg/HAC-001.dec index bf87211b5..e69de29bb 100644 --- a/Platforms/Nintendo/HAC-001Pkg/HAC-001.dec +++ b/Platforms/Nintendo/HAC-001Pkg/HAC-001.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = HAC-001 - PACKAGE_GUID = 2FA9729E-6BED-4F30-ACDD-8EB3C1B4ACA5 - PACKAGE_VERSION = 1.0 - -[Guids] - gHAC-001TokenSpaceGuid = { 0x2FA9729E, 0x6BED, 0x4F30, { 0xAC, 0xDD, 0x8E, 0xB3, 0xC1, 0xB4, 0xAC, 0xA5 } } diff --git a/Platforms/Nintendo/HAC-001Pkg/HAC-001.dsc b/Platforms/Nintendo/HAC-001Pkg/HAC-001.dsc index b20e907d6..0f482bce1 100644 --- a/Platforms/Nintendo/HAC-001Pkg/HAC-001.dsc +++ b/Platforms/Nintendo/HAC-001Pkg/HAC-001.dsc @@ -26,6 +26,7 @@ USE_CUSTOM_DISPLAY_DRIVER = 0 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = ODNX02-A2 # 1 = TM670D-A1 # 2 = TM670M-A2 @@ -33,6 +34,7 @@ # 4 = TM660M-A2 # 5 = ODNX10-A1 # 6 = TM675M-A1 + # !if $(DEVICE_MODEL) == 0 SOC_TYPE = 0 !elseif $(DEVICE_MODEL) == 1 @@ -54,7 +56,7 @@ gArmTokenSpaceGuid.PcdSystemMemorySize|0x100000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Robotix22" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Robotix22" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80200000 diff --git a/Platforms/Nintendo/HAC-001Pkg/Include/APRIORI.inc b/Platforms/Nintendo/HAC-001Pkg/Include/APRIORI.inc index 65ac887db..dd052faac 100644 --- a/Platforms/Nintendo/HAC-001Pkg/Include/APRIORI.inc +++ b/Platforms/Nintendo/HAC-001Pkg/Include/APRIORI.inc @@ -14,7 +14,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF NvidiaPkg/GPLDrivers/TegraGpioDxe/TegraGpioDxe.inf diff --git a/Platforms/Nintendo/HAC-001Pkg/Include/DXE.inc b/Platforms/Nintendo/HAC-001Pkg/Include/DXE.inc index f57dda704..ee3a8895c 100644 --- a/Platforms/Nintendo/HAC-001Pkg/Include/DXE.inc +++ b/Platforms/Nintendo/HAC-001Pkg/Include/DXE.inc @@ -21,7 +21,6 @@ INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF NvidiaPkg/GPLDrivers/TegraGpioDxe/TegraGpioDxe.inf diff --git a/Platforms/Nintendo/HAC-001Pkg/PlatformBuild.py b/Platforms/Nintendo/HAC-001Pkg/PlatformBuild.py index 5f9e2028a..c33aa0094 100644 --- a/Platforms/Nintendo/HAC-001Pkg/PlatformBuild.py +++ b/Platforms/Nintendo/HAC-001Pkg/PlatformBuild.py @@ -1,6 +1,4 @@ ## -# Script to Build Nintendo Switch UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -9,6 +7,7 @@ import logging import os import uuid + from io import StringIO from pathlib import Path @@ -16,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("HAC-001Pkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -46,191 +41,136 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("HAC-001Pkg/HAC-001.dsc", {}) - def GetName(self): + def GetName (self): return "HAC-001" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "HAC-001Pkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "HAC-001", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "HAC-001Pkg/HAC-001.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_DEVICE_MODEL", self.env.GetValue("DEVICE_MODEL"), "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "HAC-001", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "HAC-001Pkg/HAC-001.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_DEVICE_MODEL", self.env.GetValue("DEVICE_MODEL"), "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -240,17 +180,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Nothing/pongPkg/Include/APRIORI.inc b/Platforms/Nothing/pongPkg/Include/APRIORI.inc index 67e510df1..81fc6773c 100644 --- a/Platforms/Nothing/pongPkg/Include/APRIORI.inc +++ b/Platforms/Nothing/pongPkg/Include/APRIORI.inc @@ -16,7 +16,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/pong/QcomPkg/Drivers/SmemDxe/SmemDxe.inf @@ -68,7 +67,7 @@ APRIORI DXE { INF Binaries/pong/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.inf INF Binaries/pong/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.inf -!if $(USE_DISPLAYDXE) == 1 +!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1 INF Binaries/pong/QcomPkg/Drivers/DisplayDxe/DisplayDxe.inf !else INF SiliciumPkg/Drivers/SimpleFbDxe/SimpleFbDxe.inf @@ -111,7 +110,7 @@ APRIORI DXE { INF Binaries/pong/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.inf INF Binaries/pong/QcomPkg/Drivers/TsensDxe/TsensDxe.inf INF Binaries/pong/QcomPkg/Drivers/LimitsDxe/LimitsDxe.inf -!if $(USE_DISPLAYDXE) == 1 +!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1 INF Binaries/pong/QcomPkg/Drivers/CPRDxe/CPRDxe.inf !endif INF Binaries/pong/QcomPkg/Drivers/GpiDxe/GpiDxe.inf diff --git a/Platforms/Nothing/pongPkg/Include/DXE.inc b/Platforms/Nothing/pongPkg/Include/DXE.inc index 879ebb388..bd060e5e7 100644 --- a/Platforms/Nothing/pongPkg/Include/DXE.inc +++ b/Platforms/Nothing/pongPkg/Include/DXE.inc @@ -27,7 +27,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/pong/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/pong/QcomPkg/Drivers/IPCCDxe/IPCCDxe.inf @@ -74,7 +73,7 @@ INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf -!if $(USE_DISPLAYDXE) == 1 +!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1 INF Binaries/pong/QcomPkg/Drivers/CPRDxe/CPRDxe.inf !endif INF Binaries/pong/QcomPkg/Drivers/GpiDxe/GpiDxe.inf @@ -82,7 +81,7 @@ INF Binaries/pong/QcomPkg/Drivers/SdccDxe/SdccDxe.inf #INF Binaries/pong/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.inf -!if $(USE_DISPLAYDXE) == 1 +!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1 INF Binaries/pong/QcomPkg/Drivers/DisplayDxe/DisplayDxe.inf !else INF SiliciumPkg/Drivers/SimpleFbDxe/SimpleFbDxe.inf diff --git a/Platforms/Nothing/pongPkg/PlatformBuild.py b/Platforms/Nothing/pongPkg/PlatformBuild.py index 521615d8a..92ad4fa9c 100644 --- a/Platforms/Nothing/pongPkg/PlatformBuild.py +++ b/Platforms/Nothing/pongPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Nothing Phone 2 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("pongPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("pongPkg/pong.dsc", {}) - def GetName(self): + def GetName (self): return "pong" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "pongPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "pong", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "pongPkg/pong.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to CLANGDWARF") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "pong", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "pongPkg/pong.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Nothing/pongPkg/pong.dec b/Platforms/Nothing/pongPkg/pong.dec index 58875369a..e69de29bb 100644 --- a/Platforms/Nothing/pongPkg/pong.dec +++ b/Platforms/Nothing/pongPkg/pong.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = pong - PACKAGE_GUID = B1604F78-DF37-4803-8BC0-BEF397B882B9 - PACKAGE_VERSION = 0.1 - -[Guids] - gpongTokenSpaceGuid = { 0xB1604F78, 0xDF37, 0x4803, { 0x8B, 0xC0, 0xBE, 0xF3, 0x97, 0xB8, 0x82, 0xB9 } } \ No newline at end of file diff --git a/Platforms/Nothing/pongPkg/pong.dsc b/Platforms/Nothing/pongPkg/pong.dsc index d57e154c2..d9f3704d9 100644 --- a/Platforms/Nothing/pongPkg/pong.dsc +++ b/Platforms/Nothing/pongPkg/pong.dsc @@ -23,11 +23,13 @@ BUILD_TARGETS = RELEASE|DEBUG SKUID_IDENTIFIER = DEFAULT FLASH_DEFINITION = pongPkg/pong.fdf - USE_DISPLAYDXE = 0 + USE_CUSTOM_DISPLAY_DRIVER = 0 AB_SLOT_SUPPORT = 1 + # # 0 = SM8450 # 1 = SM8475 + # SOC_TYPE = 1 [BuildOptions] @@ -42,7 +44,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"govro150" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"govro150" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0xA7600000 @@ -71,7 +73,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xFFC00000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/OnePlus/hotdogPkg/Include/APRIORI.inc b/Platforms/OnePlus/hotdogPkg/Include/APRIORI.inc index 5deec7fb1..ec8000c78 100644 --- a/Platforms/OnePlus/hotdogPkg/Include/APRIORI.inc +++ b/Platforms/OnePlus/hotdogPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF Binaries/hotdog/EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/hotdog/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/OnePlus/hotdogPkg/Include/DXE.inc b/Platforms/OnePlus/hotdogPkg/Include/DXE.inc index 0be1314b1..6a4a1dcf0 100644 --- a/Platforms/OnePlus/hotdogPkg/Include/DXE.inc +++ b/Platforms/OnePlus/hotdogPkg/Include/DXE.inc @@ -31,7 +31,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/hotdog/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/hotdog/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/OnePlus/hotdogPkg/Include/RAW.inc b/Platforms/OnePlus/hotdogPkg/Include/RAW.inc index 81233be7c..f89660235 100644 --- a/Platforms/OnePlus/hotdogPkg/Include/RAW.inc +++ b/Platforms/OnePlus/hotdogPkg/Include/RAW.inc @@ -156,4 +156,4 @@ FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/hotdog/RawFiles/BATTERY.PROVISION - } \ No newline at end of file + } diff --git a/Platforms/OnePlus/hotdogPkg/PlatformBuild.py b/Platforms/OnePlus/hotdogPkg/PlatformBuild.py index b7a146605..6b4a1c097 100644 --- a/Platforms/OnePlus/hotdogPkg/PlatformBuild.py +++ b/Platforms/OnePlus/hotdogPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build OnePlus 7T Pro UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("hotdogPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("hotdogPkg/hotdog.dsc", {}) - def GetName(self): + def GetName (self): return "hotdog" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "hotdogPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "hotdog", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "hotdogPkg/hotdog.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "hotdog", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "hotdogPkg/hotdog.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/OnePlus/hotdogPkg/hotdog.dec b/Platforms/OnePlus/hotdogPkg/hotdog.dec index e055b0ccd..e69de29bb 100644 --- a/Platforms/OnePlus/hotdogPkg/hotdog.dec +++ b/Platforms/OnePlus/hotdogPkg/hotdog.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = hotdog - PACKAGE_GUID = 7B23C557-6BF5-4120-B9C7-8F9CB2137A00 - PACKAGE_VERSION = 0.1 - -[Guids] - ghotdogTokenSpaceGuid = { 0x7B23C557, 0x6BF5, 0x4120, { 0xB9, 0xC7, 0x8F, 0x9C, 0xB2, 0x13, 0x7A, 0x00 } } diff --git a/Platforms/OnePlus/hotdogPkg/hotdog.dsc b/Platforms/OnePlus/hotdogPkg/hotdog.dsc index 78133c74a..f5bd54d75 100644 --- a/Platforms/OnePlus/hotdogPkg/hotdog.dsc +++ b/Platforms/OnePlus/hotdogPkg/hotdog.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8150 # 1 = SM8150-AB # 2 = SM8150-AC + # SOC_TYPE = 1 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"No Maintainer" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"No Maintainer" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xB9400000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/OnePlus/kebabPkg/Include/APRIORI.inc b/Platforms/OnePlus/kebabPkg/Include/APRIORI.inc index 331a363f1..28e9e2f26 100644 --- a/Platforms/OnePlus/kebabPkg/Include/APRIORI.inc +++ b/Platforms/OnePlus/kebabPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/kebab/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/OnePlus/kebabPkg/Include/DXE.inc b/Platforms/OnePlus/kebabPkg/Include/DXE.inc index 75324d60c..d0e5ce15e 100644 --- a/Platforms/OnePlus/kebabPkg/Include/DXE.inc +++ b/Platforms/OnePlus/kebabPkg/Include/DXE.inc @@ -30,7 +30,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/kebab/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/kebab/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/OnePlus/kebabPkg/Include/RAW.inc b/Platforms/OnePlus/kebabPkg/Include/RAW.inc index bf3ac7788..47f73ff8c 100644 --- a/Platforms/OnePlus/kebabPkg/Include/RAW.inc +++ b/Platforms/OnePlus/kebabPkg/Include/RAW.inc @@ -146,4 +146,4 @@ FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/kebab/RawFiles/BATTERY.PROVISION - } \ No newline at end of file + } diff --git a/Platforms/OnePlus/kebabPkg/PlatformBuild.py b/Platforms/OnePlus/kebabPkg/PlatformBuild.py index 220237a41..0eec58230 100644 --- a/Platforms/OnePlus/kebabPkg/PlatformBuild.py +++ b/Platforms/OnePlus/kebabPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build OnePlus 8T UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("kebabPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("kebabPkg/kebab.dsc", {}) - def GetName(self): + def GetName (self): return "kebab" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "kebabPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "kebab", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "kebabPkg/kebab.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "kebab", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "kebabPkg/kebab.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/OnePlus/kebabPkg/kebab.dec b/Platforms/OnePlus/kebabPkg/kebab.dec index b5f4e8d5e..e69de29bb 100644 --- a/Platforms/OnePlus/kebabPkg/kebab.dec +++ b/Platforms/OnePlus/kebabPkg/kebab.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = kebab - PACKAGE_GUID = B8DF34E2-F093-45ED-A3EF-F2BDC4128DAA - PACKAGE_VERSION = 0.1 - -[Guids] - gkebabTokenSpaceGuid = { 0xB8DF34E2, 0xF093, 0x45ED, { 0xA3, 0xEF, 0xF2, 0xBD, 0xC4, 0x12, 0x8D, 0xAA } } diff --git a/Platforms/OnePlus/kebabPkg/kebab.dsc b/Platforms/OnePlus/kebabPkg/kebab.dsc index cf814a973..9d4fda6d1 100644 --- a/Platforms/OnePlus/kebabPkg/kebab.dsc +++ b/Platforms/OnePlus/kebabPkg/kebab.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8250 # 1 = SM8250-AB # 2 = SM8250-AC + # SOC_TYPE = 0 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"No Maintainer" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"No Maintainer" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xB4500000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Realme/bitraPkg/Include/DXE.inc b/Platforms/Realme/bitraPkg/Include/DXE.inc index 972e3843f..f91e604c0 100644 --- a/Platforms/Realme/bitraPkg/Include/DXE.inc +++ b/Platforms/Realme/bitraPkg/Include/DXE.inc @@ -30,7 +30,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/bitra/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/bitra/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Realme/bitraPkg/Include/RAW.inc b/Platforms/Realme/bitraPkg/Include/RAW.inc index f4ff84738..38bddb3ba 100644 --- a/Platforms/Realme/bitraPkg/Include/RAW.inc +++ b/Platforms/Realme/bitraPkg/Include/RAW.inc @@ -1,244 +1,244 @@ -FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { - SECTION UI = "BDS_Menu.cfg" - SECTION RAW = Binaries/bitra/RawFiles/BDS_Menu.cfg -} - -FILE FREEFORM = 8CAE2C55-FC5A-410B-812B-8CA22F572F36 { - SECTION UI = "Panel_truly_wqxga_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_truly_wqxga_dsc_cmd.xml -} - -FILE FREEFORM = 13AC9DC9-0092-4374-AE1A-06FF35950FD0 { - SECTION UI = "Panel_truly_wqxga_dsc_vid.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_truly_wqxga_dsc_vid.xml -} - -FILE FREEFORM = FC6315F9-F8FE-4222-A1E3-226DF55D7592 { - SECTION UI = "Panel_truly_wqxga_dual_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_truly_wqxga_dual_cmd.xml -} - -FILE FREEFORM = 95E7B040-26A2-4511-9ABB-1D95D6DA7082 { - SECTION UI = "Panel_truly_wqxga_dual_vid.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_truly_wqxga_dual_vid.xml -} - -FILE FREEFORM = 8BC595B7-391A-4A9A-8256-5B9983B30392 { - SECTION UI = "Panel_sharp_4k_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_sharp_4k_dsc_cmd.xml -} - -FILE FREEFORM = 19B58ACD-B1F8-4078-B9A5-A33584B680E2 { - SECTION UI = "Panel_sharp_4k_dsc_vid.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_sharp_4k_dsc_vid.xml -} - -FILE FREEFORM = 0AE323D6-2EBE-11E8-8349-9BA636A0D80C { - SECTION UI = "Panel_sharp_1080p_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_sharp_1080p_cmd.xml -} - -FILE FREEFORM = 87273B42-311D-11E8-9324-DFB2DADFC3D1 { - SECTION UI = "Panel_truly_1080p_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_truly_1080p_cmd.xml -} - -FILE FREEFORM = BAFD3200-311D-11E8-8651-0FB3CACF38FB { - SECTION UI = "Panel_truly_1080p_vid.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_truly_1080p_vid.xml -} - -FILE FREEFORM = 88CA5ABF-D0AC-4093-A68C-0CFAE1EF9635 { - SECTION UI = "Panel_boe_amoled_wqhd_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd.xml -} - -FILE FREEFORM = 6523A5C9-91CB-45C0-A2DC-25997CF23369 { - SECTION UI = "Panel_boe_amoled_wqhd_dsc_vid.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_boe_amoled_wqhd_dsc_vid.xml -} - -FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BE { - SECTION UI = "Panel_boe_amoled_fhd_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_boe_amoled_fhd_dsc_cmd.xml -} - -FILE FREEFORM = 2BCA3B86-E175-4609-AC7F-207908B89C75 { - SECTION UI = "Panel_primary_sharp_1080p_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_primary_sharp_1080p_cmd.xml -} - -FILE FREEFORM = 6343A5E1-E477-452A-B62C-1560C4CBD9F5 { - SECTION UI = "Panel_secondary_truly_1080p_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_secondary_truly_1080p_cmd.xml -} - -FILE FREEFORM = 151C5D22-957F-4861-A605-E27154BBDA25 { - SECTION UI = "Panel_secondary_truly_1080p_vid.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_secondary_truly_1080p_vid.xml -} - -FILE FREEFORM = 61C3A6C5-3E24-4D75-A8C7-0F7A2D77D886 { - SECTION UI = "Panel_nt36523w_boe_b6_oslo_2560_1600_video.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_nt36523w_boe_b6_oslo_2560_1600_video.xml -} - -FILE FREEFORM = E5F0D5F2-BDA6-4A08-B4FB-69CA18AB73D4 { - SECTION UI = "Panel_nt36523w_boe_b6_oslo_2560_1600_jw_video.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_nt36523w_boe_b6_oslo_2560_1600_jw_video.xml -} - -FILE FREEFORM = D75852AE-B004-4554-91ED-69015330B6EC { - SECTION UI = "Panel_nt36523w_boe_b6_oslo_aa0a_2560_1600_video.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_nt36523w_boe_b6_oslo_aa0a_2560_1600_video.xml -} - -FILE FREEFORM = 4465068F-D97F-434C-9B45-4FBA264D8156 { - SECTION UI = "Panel-sim-dualmipi-video.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel-sim-dualmipi-video.xml -} - -FILE FREEFORM = DD862655-95F7-4E46-9AB4-29ED0F3C35C0 { - SECTION UI = "Panel_oppo19065_samsung_1440_3168_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo19065_samsung_1440_3168_dsc_cmd.xml -} - -FILE FREEFORM = E2675915-EA2D-42C8-9DFF-5728DC798D38 { - SECTION UI = "Panel_oppo19161_boe_nt37800_1080_2400_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo19161_boe_nt37800_1080_2400_cmd.xml -} - -FILE FREEFORM = AE8A16E7-6197-4CA7-8D64-225200739231 { - SECTION UI = "Panel_oppo19161_samsung_amb655uv01_1080_2400_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo19161_samsung_amb655uv01_1080_2400_cmd.xml -} - -FILE FREEFORM = AE8A16E7-6197-4CA7-8D64-225202580231 { - SECTION UI = "Panel_oppo19161_samsung_ams655ug04_1080_2400_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo19161_samsung_ams655ug04_1080_2400_cmd.xml -} - -FILE FREEFORM = AE8A16E7-6197-4CA7-8D64-225202580881 { - SECTION UI = "Panel_oppo20135_samsung_amb655xl08_1080_2400_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo20135_samsung_amb655xl08_1080_2400_cmd.xml -} - -FILE FREEFORM = AB7A16F9-6197-4CA8-8D64-115201582883 { - SECTION UI = "Panel_20061_samsung_1440_3216_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_20061_samsung_1440_3216_dsc_cmd.xml -} - -FILE FREEFORM = AC8A16E9-6198-4DA8-8D64-115241582883 { - SECTION UI = "Panel_20061_samsung_1440_3216_dsc_cmd_evt.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_20061_samsung_1440_3216_dsc_cmd_evt.xml -} - -FILE FREEFORM = DBD1C9A6-EC5D-4648-A92D-88A4387A327D { - SECTION UI = "Panel_20061_samsung_1440_3216_dsc_cmd_dvt.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_20061_samsung_1440_3216_dsc_cmd_dvt.xml -} - -FILE FREEFORM = DBD1C9A6-EC5D-4648-A92D-88A4387A329D { - SECTION UI = "Panel_20061_samsung_1440_3216_dsc_cmd_dvt_id07.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_20061_samsung_1440_3216_dsc_cmd_dvt_id07.xml -} - -FILE FREEFORM = DBD1C876-EC5D-4648-A92D-88A4387A389D { - SECTION UI = "Panel_20061_samsung_1440_3216_dsc_cmd_dvt_id09.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_20061_samsung_1440_3216_dsc_cmd_dvt_id09.xml -} - -FILE FREEFORM = 3B1515C0-E627-4A28-B90A-8AFBAE45294A { - SECTION UI = "Panel_oppo19101_samsung_amb655uv01_1080_2400_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo19101_samsung_amb655uv01_1080_2400_cmd.xml -} - -FILE FREEFORM = 3E215D2A-EB6E-4DD2-8DCA-ACB46EFDA153 { - SECTION UI = "Panel_oppo19811_samsung_1440_3168_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo19811_samsung_1440_3168_dsc_cmd.xml -} - -FILE FREEFORM = FB393CF8-9764-46A3-8702-AA1A908EA4DD { - SECTION UI = "Panel_20828_samsung_amb655x_1080_2400_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_20828_samsung_amb655x_1080_2400_cmd.xml -} - -FILE FREEFORM = 000B1795-B0B3-423E-A1FC-619231A5CD4F { - SECTION UI = "Panel_oppo21615_samsung_amb655xl16_1080_2400_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo21615_samsung_amb655xl16_1080_2400_dsc_cmd.xml -} - -FILE FREEFORM = 3A933F26-F03D-4420-B3B0-F1307FB3ECBB { - SECTION UI = "Panel_oppo21615_samsung_amb655xl16_1080_2400_dsc_cmd_90.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo21615_samsung_amb655xl16_1080_2400_dsc_cmd_90.xml -} - -FILE FREEFORM = F06443FF-D5CA-43A1-845B-3977B730DC4E { - SECTION UI = "Panel_oppo21619_samsung_ams662zs01_1080_2400_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo21619_samsung_ams662zs01_1080_2400_dsc_cmd.xml -} - -FILE FREEFORM = E0AB82F4-D10A-47B6-B4E4-C2853CB5BF2D { - SECTION UI = "Panel_oppo21619_samsung_ams662zs01_1080_2400_dvt_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo21619_samsung_ams662zs01_1080_2400_dvt_dsc_cmd.xml -} - -FILE FREEFORM = DDB68910-C18B-4C93-BC76-88C4B1C4F3C7 { - SECTION UI = "Panel_oppo21619_samsung_ams662zs01_1080_2400_dvt_id13_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo21619_samsung_ams662zs01_1080_2400_dvt_id13_dsc_cmd.xml -} - -FILE FREEFORM = CA632411-4AF3-475F-91D6-0C9BC72096CE { - SECTION UI = "Panel_oplus21623_samsung_ams662zs01_1080_2400_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_oplus21623_samsung_ams662zs01_1080_2400_dsc_cmd.xml -} - -FILE FREEFORM = 31E6A997-8764-4585-BBC6-629DFFCF5918 { - SECTION UI = "Panel_samsung_ams641rw01_19795_cmd_dsc.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_samsung_ams641rw01_19795_cmd_dsc.xml -} - -FILE FREEFORM = 8F276EE4-E75E-4C3B-8BCC-C37771E26478 { - SECTION UI = "Panel_nt36860_wqhd_dsc_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_nt36860_wqhd_dsc_cmd.xml -} - -FILE FREEFORM = 6F2D4884-D8A0-11E9-AF7A-D77B1FE990EC { - SECTION UI = "Panel_nt36860_wqhd_dsc_vid.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_nt36860_wqhd_dsc_vid.xml -} - -FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BF { - SECTION UI = "Panel_nt36672e_fhd_plus_60hz_vid.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_nt36672e_fhd_plus_60hz_vid.xml -} - -FILE FREEFORM = 7C33C94F-0619-4DE0-84A8-B2BCC98245B0 { - SECTION UI = "Panel_seeya_uoled_1080p_vid.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_seeya_uoled_1080p_vid.xml -} - -FILE FREEFORM = CE2946CF-9FC5-44B6-A499-0D5B4D4D08E2 { - SECTION UI = "Panel_r66451_fhd_plus_60hz_cmd.xml" - SECTION RAW = Binaries/bitra/RawFiles/Panel_r66451_fhd_plus_60hz_cmd.xml -} - -FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { - SECTION UI = "SecParti.cfg" - SECTION RAW = Binaries/bitra/RawFiles/SecParti.cfg -} - -FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { - SECTION UI = "uefipil.cfg" - SECTION RAW = Binaries/bitra/RawFiles/uefipil.cfg -} - -FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { - SECTION UI = "QcomChargerCfg.cfg" - SECTION RAW = Binaries/bitra/RawFiles/QcomChargerCfg.cfg -} - -FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { - SECTION UI = "BATTERY.PROVISION" - SECTION RAW = Binaries/bitra/RawFiles/BATTERY.PROVISION -} + FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { + SECTION UI = "BDS_Menu.cfg" + SECTION RAW = Binaries/bitra/RawFiles/BDS_Menu.cfg + } + + FILE FREEFORM = 8CAE2C55-FC5A-410B-812B-8CA22F572F36 { + SECTION UI = "Panel_truly_wqxga_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_truly_wqxga_dsc_cmd.xml + } + + FILE FREEFORM = 13AC9DC9-0092-4374-AE1A-06FF35950FD0 { + SECTION UI = "Panel_truly_wqxga_dsc_vid.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_truly_wqxga_dsc_vid.xml + } + + FILE FREEFORM = FC6315F9-F8FE-4222-A1E3-226DF55D7592 { + SECTION UI = "Panel_truly_wqxga_dual_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_truly_wqxga_dual_cmd.xml + } + + FILE FREEFORM = 95E7B040-26A2-4511-9ABB-1D95D6DA7082 { + SECTION UI = "Panel_truly_wqxga_dual_vid.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_truly_wqxga_dual_vid.xml + } + + FILE FREEFORM = 8BC595B7-391A-4A9A-8256-5B9983B30392 { + SECTION UI = "Panel_sharp_4k_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_sharp_4k_dsc_cmd.xml + } + + FILE FREEFORM = 19B58ACD-B1F8-4078-B9A5-A33584B680E2 { + SECTION UI = "Panel_sharp_4k_dsc_vid.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_sharp_4k_dsc_vid.xml + } + + FILE FREEFORM = 0AE323D6-2EBE-11E8-8349-9BA636A0D80C { + SECTION UI = "Panel_sharp_1080p_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_sharp_1080p_cmd.xml + } + + FILE FREEFORM = 87273B42-311D-11E8-9324-DFB2DADFC3D1 { + SECTION UI = "Panel_truly_1080p_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_truly_1080p_cmd.xml + } + + FILE FREEFORM = BAFD3200-311D-11E8-8651-0FB3CACF38FB { + SECTION UI = "Panel_truly_1080p_vid.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_truly_1080p_vid.xml + } + + FILE FREEFORM = 88CA5ABF-D0AC-4093-A68C-0CFAE1EF9635 { + SECTION UI = "Panel_boe_amoled_wqhd_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd.xml + } + + FILE FREEFORM = 6523A5C9-91CB-45C0-A2DC-25997CF23369 { + SECTION UI = "Panel_boe_amoled_wqhd_dsc_vid.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_boe_amoled_wqhd_dsc_vid.xml + } + + FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BE { + SECTION UI = "Panel_boe_amoled_fhd_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_boe_amoled_fhd_dsc_cmd.xml + } + + FILE FREEFORM = 2BCA3B86-E175-4609-AC7F-207908B89C75 { + SECTION UI = "Panel_primary_sharp_1080p_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_primary_sharp_1080p_cmd.xml + } + + FILE FREEFORM = 6343A5E1-E477-452A-B62C-1560C4CBD9F5 { + SECTION UI = "Panel_secondary_truly_1080p_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_secondary_truly_1080p_cmd.xml + } + + FILE FREEFORM = 151C5D22-957F-4861-A605-E27154BBDA25 { + SECTION UI = "Panel_secondary_truly_1080p_vid.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_secondary_truly_1080p_vid.xml + } + + FILE FREEFORM = 61C3A6C5-3E24-4D75-A8C7-0F7A2D77D886 { + SECTION UI = "Panel_nt36523w_boe_b6_oslo_2560_1600_video.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_nt36523w_boe_b6_oslo_2560_1600_video.xml + } + + FILE FREEFORM = E5F0D5F2-BDA6-4A08-B4FB-69CA18AB73D4 { + SECTION UI = "Panel_nt36523w_boe_b6_oslo_2560_1600_jw_video.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_nt36523w_boe_b6_oslo_2560_1600_jw_video.xml + } + + FILE FREEFORM = D75852AE-B004-4554-91ED-69015330B6EC { + SECTION UI = "Panel_nt36523w_boe_b6_oslo_aa0a_2560_1600_video.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_nt36523w_boe_b6_oslo_aa0a_2560_1600_video.xml + } + + FILE FREEFORM = 4465068F-D97F-434C-9B45-4FBA264D8156 { + SECTION UI = "Panel-sim-dualmipi-video.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel-sim-dualmipi-video.xml + } + + FILE FREEFORM = DD862655-95F7-4E46-9AB4-29ED0F3C35C0 { + SECTION UI = "Panel_oppo19065_samsung_1440_3168_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo19065_samsung_1440_3168_dsc_cmd.xml + } + + FILE FREEFORM = E2675915-EA2D-42C8-9DFF-5728DC798D38 { + SECTION UI = "Panel_oppo19161_boe_nt37800_1080_2400_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo19161_boe_nt37800_1080_2400_cmd.xml + } + + FILE FREEFORM = AE8A16E7-6197-4CA7-8D64-225200739231 { + SECTION UI = "Panel_oppo19161_samsung_amb655uv01_1080_2400_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo19161_samsung_amb655uv01_1080_2400_cmd.xml + } + + FILE FREEFORM = AE8A16E7-6197-4CA7-8D64-225202580231 { + SECTION UI = "Panel_oppo19161_samsung_ams655ug04_1080_2400_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo19161_samsung_ams655ug04_1080_2400_cmd.xml + } + + FILE FREEFORM = AE8A16E7-6197-4CA7-8D64-225202580881 { + SECTION UI = "Panel_oppo20135_samsung_amb655xl08_1080_2400_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo20135_samsung_amb655xl08_1080_2400_cmd.xml + } + + FILE FREEFORM = AB7A16F9-6197-4CA8-8D64-115201582883 { + SECTION UI = "Panel_20061_samsung_1440_3216_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_20061_samsung_1440_3216_dsc_cmd.xml + } + + FILE FREEFORM = AC8A16E9-6198-4DA8-8D64-115241582883 { + SECTION UI = "Panel_20061_samsung_1440_3216_dsc_cmd_evt.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_20061_samsung_1440_3216_dsc_cmd_evt.xml + } + + FILE FREEFORM = DBD1C9A6-EC5D-4648-A92D-88A4387A327D { + SECTION UI = "Panel_20061_samsung_1440_3216_dsc_cmd_dvt.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_20061_samsung_1440_3216_dsc_cmd_dvt.xml + } + + FILE FREEFORM = DBD1C9A6-EC5D-4648-A92D-88A4387A329D { + SECTION UI = "Panel_20061_samsung_1440_3216_dsc_cmd_dvt_id07.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_20061_samsung_1440_3216_dsc_cmd_dvt_id07.xml + } + + FILE FREEFORM = DBD1C876-EC5D-4648-A92D-88A4387A389D { + SECTION UI = "Panel_20061_samsung_1440_3216_dsc_cmd_dvt_id09.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_20061_samsung_1440_3216_dsc_cmd_dvt_id09.xml + } + + FILE FREEFORM = 3B1515C0-E627-4A28-B90A-8AFBAE45294A { + SECTION UI = "Panel_oppo19101_samsung_amb655uv01_1080_2400_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo19101_samsung_amb655uv01_1080_2400_cmd.xml + } + + FILE FREEFORM = 3E215D2A-EB6E-4DD2-8DCA-ACB46EFDA153 { + SECTION UI = "Panel_oppo19811_samsung_1440_3168_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo19811_samsung_1440_3168_dsc_cmd.xml + } + + FILE FREEFORM = FB393CF8-9764-46A3-8702-AA1A908EA4DD { + SECTION UI = "Panel_20828_samsung_amb655x_1080_2400_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_20828_samsung_amb655x_1080_2400_cmd.xml + } + + FILE FREEFORM = 000B1795-B0B3-423E-A1FC-619231A5CD4F { + SECTION UI = "Panel_oppo21615_samsung_amb655xl16_1080_2400_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo21615_samsung_amb655xl16_1080_2400_dsc_cmd.xml + } + + FILE FREEFORM = 3A933F26-F03D-4420-B3B0-F1307FB3ECBB { + SECTION UI = "Panel_oppo21615_samsung_amb655xl16_1080_2400_dsc_cmd_90.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo21615_samsung_amb655xl16_1080_2400_dsc_cmd_90.xml + } + + FILE FREEFORM = F06443FF-D5CA-43A1-845B-3977B730DC4E { + SECTION UI = "Panel_oppo21619_samsung_ams662zs01_1080_2400_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo21619_samsung_ams662zs01_1080_2400_dsc_cmd.xml + } + + FILE FREEFORM = E0AB82F4-D10A-47B6-B4E4-C2853CB5BF2D { + SECTION UI = "Panel_oppo21619_samsung_ams662zs01_1080_2400_dvt_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo21619_samsung_ams662zs01_1080_2400_dvt_dsc_cmd.xml + } + + FILE FREEFORM = DDB68910-C18B-4C93-BC76-88C4B1C4F3C7 { + SECTION UI = "Panel_oppo21619_samsung_ams662zs01_1080_2400_dvt_id13_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oppo21619_samsung_ams662zs01_1080_2400_dvt_id13_dsc_cmd.xml + } + + FILE FREEFORM = CA632411-4AF3-475F-91D6-0C9BC72096CE { + SECTION UI = "Panel_oplus21623_samsung_ams662zs01_1080_2400_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_oplus21623_samsung_ams662zs01_1080_2400_dsc_cmd.xml + } + + FILE FREEFORM = 31E6A997-8764-4585-BBC6-629DFFCF5918 { + SECTION UI = "Panel_samsung_ams641rw01_19795_cmd_dsc.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_samsung_ams641rw01_19795_cmd_dsc.xml + } + + FILE FREEFORM = 8F276EE4-E75E-4C3B-8BCC-C37771E26478 { + SECTION UI = "Panel_nt36860_wqhd_dsc_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_nt36860_wqhd_dsc_cmd.xml + } + + FILE FREEFORM = 6F2D4884-D8A0-11E9-AF7A-D77B1FE990EC { + SECTION UI = "Panel_nt36860_wqhd_dsc_vid.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_nt36860_wqhd_dsc_vid.xml + } + + FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BF { + SECTION UI = "Panel_nt36672e_fhd_plus_60hz_vid.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_nt36672e_fhd_plus_60hz_vid.xml + } + + FILE FREEFORM = 7C33C94F-0619-4DE0-84A8-B2BCC98245B0 { + SECTION UI = "Panel_seeya_uoled_1080p_vid.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_seeya_uoled_1080p_vid.xml + } + + FILE FREEFORM = CE2946CF-9FC5-44B6-A499-0D5B4D4D08E2 { + SECTION UI = "Panel_r66451_fhd_plus_60hz_cmd.xml" + SECTION RAW = Binaries/bitra/RawFiles/Panel_r66451_fhd_plus_60hz_cmd.xml + } + + FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { + SECTION UI = "SecParti.cfg" + SECTION RAW = Binaries/bitra/RawFiles/SecParti.cfg + } + + FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { + SECTION UI = "uefipil.cfg" + SECTION RAW = Binaries/bitra/RawFiles/uefipil.cfg + } + + FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { + SECTION UI = "QcomChargerCfg.cfg" + SECTION RAW = Binaries/bitra/RawFiles/QcomChargerCfg.cfg + } + + FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { + SECTION UI = "BATTERY.PROVISION" + SECTION RAW = Binaries/bitra/RawFiles/BATTERY.PROVISION + } diff --git a/Platforms/Realme/bitraPkg/PlatformBuild.py b/Platforms/Realme/bitraPkg/PlatformBuild.py index f9909ae45..58420a3da 100644 --- a/Platforms/Realme/bitraPkg/PlatformBuild.py +++ b/Platforms/Realme/bitraPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Realme GT NEO 2 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("bitraPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("bitraPkg/bitra.dsc", {}) - def GetName(self): + def GetName (self): return "bitra" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "bitraPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "bitra", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "bitraPkg/bitra.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "bitra", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "bitraPkg/bitra.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Realme/bitraPkg/bitra.dec b/Platforms/Realme/bitraPkg/bitra.dec index 173960875..e69de29bb 100644 --- a/Platforms/Realme/bitraPkg/bitra.dec +++ b/Platforms/Realme/bitraPkg/bitra.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = bitra - PACKAGE_GUID = 4F4872E2-A454-4FFA-9145-8C6F473A5D9E - PACKAGE_VERSION = 0.1 - -[Guids] - gbitraTokenSpaceGuid = { 0x4F4872E2, 0xA454, 0x4FFA, { 0x91, 0x45, 0x8C, 0x6F, 0x47, 0x3A, 0x5D, 0x9E } } \ No newline at end of file diff --git a/Platforms/Realme/bitraPkg/bitra.dsc b/Platforms/Realme/bitraPkg/bitra.dsc index dd290c3c8..37bc1fe3c 100644 --- a/Platforms/Realme/bitraPkg/bitra.dsc +++ b/Platforms/Realme/bitraPkg/bitra.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 0 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8250 # 1 = SM8250-AB # 2 = SM8250-AC + # SOC_TYPE = 2 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"kubawis128" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"kubawis128" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xB0400000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Samsung/a10Pkg/Include/APRIORI.inc b/Platforms/Samsung/a10Pkg/Include/APRIORI.inc index 139edf24e..e7136764a 100644 --- a/Platforms/Samsung/a10Pkg/Include/APRIORI.inc +++ b/Platforms/Samsung/a10Pkg/Include/APRIORI.inc @@ -14,7 +14,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/a10Pkg/Include/DXE.inc b/Platforms/Samsung/a10Pkg/Include/DXE.inc index 54fbb27eb..f64511a5d 100644 --- a/Platforms/Samsung/a10Pkg/Include/DXE.inc +++ b/Platforms/Samsung/a10Pkg/Include/DXE.inc @@ -21,7 +21,6 @@ INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/a10Pkg/PlatformBuild.py b/Platforms/Samsung/a10Pkg/PlatformBuild.py index e9bc6b517..7158671d4 100644 --- a/Platforms/Samsung/a10Pkg/PlatformBuild.py +++ b/Platforms/Samsung/a10Pkg/PlatformBuild.py @@ -1,6 +1,4 @@ ## -# Script to Build Samsung Galaxy A10 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -9,6 +7,7 @@ import logging import os import uuid + from io import StringIO from pathlib import Path @@ -16,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("a10Pkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -46,190 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("a10Pkg/a10.dsc", {}) - def GetName(self): + def GetName (self): return "a10" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "a10Pkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "a10", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "a10Pkg/a10.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "a10", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "a10Pkg/a10.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Samsung/a10Pkg/a10.dec b/Platforms/Samsung/a10Pkg/a10.dec index 3e6c7c04b..e69de29bb 100644 --- a/Platforms/Samsung/a10Pkg/a10.dec +++ b/Platforms/Samsung/a10Pkg/a10.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = a10 - PACKAGE_GUID = F54E021F-3F08-4971-9860-56892E7E78CB - PACKAGE_VERSION = 1.0 - -[Guids] - ga10TokenSpaceGuid = { 0xF54E021F, 0x3F08, 0x4971, { 0x98, 0x60, 0x56, 0x89, 0x2E, 0x7E, 0x78, 0xCB } } diff --git a/Platforms/Samsung/a10Pkg/a10.dsc b/Platforms/Samsung/a10Pkg/a10.dsc index f0e8d3a68..848e714e8 100644 --- a/Platforms/Samsung/a10Pkg/a10.dsc +++ b/Platforms/Samsung/a10Pkg/a10.dsc @@ -40,7 +40,7 @@ gArmTokenSpaceGuid.PcdSystemMemorySize|0x100000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"snaccy" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"snaccy" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80004000 diff --git a/Platforms/Samsung/a52sxqPkg/Include/APRIORI.inc b/Platforms/Samsung/a52sxqPkg/Include/APRIORI.inc index 68ab9f21e..2a3961bdf 100644 --- a/Platforms/Samsung/a52sxqPkg/Include/APRIORI.inc +++ b/Platforms/Samsung/a52sxqPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/a52sxq/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Samsung/a52sxqPkg/Include/DXE.inc b/Platforms/Samsung/a52sxqPkg/Include/DXE.inc index 6f58e2132..2bacf05f6 100644 --- a/Platforms/Samsung/a52sxqPkg/Include/DXE.inc +++ b/Platforms/Samsung/a52sxqPkg/Include/DXE.inc @@ -27,7 +27,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/a52sxq/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/a52sxq/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf diff --git a/Platforms/Samsung/a52sxqPkg/Include/RAW.inc b/Platforms/Samsung/a52sxqPkg/Include/RAW.inc index 7144a3e9c..e4cad4289 100644 --- a/Platforms/Samsung/a52sxqPkg/Include/RAW.inc +++ b/Platforms/Samsung/a52sxqPkg/Include/RAW.inc @@ -8,11 +8,6 @@ SECTION UI = "BDS_Menu.cfg" } - FILE FREEFORM = A91D838E-A5FA-4138-825D-455E23030794 { - SECTION RAW = Binaries/a52sxq/RawFiles/logo1.bmp - SECTION UI = "logo1.bmp" - } - FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BE { SECTION RAW = Binaries/a52sxq/RawFiles/Panel_boe_amoled_fhd_dsc_cmd.xml SECTION UI = "Panel_boe_amoled_fhd_dsc_cmd.xml" diff --git a/Platforms/Samsung/a52sxqPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c b/Platforms/Samsung/a52sxqPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c index 748ac2488..4a92e9eb9 100644 --- a/Platforms/Samsung/a52sxqPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c +++ b/Platforms/Samsung/a52sxqPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c @@ -19,10 +19,10 @@ gDeviceMemoryDescriptorEx[] = { {"Sched Heap", 0x83600000, 0x00400000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, {"RAM Partition", 0x83200000, 0x02600000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, {"PIL Reserved", 0x85800000, 0x16F00000, AddMem, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED_XN}, - {"DXE Heap", 0x9C700000, 0x03100000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, {"FV Region", 0x9F800000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, {"ABOOT FV", 0x9FA00000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN}, - {"UEFI FD", 0x9FC00000, 0x00300000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, + {"FD Reserved", 0x9FC00000, 0x00100000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, + {"UEFI FD", 0x9FD00000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, {"SEC Heap", 0x9FF00000, 0x0008C000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, {"CPU Vectors", 0x9FF8C000, 0x00001000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, {"MMU PageTables", 0x9FF8D000, 0x00003000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, @@ -30,7 +30,8 @@ gDeviceMemoryDescriptorEx[] = { {"RAM Partition", 0x9FFD0000, 0x00027000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, {"Log Buffer", 0x9FFF7000, 0x00008000, AddMem, SYS_MEM, SYS_MEM_CAP, RtData, WRITE_BACK_XN}, {"Info Blk", 0x9FFFF000, 0x00001000, AddMem, SYS_MEM, SYS_MEM_CAP, RtData, WRITE_BACK_XN}, - {"RAM Partition", 0xA0000000, 0x10000000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, + {"DXE Heap", 0xA0000000, 0x03100000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, + {"RAM Partition", 0xA3200000, 0x0CF00000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, {"HYP RESERVED", 0xB0000000, 0x10000000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN}, {"RAM Partition", 0xC0000000, 0x01800000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, {"TZApps Reserved", 0xC1800000, 0x04700000, HobOnlyNoCacheSetting, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED_XN}, diff --git a/Platforms/Samsung/a52sxqPkg/PlatformBuild.py b/Platforms/Samsung/a52sxqPkg/PlatformBuild.py index 4f74f9f42..0f343387d 100644 --- a/Platforms/Samsung/a52sxqPkg/PlatformBuild.py +++ b/Platforms/Samsung/a52sxqPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Samsung Galaxy A52s 5G UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("a52sxqPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("a52sxqPkg/a52sxq.dsc", {}) - def GetName(self): + def GetName (self): return "a52sxq" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "a52sxqPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "a52sxq", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "a52sxqPkg/a52sxq.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "a52sxq", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "a52sxqPkg/a52sxq.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Samsung/a52sxqPkg/a52sxq.dec b/Platforms/Samsung/a52sxqPkg/a52sxq.dec index 59c3f2bd7..e69de29bb 100644 --- a/Platforms/Samsung/a52sxqPkg/a52sxq.dec +++ b/Platforms/Samsung/a52sxqPkg/a52sxq.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = a52sxq - PACKAGE_GUID = 04D1109C-6E8A-45DA-85C4-9D7FF2113B25 - PACKAGE_VERSION = 0.1 - -[Guids] - ga52sxqTokenSpaceGuid = { 04D1109C, 0x6E8A, 0x45DA, { 0x85, 0xC4, 0x9D, 0x7F, 0xF2, 0x11, 0x3B, 0x25 } } diff --git a/Platforms/Samsung/a52sxqPkg/a52sxq.dsc b/Platforms/Samsung/a52sxqPkg/a52sxq.dsc index f55a19944..a5d73799d 100644 --- a/Platforms/Samsung/a52sxqPkg/a52sxq.dsc +++ b/Platforms/Samsung/a52sxqPkg/a52sxq.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 0 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM7325 # 1 = SM7325-AE # 2 = SM7325-AF + # SOC_TYPE = 0 [BuildOptions] @@ -43,7 +45,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"arminask" # Device Maintainer + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"arminask" # Device Maintainer # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -64,11 +66,14 @@ gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferHeight|2400 gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferColorDepth|32 + # XBL Protocol (Keep it disabled for now) + #gQcomPkgTokenSpaceGuid.PcdScheduleInterfaceAddr|0x9FC37980 + # Dynamic RAM Start Address gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xF0900000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Samsung/a7Pkg/Include/APRIORI.inc b/Platforms/Samsung/a7Pkg/Include/APRIORI.inc index 139edf24e..e7136764a 100644 --- a/Platforms/Samsung/a7Pkg/Include/APRIORI.inc +++ b/Platforms/Samsung/a7Pkg/Include/APRIORI.inc @@ -14,7 +14,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/a7Pkg/Include/DXE.inc b/Platforms/Samsung/a7Pkg/Include/DXE.inc index 54fbb27eb..f64511a5d 100644 --- a/Platforms/Samsung/a7Pkg/Include/DXE.inc +++ b/Platforms/Samsung/a7Pkg/Include/DXE.inc @@ -21,7 +21,6 @@ INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/a7Pkg/PlatformBuild.py b/Platforms/Samsung/a7Pkg/PlatformBuild.py index 75dbf3e0c..9abe18591 100644 --- a/Platforms/Samsung/a7Pkg/PlatformBuild.py +++ b/Platforms/Samsung/a7Pkg/PlatformBuild.py @@ -1,6 +1,4 @@ ## -# Script to Build Samsung Galaxy A7 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -9,6 +7,7 @@ import logging import os import uuid + from io import StringIO from pathlib import Path @@ -16,23 +15,19 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' - PackagesSupported = ("a10Pkg") +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): + PackagesSupported = ("a7Pkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") - Scopes = ('a10', 'gcc_aarch64_linux', 'edk2-build') + Scopes = ('a7', 'gcc_aarch64_linux', 'edk2-build') WorkspaceRoot = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) PackagesPath = ( "Platforms/Samsung", @@ -46,190 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' - return ("a10Pkg/a10.dsc", {}) + def GetPlatformDscAndConfig (self) -> tuple: + return ("a7Pkg/a7.dsc", {}) - def GetName(self): - return "a10" + def GetName (self): + return "a7" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' - return "a10Pkg" - - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. + def GetName (self): + return "a7Pkg" - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "a10", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "a10Pkg/a10.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "a7", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "a7Pkg/a7.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Samsung/a7Pkg/a7.dec b/Platforms/Samsung/a7Pkg/a7.dec index c1597aef2..e69de29bb 100644 --- a/Platforms/Samsung/a7Pkg/a7.dec +++ b/Platforms/Samsung/a7Pkg/a7.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = a7 - PACKAGE_GUID = 4FF7924B-80E2-4F46-8794-D221D4F6D7DA - PACKAGE_VERSION = 1.0 - -[Guids] - ga7TokenSpaceGuid = { 0x4FF7924B, 0x80E2, 0x4F46, { 0x87, 0x94, 0xD2, 0x21, 0xD4, 0xF6, 0xD7, 0xDA } } diff --git a/Platforms/Samsung/a7Pkg/a7.dsc b/Platforms/Samsung/a7Pkg/a7.dsc index 24ac6749f..caa4e1956 100644 --- a/Platforms/Samsung/a7Pkg/a7.dsc +++ b/Platforms/Samsung/a7Pkg/a7.dsc @@ -40,7 +40,7 @@ gArmTokenSpaceGuid.PcdSystemMemorySize|0x180000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"No Maintainer" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"No Maintainer" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80004000 diff --git a/Platforms/Samsung/beyond1ltePkg/Include/APRIORI.inc b/Platforms/Samsung/beyond1ltePkg/Include/APRIORI.inc index 139edf24e..e7136764a 100644 --- a/Platforms/Samsung/beyond1ltePkg/Include/APRIORI.inc +++ b/Platforms/Samsung/beyond1ltePkg/Include/APRIORI.inc @@ -14,7 +14,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/beyond1ltePkg/Include/DXE.inc b/Platforms/Samsung/beyond1ltePkg/Include/DXE.inc index 54fbb27eb..f64511a5d 100644 --- a/Platforms/Samsung/beyond1ltePkg/Include/DXE.inc +++ b/Platforms/Samsung/beyond1ltePkg/Include/DXE.inc @@ -21,7 +21,6 @@ INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/beyond1ltePkg/PlatformBuild.py b/Platforms/Samsung/beyond1ltePkg/PlatformBuild.py index b9b340fd0..9d2642333 100644 --- a/Platforms/Samsung/beyond1ltePkg/PlatformBuild.py +++ b/Platforms/Samsung/beyond1ltePkg/PlatformBuild.py @@ -1,6 +1,4 @@ ## -# Script to Build Samsung Galaxy S10 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -9,6 +7,7 @@ import logging import os import uuid + from io import StringIO from pathlib import Path @@ -16,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("beyond1ltePkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -46,190 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("beyond1ltePkg/beyond1lte.dsc", {}) - def GetName(self): + def GetName (self): return "beyond1lte" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "beyond1ltePkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "beyond1lte", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "beyond1ltePkg/beyond1lte.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "beyond1lte", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "beyond1ltePkg/beyond1lte.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Samsung/beyond1ltePkg/beyond1lte.dec b/Platforms/Samsung/beyond1ltePkg/beyond1lte.dec index 491857f58..e69de29bb 100644 --- a/Platforms/Samsung/beyond1ltePkg/beyond1lte.dec +++ b/Platforms/Samsung/beyond1ltePkg/beyond1lte.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = beyond1lte - PACKAGE_GUID = 4E670446-C67E-4FEB-8D15-A0A05C824B80 - PACKAGE_VERSION = 1.0 - -[Guids] - gbeyond1lteTokenSpaceGuid = { 0x4E670446, 0xC67E, 0x4FEB, { 0x8D, 0x15, 0xA0, 0xA0, 0x5C, 0x82, 0x4B, 0x80 } } diff --git a/Platforms/Samsung/beyond1ltePkg/beyond1lte.dsc b/Platforms/Samsung/beyond1ltePkg/beyond1lte.dsc index 414f99b44..9554854ee 100644 --- a/Platforms/Samsung/beyond1ltePkg/beyond1lte.dsc +++ b/Platforms/Samsung/beyond1ltePkg/beyond1lte.dsc @@ -40,7 +40,7 @@ gArmTokenSpaceGuid.PcdSystemMemorySize|0x200000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Robotix22" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Robotix22" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80302000 diff --git a/Platforms/Samsung/c1sPkg/Include/APRIORI.inc b/Platforms/Samsung/c1sPkg/Include/APRIORI.inc index 139edf24e..e7136764a 100644 --- a/Platforms/Samsung/c1sPkg/Include/APRIORI.inc +++ b/Platforms/Samsung/c1sPkg/Include/APRIORI.inc @@ -14,7 +14,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/c1sPkg/Include/DXE.inc b/Platforms/Samsung/c1sPkg/Include/DXE.inc index 54fbb27eb..f64511a5d 100644 --- a/Platforms/Samsung/c1sPkg/Include/DXE.inc +++ b/Platforms/Samsung/c1sPkg/Include/DXE.inc @@ -21,7 +21,6 @@ INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/c1sPkg/PlatformBuild.py b/Platforms/Samsung/c1sPkg/PlatformBuild.py index e089cde50..d1b04fbf8 100644 --- a/Platforms/Samsung/c1sPkg/PlatformBuild.py +++ b/Platforms/Samsung/c1sPkg/PlatformBuild.py @@ -1,6 +1,4 @@ ## -# Script to Build Samsung Galaxy Note 20 5G UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -9,6 +7,7 @@ import logging import os import uuid + from io import StringIO from pathlib import Path @@ -16,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("c1sPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -46,190 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("c1sPkg/c1s.dsc", {}) - def GetName(self): + def GetName (self): return "c1s" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "c1sPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "c1s", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "c1sPkg/c1s.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "c1s", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "c1sPkg/c1s.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Samsung/c1sPkg/c1s.dec b/Platforms/Samsung/c1sPkg/c1s.dec index ae86635bf..e69de29bb 100644 --- a/Platforms/Samsung/c1sPkg/c1s.dec +++ b/Platforms/Samsung/c1sPkg/c1s.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = c1s - PACKAGE_GUID = 79AC2254-7352-41CD-BEC7-DFD327EE6F79 - PACKAGE_VERSION = 1.0 - -[Guids] - gc1sTokenSpaceGuid = { 0x79AC2254, 0x7352, 0x41CD, { 0xBE, 0xC7, 0xDF, 0xD3, 0x27, 0xEE, 0x6F, 0x79 } } diff --git a/Platforms/Samsung/c1sPkg/c1s.dsc b/Platforms/Samsung/c1sPkg/c1s.dsc index 54a16e6de..e8dc3badb 100644 --- a/Platforms/Samsung/c1sPkg/c1s.dsc +++ b/Platforms/Samsung/c1sPkg/c1s.dsc @@ -40,7 +40,7 @@ gArmTokenSpaceGuid.PcdSystemMemorySize|0x200000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"No Maintainer" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"No Maintainer" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80001000 diff --git a/Platforms/Samsung/gts8Pkg/Include/APRIORI.inc b/Platforms/Samsung/gts8Pkg/Include/APRIORI.inc index 8feb7903e..05ac7ba9d 100644 --- a/Platforms/Samsung/gts8Pkg/Include/APRIORI.inc +++ b/Platforms/Samsung/gts8Pkg/Include/APRIORI.inc @@ -19,7 +19,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/gts8/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Samsung/gts8Pkg/Include/DXE.inc b/Platforms/Samsung/gts8Pkg/Include/DXE.inc index 19725284b..1e09306ef 100644 --- a/Platforms/Samsung/gts8Pkg/Include/DXE.inc +++ b/Platforms/Samsung/gts8Pkg/Include/DXE.inc @@ -29,7 +29,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/gts8/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/gts8/QcomPkg/Drivers/IPCCDxe/IPCCDxe.inf diff --git a/Platforms/Samsung/gts8Pkg/Include/RAW.inc b/Platforms/Samsung/gts8Pkg/Include/RAW.inc index 9cdc0049e..ddcf9c65d 100644 --- a/Platforms/Samsung/gts8Pkg/Include/RAW.inc +++ b/Platforms/Samsung/gts8Pkg/Include/RAW.inc @@ -166,4 +166,4 @@ FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { SECTION UI = "QcomChargerCfg.cfg" SECTION RAW = Binaries/gts8/RawFiles/QcomChargerCfg.cfg - } \ No newline at end of file + } diff --git a/Platforms/Samsung/gts8Pkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c b/Platforms/Samsung/gts8Pkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c index 7b8e5b11c..5fd99d4ee 100644 --- a/Platforms/Samsung/gts8Pkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c +++ b/Platforms/Samsung/gts8Pkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c @@ -14,6 +14,7 @@ gDeviceMemoryDescriptorEx[] = { {"PIL Reserved", 0x85200000, 0x1C200000, AddMem, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED_XN}, {"Display Demura", 0xA1400000, 0x02B00000, AddMem, MEM_RES, SYS_MEM_CAP, Reserv, WRITE_THROUGH_XN}, {"DBI Dump", 0xA6000000, 0x00F00000, NoHob, MMAP_IO, INITIALIZED, Conv, UNCACHED_UNBUFFERED_XN}, + {"FD Reserved", 0xA7000000, 0x00600000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, {"CPU Vectors", 0xA7600000, 0x00001000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, {"Info Blk", 0xA7601000, 0x00001000, AddMem, SYS_MEM, SYS_MEM_CAP, RtData, WRITE_BACK_XN}, {"MMU PageTables", 0xA7602000, 0x00003000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, diff --git a/Platforms/Samsung/gts8Pkg/PlatformBuild.py b/Platforms/Samsung/gts8Pkg/PlatformBuild.py index e38f7e138..803554fc2 100644 --- a/Platforms/Samsung/gts8Pkg/PlatformBuild.py +++ b/Platforms/Samsung/gts8Pkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Samsung Galaxy Tab S8 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("gts8Pkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("gts8Pkg/gts8.dsc", {}) - def GetName(self): + def GetName (self): return "gts8" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "gts8Pkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "gts8", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "gts8Pkg/gts8.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "gts8", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "gts8Pkg/gts8.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Samsung/gts8Pkg/gts8.dec b/Platforms/Samsung/gts8Pkg/gts8.dec index 71a9a8270..e69de29bb 100644 --- a/Platforms/Samsung/gts8Pkg/gts8.dec +++ b/Platforms/Samsung/gts8Pkg/gts8.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = gts8 - PACKAGE_GUID = 539F03C6-9EF9-4B7D-B7B8-455ABE2BCC2E - PACKAGE_VERSION = 0.1 - -[Guids] - ggts8TokenSpaceGuid = { 0x539F03C6, 0x9EF9, 0x4B7D, { 0xB7, 0xB8, 0x45, 0x5A, 0xBE, 0x2B, 0xCC, 0x2E } } diff --git a/Platforms/Samsung/gts8Pkg/gts8.dsc b/Platforms/Samsung/gts8Pkg/gts8.dsc index 9184a3e50..09517e751 100644 --- a/Platforms/Samsung/gts8Pkg/gts8.dsc +++ b/Platforms/Samsung/gts8Pkg/gts8.dsc @@ -27,8 +27,10 @@ AB_SLOT_SUPPORT = 0 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8450 # 1 = SM8475 + # SOC_TYPE = 0 [BuildOptions] @@ -43,7 +45,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"No Maintainer" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"No Maintainer" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0xA7600000 @@ -64,11 +66,14 @@ gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferHeight|2560 gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferColorDepth|32 + # XBL Protocol + gQcomPkgTokenSpaceGuid.PcdDTBExtensionAddr|0xA703B0C8 + # Dynamic RAM Start Address gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0x840000000 # This needs Adjustments # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Samsung/q2qPkg/Include/APRIORI.inc b/Platforms/Samsung/q2qPkg/Include/APRIORI.inc index e23f0a14e..831da83a2 100644 --- a/Platforms/Samsung/q2qPkg/Include/APRIORI.inc +++ b/Platforms/Samsung/q2qPkg/Include/APRIORI.inc @@ -21,7 +21,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf FILE DRIVER = F541D663-4A48-40AA-AABF-FF158CCAE34C { SECTION DXE_DEPEX = Binaries/q2q/QcomPkg/Drivers/SmemDxe/SmemDxe.depex diff --git a/Platforms/Samsung/q2qPkg/Include/DXE.inc b/Platforms/Samsung/q2qPkg/Include/DXE.inc index cb256012a..0f4dca6c4 100644 --- a/Platforms/Samsung/q2qPkg/Include/DXE.inc +++ b/Platforms/Samsung/q2qPkg/Include/DXE.inc @@ -45,7 +45,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf FILE DRIVER = 10E193DF-9966-44E7-B17C-59DD831E20FC { SECTION DXE_DEPEX = Binaries/q2q/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.depex diff --git a/Platforms/Samsung/q2qPkg/Include/RAW.inc b/Platforms/Samsung/q2qPkg/Include/RAW.inc index 892c3d505..ff586661f 100644 --- a/Platforms/Samsung/q2qPkg/Include/RAW.inc +++ b/Platforms/Samsung/q2qPkg/Include/RAW.inc @@ -146,4 +146,4 @@ FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { SECTION UI = "BDS_Menu.cfg" SECTION RAW = Binaries/q2q/RawFiles/BDS_Menu.cfg - } \ No newline at end of file + } diff --git a/Platforms/Samsung/q2qPkg/PlatformBuild.py b/Platforms/Samsung/q2qPkg/PlatformBuild.py index 1cf81c4a2..c48eb97b0 100644 --- a/Platforms/Samsung/q2qPkg/PlatformBuild.py +++ b/Platforms/Samsung/q2qPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Samsung Galaxy Z Fold 3 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("q2qPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("q2qPkg/q2q.dsc", {}) - def GetName(self): + def GetName (self): return "q2q" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "q2qPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "q2q", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "q2qPkg/q2q.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "q2q", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "q2qPkg/q2q.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Samsung/q2qPkg/q2q.dec b/Platforms/Samsung/q2qPkg/q2q.dec index bb3c53578..e69de29bb 100644 --- a/Platforms/Samsung/q2qPkg/q2q.dec +++ b/Platforms/Samsung/q2qPkg/q2q.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = q2q - PACKAGE_GUID = D6D8E3F8-5A15-4B49-844B-35EFCE9B947B - PACKAGE_VERSION = 0.1 - -[Guids] - gq2qTokenSpaceGuid = { 0xD6D8E3F8, 0x5A15, 0x4B49, { 0x84, 0x4B, 0x35, 0xEF, 0xCE, 0x9B, 0x94, 0x7B } } diff --git a/Platforms/Samsung/q2qPkg/q2q.dsc b/Platforms/Samsung/q2qPkg/q2q.dsc index 47fe5d6d5..86963715e 100644 --- a/Platforms/Samsung/q2qPkg/q2q.dsc +++ b/Platforms/Samsung/q2qPkg/q2q.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 0 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8350 # 1 = SM8350-AB # 2 = SM8350-AC + # SOC_TYPE = 0 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Azkali" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Azkali" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xF0B00000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Samsung/r8sPkg/Include/APRIORI.inc b/Platforms/Samsung/r8sPkg/Include/APRIORI.inc index 139edf24e..e7136764a 100644 --- a/Platforms/Samsung/r8sPkg/Include/APRIORI.inc +++ b/Platforms/Samsung/r8sPkg/Include/APRIORI.inc @@ -14,7 +14,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/r8sPkg/Include/DXE.inc b/Platforms/Samsung/r8sPkg/Include/DXE.inc index 54fbb27eb..f64511a5d 100644 --- a/Platforms/Samsung/r8sPkg/Include/DXE.inc +++ b/Platforms/Samsung/r8sPkg/Include/DXE.inc @@ -21,7 +21,6 @@ INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/r8sPkg/PlatformBuild.py b/Platforms/Samsung/r8sPkg/PlatformBuild.py index 37fd04af5..c2d05b525 100644 --- a/Platforms/Samsung/r8sPkg/PlatformBuild.py +++ b/Platforms/Samsung/r8sPkg/PlatformBuild.py @@ -1,6 +1,4 @@ ## -# Script to Build Samsung Galaxy S20 FE 5G UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -9,6 +7,7 @@ import logging import os import uuid + from io import StringIO from pathlib import Path @@ -16,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("r8sPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -46,190 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("r8sPkg/r8s.dsc", {}) - def GetName(self): + def GetName (self): return "r8s" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "r8sPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "r8s", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "r8sPkg/r8s.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "r8s", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "r8sPkg/r8s.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Samsung/r8sPkg/r8s.dec b/Platforms/Samsung/r8sPkg/r8s.dec index 6227e7510..e69de29bb 100644 --- a/Platforms/Samsung/r8sPkg/r8s.dec +++ b/Platforms/Samsung/r8sPkg/r8s.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = r8s - PACKAGE_GUID = 40E34536-4282-4C87-BF5E-B0E1A40C987D - PACKAGE_VERSION = 1.0 - -[Guids] - gr8sTokenSpaceGuid = { 0x40E34536, 0x4282, 0x4C87, { 0xBF, 0x5E, 0xB0, 0xE1, 0xA4, 0x0C, 0x98, 0x7D } } diff --git a/Platforms/Samsung/r8sPkg/r8s.dsc b/Platforms/Samsung/r8sPkg/r8s.dsc index e33615a58..b9e5ab186 100644 --- a/Platforms/Samsung/r8sPkg/r8s.dsc +++ b/Platforms/Samsung/r8sPkg/r8s.dsc @@ -40,7 +40,7 @@ gArmTokenSpaceGuid.PcdSystemMemorySize|0x200000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Sota4Ever" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Sota4Ever" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80001000 diff --git a/Platforms/Samsung/starltePkg/Include/APRIORI.inc b/Platforms/Samsung/starltePkg/Include/APRIORI.inc index 139edf24e..e7136764a 100644 --- a/Platforms/Samsung/starltePkg/Include/APRIORI.inc +++ b/Platforms/Samsung/starltePkg/Include/APRIORI.inc @@ -14,7 +14,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/starltePkg/Include/DXE.inc b/Platforms/Samsung/starltePkg/Include/DXE.inc index 54fbb27eb..f64511a5d 100644 --- a/Platforms/Samsung/starltePkg/Include/DXE.inc +++ b/Platforms/Samsung/starltePkg/Include/DXE.inc @@ -21,7 +21,6 @@ INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/starltePkg/PlatformBuild.py b/Platforms/Samsung/starltePkg/PlatformBuild.py index d11322cfd..4200f405f 100644 --- a/Platforms/Samsung/starltePkg/PlatformBuild.py +++ b/Platforms/Samsung/starltePkg/PlatformBuild.py @@ -1,6 +1,4 @@ ## -# Script to Build Samsung Galaxy S9 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -9,6 +7,7 @@ import logging import os import uuid + from io import StringIO from pathlib import Path @@ -16,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("starltePkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -46,190 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("starltePkg/starlte.dsc", {}) - def GetName(self): + def GetName (self): return "starlte" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "starltePkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "starlte", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "starltePkg/starlte.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "starlte", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "starltePkg/starlte.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Samsung/starltePkg/starlte.dec b/Platforms/Samsung/starltePkg/starlte.dec index 83e775791..e69de29bb 100644 --- a/Platforms/Samsung/starltePkg/starlte.dec +++ b/Platforms/Samsung/starltePkg/starlte.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = starlte - PACKAGE_GUID = A1B48372-32DF-4294-BE88-10BF0EE9F11B - PACKAGE_VERSION = 1.0 - -[Guids] - gstarlteTokenSpaceGuid = { 0xA1B48372, 0x32DF, 0x4294, { 0xBE, 0x88, 0x10, 0xBF, 0x0E, 0xE9, 0xF1, 0x1B } } diff --git a/Platforms/Samsung/starltePkg/starlte.dsc b/Platforms/Samsung/starltePkg/starlte.dsc index 2a2c088f4..cee45944c 100644 --- a/Platforms/Samsung/starltePkg/starlte.dsc +++ b/Platforms/Samsung/starltePkg/starlte.dsc @@ -39,7 +39,7 @@ gArmTokenSpaceGuid.PcdSystemMemorySize|0x100000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"No Maintainer" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"No Maintainer" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80001000 diff --git a/Platforms/Samsung/x1sPkg/Include/APRIORI.inc b/Platforms/Samsung/x1sPkg/Include/APRIORI.inc index 139edf24e..e7136764a 100644 --- a/Platforms/Samsung/x1sPkg/Include/APRIORI.inc +++ b/Platforms/Samsung/x1sPkg/Include/APRIORI.inc @@ -14,7 +14,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/x1sPkg/Include/DXE.inc b/Platforms/Samsung/x1sPkg/Include/DXE.inc index 54fbb27eb..f64511a5d 100644 --- a/Platforms/Samsung/x1sPkg/Include/DXE.inc +++ b/Platforms/Samsung/x1sPkg/Include/DXE.inc @@ -21,7 +21,6 @@ INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf INF SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Platforms/Samsung/x1sPkg/PlatformBuild.py b/Platforms/Samsung/x1sPkg/PlatformBuild.py index ea6aa61de..104408b31 100644 --- a/Platforms/Samsung/x1sPkg/PlatformBuild.py +++ b/Platforms/Samsung/x1sPkg/PlatformBuild.py @@ -1,6 +1,4 @@ ## -# Script to Build Samsung Galaxy S20 5G UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -9,6 +7,7 @@ import logging import os import uuid + from io import StringIO from pathlib import Path @@ -16,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("x1sPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -46,190 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("x1sPkg/x1s.dsc", {}) - def GetName(self): + def GetName (self): return "x1s" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "x1sPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "x1s", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "x1sPkg/x1s.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "x1s", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "x1sPkg/x1s.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Samsung/x1sPkg/x1s.dec b/Platforms/Samsung/x1sPkg/x1s.dec index 0a821b84f..e69de29bb 100644 --- a/Platforms/Samsung/x1sPkg/x1s.dec +++ b/Platforms/Samsung/x1sPkg/x1s.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = x1s - PACKAGE_GUID = FFFA8AF8-0C7A-4240-A68F-4F3611DB3547 - PACKAGE_VERSION = 1.0 - -[Guids] - gx1sTokenSpaceGuid = { 0xFFFA8AF8, 0x0C7A, 0x4240, { 0xA6, 0x8F, 0x4F, 0x36, 0x11, 0xDB, 0x35, 0x47 } } diff --git a/Platforms/Samsung/x1sPkg/x1s.dsc b/Platforms/Samsung/x1sPkg/x1s.dsc index b16c0137a..f42200861 100644 --- a/Platforms/Samsung/x1sPkg/x1s.dsc +++ b/Platforms/Samsung/x1sPkg/x1s.dsc @@ -40,7 +40,7 @@ gArmTokenSpaceGuid.PcdSystemMemorySize|0x300000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"halal-beef" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"halal-beef" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80001000 diff --git a/Platforms/Sony/poplarPkg/Include/APRIORI.inc b/Platforms/Sony/poplarPkg/Include/APRIORI.inc index 4654d449d..6258e6c16 100644 --- a/Platforms/Sony/poplarPkg/Include/APRIORI.inc +++ b/Platforms/Sony/poplarPkg/Include/APRIORI.inc @@ -18,7 +18,6 @@ APRIORI DXE { # Core Drivers INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf diff --git a/Platforms/Sony/poplarPkg/Include/DXE.inc b/Platforms/Sony/poplarPkg/Include/DXE.inc index 14a95bc13..cdc05c3eb 100644 --- a/Platforms/Sony/poplarPkg/Include/DXE.inc +++ b/Platforms/Sony/poplarPkg/Include/DXE.inc @@ -29,7 +29,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/poplar/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/poplar/QcomPkg/Drivers/GLinkDxe/GLinkDxe.inf diff --git a/Platforms/Sony/poplarPkg/PlatformBuild.py b/Platforms/Sony/poplarPkg/PlatformBuild.py index 70502365f..31fed179b 100644 --- a/Platforms/Sony/poplarPkg/PlatformBuild.py +++ b/Platforms/Sony/poplarPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Sony Xperia XZ1 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("poplarPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("poplarPkg/poplar.dsc", {}) - def GetName(self): + def GetName (self): return "poplar" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "poplarPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "poplar", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "poplarPkg/poplar.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "poplar", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "poplarPkg/poplar.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Sony/poplarPkg/poplar.dec b/Platforms/Sony/poplarPkg/poplar.dec index 044ecbeaa..e69de29bb 100644 --- a/Platforms/Sony/poplarPkg/poplar.dec +++ b/Platforms/Sony/poplarPkg/poplar.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = poplar - PACKAGE_GUID = EF79C823-7988-42A1-8087-742F78A4734C - PACKAGE_VERSION = 1.0 - -[Guids] - gpoplarTokenSpaceGuid = { 0xEF79C823, 0x7988, 0x42A1, { 0x80, 0x87, 0x74, 0x2F, 0x78, 0xA4, 0x73, 0x4C } } diff --git a/Platforms/Sony/poplarPkg/poplar.dsc b/Platforms/Sony/poplarPkg/poplar.dsc index a21aa1e2f..e0607c4a7 100644 --- a/Platforms/Sony/poplarPkg/poplar.dsc +++ b/Platforms/Sony/poplarPkg/poplar.dsc @@ -39,7 +39,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Robotix22" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Robotix22" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -64,7 +64,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xA0000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/aliothPkg/Include/APRIORI.inc b/Platforms/Xiaomi/aliothPkg/Include/APRIORI.inc index 80c1281a0..d6335b2d1 100644 --- a/Platforms/Xiaomi/aliothPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/aliothPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/alioth/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/aliothPkg/Include/DXE.inc b/Platforms/Xiaomi/aliothPkg/Include/DXE.inc index 97d603e0b..34b9f22fc 100644 --- a/Platforms/Xiaomi/aliothPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/aliothPkg/Include/DXE.inc @@ -30,7 +30,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/alioth/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/alioth/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/aliothPkg/Include/RAW.inc b/Platforms/Xiaomi/aliothPkg/Include/RAW.inc index 07fceb993..5e7a32b38 100644 --- a/Platforms/Xiaomi/aliothPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/aliothPkg/Include/RAW.inc @@ -216,4 +216,4 @@ FILE FREEFORM = 73315170-E849-4E57-BD96-F9107B85B1AE { SECTION UI = "BATTERY.PROVISION2" SECTION RAW = Binaries/alioth/RawFiles/BATTERY.PROVISION2 - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/aliothPkg/PlatformBuild.py b/Platforms/Xiaomi/aliothPkg/PlatformBuild.py index 10b95cf9e..bbfa22422 100644 --- a/Platforms/Xiaomi/aliothPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/aliothPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Poco F3 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("aliothPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("aliothPkg/alioth.dsc", {}) - def GetName(self): + def GetName (self): return "alioth" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "aliothPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "alioth", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "aliothPkg/alioth.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "alioth", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "aliothPkg/alioth.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/aliothPkg/alioth.dec b/Platforms/Xiaomi/aliothPkg/alioth.dec index 807850ab0..e69de29bb 100644 --- a/Platforms/Xiaomi/aliothPkg/alioth.dec +++ b/Platforms/Xiaomi/aliothPkg/alioth.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = alioth - PACKAGE_GUID = 7F67CDAE-8312-4ECC-B948-D86C870D04D9 - PACKAGE_VERSION = 0.1 - -[Guids] - galiothTokenSpaceGuid = { 0x7F67CDAE, 0x8312, 0x4ECC, { 0xB9, 0x48, 0xD8, 0x6C, 0x87, 0x0D, 0x04, 0xD9 } } diff --git a/Platforms/Xiaomi/aliothPkg/alioth.dsc b/Platforms/Xiaomi/aliothPkg/alioth.dsc index d93f760b0..0e0e641e5 100644 --- a/Platforms/Xiaomi/aliothPkg/alioth.dsc +++ b/Platforms/Xiaomi/aliothPkg/alioth.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8250 # 1 = SM8250-AB # 2 = SM8250-AC + # SOC_TYPE = 2 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"AdrianoA3 & N1kroks" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"AdrianoA3 & N1kroks" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xA0000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|FALSE diff --git a/Platforms/Xiaomi/fogPkg/Include/APRIORI.inc b/Platforms/Xiaomi/fogPkg/Include/APRIORI.inc index fd82e4fbf..eae0bb199 100644 --- a/Platforms/Xiaomi/fogPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/fogPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/fog/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/fogPkg/Include/DXE.inc b/Platforms/Xiaomi/fogPkg/Include/DXE.inc index de860fe36..27ee2ec8c 100644 --- a/Platforms/Xiaomi/fogPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/fogPkg/Include/DXE.inc @@ -31,7 +31,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/fog/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/fog/QcomPkg/Drivers/GLinkDxe/GLinkDxe.inf diff --git a/Platforms/Xiaomi/fogPkg/Include/RAW.inc b/Platforms/Xiaomi/fogPkg/Include/RAW.inc index 67b25326d..19922fd63 100644 --- a/Platforms/Xiaomi/fogPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/fogPkg/Include/RAW.inc @@ -56,4 +56,4 @@ FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/fog/RawFiles/BATTERY.PROVISION - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/fogPkg/PlatformBuild.py b/Platforms/Xiaomi/fogPkg/PlatformBuild.py index 8817039e8..4742ae72a 100644 --- a/Platforms/Xiaomi/fogPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/fogPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Redmi 10C UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("fogPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("fogPkg/fog.dsc", {}) - def GetName(self): + def GetName (self): return "fog" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "fogPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "fog", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "fogPkg/fog.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "fog", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "fogPkg/fog.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/fogPkg/fog.dec b/Platforms/Xiaomi/fogPkg/fog.dec index 63f25e42e..e69de29bb 100644 --- a/Platforms/Xiaomi/fogPkg/fog.dec +++ b/Platforms/Xiaomi/fogPkg/fog.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = fog - PACKAGE_GUID = C62242F8-E275-4150-B6F3-1CC4FAC6425C - PACKAGE_VERSION = 1.0 - -[Guids] - gfogTokenSpaceGuid = { 0xC62242F8, 0xE275, 0x4150, { 0xB6, 0xF3, 0x1C, 0xC4, 0xFA, 0xC6, 0x42, 0x5C } } diff --git a/Platforms/Xiaomi/fogPkg/fog.dsc b/Platforms/Xiaomi/fogPkg/fog.dsc index 7f683c333..539aa9a0e 100644 --- a/Platforms/Xiaomi/fogPkg/fog.dsc +++ b/Platforms/Xiaomi/fogPkg/fog.dsc @@ -27,8 +27,10 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM6225 # 1 = SM6225-AD + # SOC_TYPE = 0 [BuildOptions] @@ -43,7 +45,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Statzar" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Statzar" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x5FF8C000 @@ -68,7 +70,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0x60000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/ginkgoPkg/Include/APRIORI.inc b/Platforms/Xiaomi/ginkgoPkg/Include/APRIORI.inc index b7bb07e34..e7b6abf1d 100644 --- a/Platforms/Xiaomi/ginkgoPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/ginkgoPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/ginkgo/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/ginkgoPkg/Include/DXE.inc b/Platforms/Xiaomi/ginkgoPkg/Include/DXE.inc index 40642a3ea..c7c2986bf 100644 --- a/Platforms/Xiaomi/ginkgoPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/ginkgoPkg/Include/DXE.inc @@ -31,7 +31,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/ginkgo/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/ginkgo/QcomPkg/Drivers/GLinkDxe/GLinkDxe.inf diff --git a/Platforms/Xiaomi/ginkgoPkg/Include/RAW.inc b/Platforms/Xiaomi/ginkgoPkg/Include/RAW.inc index 12257c0d3..2adfea805 100644 --- a/Platforms/Xiaomi/ginkgoPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/ginkgoPkg/Include/RAW.inc @@ -41,4 +41,4 @@ FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/ginkgo/RawFiles/BATTERY.PROVISION - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/ginkgoPkg/PlatformBuild.py b/Platforms/Xiaomi/ginkgoPkg/PlatformBuild.py index 84ae4b911..14376867e 100644 --- a/Platforms/Xiaomi/ginkgoPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/ginkgoPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Redmi Note 8/8T UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("ginkgoPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("ginkgoPkg/ginkgo.dsc", {}) - def GetName(self): + def GetName (self): return "ginkgo" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "ginkgoPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "ginkgo", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "ginkgoPkg/ginkgo.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "ginkgo", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "ginkgoPkg/ginkgo.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/ginkgoPkg/ginkgo.dec b/Platforms/Xiaomi/ginkgoPkg/ginkgo.dec index c1bc031cc..e69de29bb 100644 --- a/Platforms/Xiaomi/ginkgoPkg/ginkgo.dec +++ b/Platforms/Xiaomi/ginkgoPkg/ginkgo.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = ginkgo - PACKAGE_GUID = 630D1379-7D3F-4511-A6F9-578ABBC07518 - PACKAGE_VERSION = 1.0 - -[Guids] - gginkgoTokenSpaceGuid = { 0x630D1379, 0x7D3F, 0x4511, { 0xA6, 0xF9, 0x57, 0x8A, 0xBB, 0xC0, 0x75, 0x18 } } diff --git a/Platforms/Xiaomi/ginkgoPkg/ginkgo.dsc b/Platforms/Xiaomi/ginkgoPkg/ginkgo.dsc index d874638ce..c666297c8 100644 --- a/Platforms/Xiaomi/ginkgoPkg/ginkgo.dsc +++ b/Platforms/Xiaomi/ginkgoPkg/ginkgo.dsc @@ -39,7 +39,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Robotix22" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Robotix22" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x5FF8C000 @@ -64,7 +64,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0x60000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/laurel_sproutPkg/Include/APRIORI.inc b/Platforms/Xiaomi/laurel_sproutPkg/Include/APRIORI.inc index 5cae63d64..4dde215c0 100644 --- a/Platforms/Xiaomi/laurel_sproutPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/laurel_sproutPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/laurel_sprout/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/laurel_sproutPkg/Include/DXE.inc b/Platforms/Xiaomi/laurel_sproutPkg/Include/DXE.inc index 01e1af7d1..8fdea0593 100644 --- a/Platforms/Xiaomi/laurel_sproutPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/laurel_sproutPkg/Include/DXE.inc @@ -31,7 +31,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/laurel_sprout/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/laurel_sprout/QcomPkg/Drivers/GLinkDxe/GLinkDxe.inf diff --git a/Platforms/Xiaomi/laurel_sproutPkg/Include/RAW.inc b/Platforms/Xiaomi/laurel_sproutPkg/Include/RAW.inc index 24973f9e4..472c1210e 100644 --- a/Platforms/Xiaomi/laurel_sproutPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/laurel_sproutPkg/Include/RAW.inc @@ -36,4 +36,4 @@ FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/laurel_sprout/RawFiles/BATTERY.PROVISION - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/laurel_sproutPkg/PlatformBuild.py b/Platforms/Xiaomi/laurel_sproutPkg/PlatformBuild.py index 5893e0c6d..519c13630 100644 --- a/Platforms/Xiaomi/laurel_sproutPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/laurel_sproutPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Mi A3 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("laurel_sproutPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("laurel_sproutPkg/laurel_sprout.dsc", {}) - def GetName(self): + def GetName (self): return "laurel_sprout" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "laurel_sproutPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "laurel_sprout", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "laurel_sproutPkg/laurel_sprout.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "laurel_sprout", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "laurel_sproutPkg/laurel_sprout.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/laurel_sproutPkg/laurel_sprout.dec b/Platforms/Xiaomi/laurel_sproutPkg/laurel_sprout.dec index 3a2dfbe56..e69de29bb 100644 --- a/Platforms/Xiaomi/laurel_sproutPkg/laurel_sprout.dec +++ b/Platforms/Xiaomi/laurel_sproutPkg/laurel_sprout.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = laurel_sprout - PACKAGE_GUID = 30FA3A0B-87B1-4B91-A716-CD283A813C72 - PACKAGE_VERSION = 1.0 - -[Guids] - glaurel_sproutTokenSpaceGuid = { 0x30FA3A0B, 0x87B1, 0x4B91, { 0xA7, 0x16, 0xCD, 0x28, 0x3A, 0x81, 0x3C, 0x72 } } diff --git a/Platforms/Xiaomi/laurel_sproutPkg/laurel_sprout.dsc b/Platforms/Xiaomi/laurel_sproutPkg/laurel_sprout.dsc index 25c8e1ef0..82cc5c9ae 100644 --- a/Platforms/Xiaomi/laurel_sproutPkg/laurel_sprout.dsc +++ b/Platforms/Xiaomi/laurel_sproutPkg/laurel_sprout.dsc @@ -39,7 +39,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Kernel357" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Kernel357" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x5FF8C000 @@ -64,7 +64,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0x60000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/limePkg/Include/APRIORI.inc b/Platforms/Xiaomi/limePkg/Include/APRIORI.inc index f3a456f3b..6d13a7b39 100644 --- a/Platforms/Xiaomi/limePkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/limePkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/lime/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/limePkg/Include/DXE.inc b/Platforms/Xiaomi/limePkg/Include/DXE.inc index e0594fe3d..aa553259c 100644 --- a/Platforms/Xiaomi/limePkg/Include/DXE.inc +++ b/Platforms/Xiaomi/limePkg/Include/DXE.inc @@ -31,7 +31,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/lime/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/lime/QcomPkg/Drivers/GLinkDxe/GLinkDxe.inf diff --git a/Platforms/Xiaomi/limePkg/Include/RAW.inc b/Platforms/Xiaomi/limePkg/Include/RAW.inc index 4ebb6a175..d3c59d4fc 100644 --- a/Platforms/Xiaomi/limePkg/Include/RAW.inc +++ b/Platforms/Xiaomi/limePkg/Include/RAW.inc @@ -66,4 +66,4 @@ FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/lime/RawFiles/BATTERY.PROVISION - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/limePkg/PlatformBuild.py b/Platforms/Xiaomi/limePkg/PlatformBuild.py index 39558cdb7..429f4f63b 100644 --- a/Platforms/Xiaomi/limePkg/PlatformBuild.py +++ b/Platforms/Xiaomi/limePkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Redmi 9T UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("limePkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("limePkg/lime.dsc", {}) - def GetName(self): + def GetName (self): return "lime" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "limePkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "lime", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "limePkg/lime.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "lime", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "limePkg/lime.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/limePkg/lime.dec b/Platforms/Xiaomi/limePkg/lime.dec index fc4b56002..e69de29bb 100644 --- a/Platforms/Xiaomi/limePkg/lime.dec +++ b/Platforms/Xiaomi/limePkg/lime.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = lime - PACKAGE_GUID = 7004A90E-23E3-409F-887E-26CFFF6E4AE5 - PACKAGE_VERSION = 1.0 - -[Guids] - glimeTokenSpaceGuid = { 0x7004A90E, 0x23E3, 0x409F, { 0x88, 0x7E, 0x26, 0xCF, 0xFF, 0x6E, 0x4A, 0xE5 } } diff --git a/Platforms/Xiaomi/limePkg/lime.dsc b/Platforms/Xiaomi/limePkg/lime.dsc index e5c6ff54c..4a41f70f3 100644 --- a/Platforms/Xiaomi/limePkg/lime.dsc +++ b/Platforms/Xiaomi/limePkg/lime.dsc @@ -39,7 +39,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Robotix22" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Robotix22" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x5FF8C000 @@ -64,7 +64,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0x60000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/lisaPkg/Include/APRIORI.inc b/Platforms/Xiaomi/lisaPkg/Include/APRIORI.inc index 072f030b3..88c0ddc1f 100644 --- a/Platforms/Xiaomi/lisaPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/lisaPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/lisa/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/lisaPkg/Include/DXE.inc b/Platforms/Xiaomi/lisaPkg/Include/DXE.inc index 435594712..f12678154 100644 --- a/Platforms/Xiaomi/lisaPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/lisaPkg/Include/DXE.inc @@ -25,7 +25,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/lisa/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/lisa/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf diff --git a/Platforms/Xiaomi/lisaPkg/PlatformBuild.py b/Platforms/Xiaomi/lisaPkg/PlatformBuild.py index 39f7b58b7..6c724057b 100644 --- a/Platforms/Xiaomi/lisaPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/lisaPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Mi 11 Lite NE UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("lisaPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("lisaPkg/lisa.dsc", {}) - def GetName(self): + def GetName (self): return "lisa" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "lisaPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "lisa", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "lisaPkg/lisa.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "lisa", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "lisaPkg/lisa.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/lisaPkg/lisa.dec b/Platforms/Xiaomi/lisaPkg/lisa.dec index f18f5bb3c..e69de29bb 100644 --- a/Platforms/Xiaomi/lisaPkg/lisa.dec +++ b/Platforms/Xiaomi/lisaPkg/lisa.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = lisa - PACKAGE_GUID = 43C6BD82-8A2A-4256-8B40-0192BD310F58 - PACKAGE_VERSION = 0.1 - -[Guids] - glisaTokenSpaceGuid = { 0x43C6BD82, 0x8A2A, 0x4256, { 0x8B, 0x40, 0x01, 0x92, 0xBD, 0x31, 0x0F, 0x58 } } diff --git a/Platforms/Xiaomi/lisaPkg/lisa.dsc b/Platforms/Xiaomi/lisaPkg/lisa.dsc index b15dc3d5e..04290b526 100644 --- a/Platforms/Xiaomi/lisaPkg/lisa.dsc +++ b/Platforms/Xiaomi/lisaPkg/lisa.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 0 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM7325 # 1 = SM7325-AE # 2 = SM7325-AF + # SOC_TYPE = 0 [BuildOptions] @@ -43,7 +45,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"ETCHDEV" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"ETCHDEV" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -64,14 +66,14 @@ gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferHeight|2400 gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferColorDepth|32 - # XBL Protocols + # XBL Protocol gQcomPkgTokenSpaceGuid.PcdScheduleInterfaceAddr|0x9FC37980 # Dynamic RAM Start Address gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xE3400000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/lmiPkg/Include/APRIORI.inc b/Platforms/Xiaomi/lmiPkg/Include/APRIORI.inc index 4bb18cd38..7ba3d00b3 100644 --- a/Platforms/Xiaomi/lmiPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/lmiPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/lmi/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/lmiPkg/Include/DXE.inc b/Platforms/Xiaomi/lmiPkg/Include/DXE.inc index 9fe4b22af..9c6857931 100644 --- a/Platforms/Xiaomi/lmiPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/lmiPkg/Include/DXE.inc @@ -30,7 +30,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/lmi/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/lmi/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/lmiPkg/PlatformBuild.py b/Platforms/Xiaomi/lmiPkg/PlatformBuild.py index 8cb1cc006..aee42f809 100644 --- a/Platforms/Xiaomi/lmiPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/lmiPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Poco F3 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("lmiPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("lmiPkg/lmi.dsc", {}) - def GetName(self): + def GetName (self): return "lmi" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "lmiPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "lmi", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "lmiPkg/lmi.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "lmi", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "lmiPkg/lmi.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/lmiPkg/lmi.dec b/Platforms/Xiaomi/lmiPkg/lmi.dec index 133333802..e69de29bb 100644 --- a/Platforms/Xiaomi/lmiPkg/lmi.dec +++ b/Platforms/Xiaomi/lmiPkg/lmi.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = lmi - PACKAGE_GUID = 28F1A3BF-193A-47E3-A7B9-5A435EAAB2EE - PACKAGE_VERSION = 0.1 - -[Guids] - glmiTokenSpaceGuid = { 0x28F1A3BF, 0x193A, 0x47E3, { 0xB5, 0xDD, 0x5A, 0x43, 0x5E, 0xAA, 0xB2, 0xEE } } diff --git a/Platforms/Xiaomi/lmiPkg/lmi.dsc b/Platforms/Xiaomi/lmiPkg/lmi.dsc index ad0c9e56c..13befc11f 100644 --- a/Platforms/Xiaomi/lmiPkg/lmi.dsc +++ b/Platforms/Xiaomi/lmiPkg/lmi.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8250 # 1 = SM8250-AB # 2 = SM8250-AC + # SOC_TYPE = 2 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"AdrianoA3 & N1kroks" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"AdrianoA3 & N1kroks" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xA0000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/marblePkg/Include/APRIORI.inc b/Platforms/Xiaomi/marblePkg/Include/APRIORI.inc index 1a181a3a7..6be71f1d2 100644 --- a/Platforms/Xiaomi/marblePkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/marblePkg/Include/APRIORI.inc @@ -16,7 +16,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/marble/QcomPkg/Drivers/SmemDxe/SmemDxe.inf @@ -67,7 +66,7 @@ APRIORI DXE { INF Binaries/marble/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.inf INF Binaries/marble/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.inf -!if $(USE_DISPLAYDXE) == 1 +!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1 INF Binaries/marble/QcomPkg/Drivers/DisplayDxe/DisplayDxe.inf !else INF SiliciumPkg/Drivers/SimpleFbDxe/SimpleFbDxe.inf @@ -110,7 +109,7 @@ APRIORI DXE { INF Binaries/marble/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.inf INF Binaries/marble/QcomPkg/Drivers/TsensDxe/TsensDxe.inf INF Binaries/marble/QcomPkg/Drivers/LimitsDxe/LimitsDxe.inf -!if $(USE_DISPLAYDXE) == 1 +!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1 INF Binaries/marble/QcomPkg/Drivers/CPRDxe/CPRDxe.inf !endif INF Binaries/marble/QcomPkg/Drivers/GpiDxe/GpiDxe.inf diff --git a/Platforms/Xiaomi/marblePkg/Include/DXE.inc b/Platforms/Xiaomi/marblePkg/Include/DXE.inc index afd9bbbb4..9d3e27b2a 100644 --- a/Platforms/Xiaomi/marblePkg/Include/DXE.inc +++ b/Platforms/Xiaomi/marblePkg/Include/DXE.inc @@ -27,7 +27,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/marble/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/marble/QcomPkg/Drivers/IPCCDxe/IPCCDxe.inf @@ -71,7 +70,7 @@ INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf -!if $(USE_DISPLAYDXE) == 1 +!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1 INF Binaries/marble/QcomPkg/Drivers/CPRDxe/CPRDxe.inf !endif INF Binaries/marble/QcomPkg/Drivers/GpiDxe/GpiDxe.inf @@ -79,7 +78,7 @@ INF Binaries/marble/QcomPkg/Drivers/SdccDxe/SdccDxe.inf #INF Binaries/marble/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.inf -!if $(USE_DISPLAYDXE) == 1 +!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1 INF Binaries/marble/QcomPkg/Drivers/DisplayDxe/DisplayDxe.inf !else INF SiliciumPkg/Drivers/SimpleFbDxe/SimpleFbDxe.inf diff --git a/Platforms/Xiaomi/marblePkg/Include/RAW.inc b/Platforms/Xiaomi/marblePkg/Include/RAW.inc index ba32c7f40..54037be4f 100644 --- a/Platforms/Xiaomi/marblePkg/Include/RAW.inc +++ b/Platforms/Xiaomi/marblePkg/Include/RAW.inc @@ -1,332 +1,269 @@ -FILE FREEFORM = DDE58710-41CD-4306-DBFB-3FA90BB1D2DD { - SECTION UI = "uefiplat.cfg" - SECTION RAW = Binaries/marble/RawFiles/uefiplat.cfg -} - -FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { + FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { SECTION UI = "BDS_Menu.cfg" SECTION RAW = Binaries/marble/RawFiles/BDS_Menu.cfg -} - + } -FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { + FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { SECTION UI = "SecParti.cfg" SECTION RAW = Binaries/marble/RawFiles/SecParti.cfg -} - -FILE FREEFORM = A91D838E-A5FA-4138-825D-455E23030794 { - SECTION UI = "logo1.bmp" - SECTION RAW = Binaries/marble/RawFiles/logo1.bmp -} - + } -FILE FREEFORM = 8CAE2C55-FC5A-410B-812B-8CA22F572F36 { + FILE FREEFORM = 8CAE2C55-FC5A-410B-812B-8CA22F572F36 { SECTION UI = "Panel_truly_wqxga_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_truly_wqxga_dsc_cmd.xml -} + } - -FILE FREEFORM = 13AC9DC9-0092-4374-AE1A-06FF35950FD0 { + FILE FREEFORM = 13AC9DC9-0092-4374-AE1A-06FF35950FD0 { SECTION UI = "Panel_truly_wqxga_dsc_vid.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_truly_wqxga_dsc_vid.xml -} - + } -FILE FREEFORM = FC6315F9-F8FE-4222-A1E3-226DF55D7592 { + FILE FREEFORM = FC6315F9-F8FE-4222-A1E3-226DF55D7592 { SECTION UI = "Panel_truly_wqxga_dual_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_truly_wqxga_dual_cmd.xml -} - + } -FILE FREEFORM = 95E7B040-26A2-4511-9ABB-1D95D6DA7082 { + FILE FREEFORM = 95E7B040-26A2-4511-9ABB-1D95D6DA7082 { SECTION UI = "Panel_truly_wqxga_dual_vid.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_truly_wqxga_dual_vid.xml -} + } - -FILE FREEFORM = 8BC595B7-391A-4A9A-8256-5B9983B30392 { + FILE FREEFORM = 8BC595B7-391A-4A9A-8256-5B9983B30392 { SECTION UI = "Panel_sharp_4k_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_sharp_4k_dsc_cmd.xml -} - + } -FILE FREEFORM = 19B58ACD-B1F8-4078-B9A5-A33584B680E2 { + FILE FREEFORM = 19B58ACD-B1F8-4078-B9A5-A33584B680E2 { SECTION UI = "Panel_sharp_4k_dsc_vid.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_sharp_4k_dsc_vid.xml -} + } - -FILE FREEFORM = 0AE323D6-2EBE-11E8-8349-9BA636A0D80C { + FILE FREEFORM = 0AE323D6-2EBE-11E8-8349-9BA636A0D80C { SECTION UI = "Panel_sharp_1080p_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_sharp_1080p_cmd.xml -} - + } -FILE FREEFORM = 87273B42-311D-11E8-9324-DFB2DADFC3D1 { + FILE FREEFORM = 87273B42-311D-11E8-9324-DFB2DADFC3D1 { SECTION UI = "Panel_truly_1080p_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_truly_1080p_cmd.xml -} + } - -FILE FREEFORM = BAFD3200-311D-11E8-8651-0FB3CACF38FB { + FILE FREEFORM = BAFD3200-311D-11E8-8651-0FB3CACF38FB { SECTION UI = "Panel_truly_1080p_vid.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_truly_1080p_vid.xml -} - + } -FILE FREEFORM = 88CA5ABF-D0AC-4093-A68C-0CFAE1EF9635 { + FILE FREEFORM = 88CA5ABF-D0AC-4093-A68C-0CFAE1EF9635 { SECTION UI = "Panel_boe_amoled_wqhd_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd.xml -} - + } -FILE FREEFORM = 6523A5C9-91CB-45C0-A2DC-25997CF23369 { + FILE FREEFORM = 6523A5C9-91CB-45C0-A2DC-25997CF23369 { SECTION UI = "Panel_boe_amoled_wqhd_dsc_vid.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_boe_amoled_wqhd_dsc_vid.xml -} + } - -FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BE { + FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BE { SECTION UI = "Panel_boe_amoled_fhd_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_boe_amoled_fhd_dsc_cmd.xml -} - + } -FILE FREEFORM = 8F276EE4-E75E-4C3B-8BCC-C37771E26478 { + FILE FREEFORM = 8F276EE4-E75E-4C3B-8BCC-C37771E26478 { SECTION UI = "Panel_nt36860_wqhd_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_nt36860_wqhd_dsc_cmd.xml -} + } - -FILE FREEFORM = 6F2D4884-D8A0-11E9-AF7A-D77B1FE990EC { + FILE FREEFORM = 6F2D4884-D8A0-11E9-AF7A-D77B1FE990EC { SECTION UI = "Panel_nt36860_wqhd_dsc_vid.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_nt36860_wqhd_dsc_vid.xml -} - + } -FILE FREEFORM = 81CE7295-491D-4E3F-AAA7-AB43FEF2F615 { + FILE FREEFORM = 81CE7295-491D-4E3F-AAA7-AB43FEF2F615 { SECTION UI = "Panel_r66451_60hz_fhd_plus_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_r66451_60hz_fhd_plus_dsc_cmd.xml -} + } - -FILE FREEFORM = 8297C793-9861-422C-9F67-D447AF1EA812 { + FILE FREEFORM = 8297C793-9861-422C-9F67-D447AF1EA812 { SECTION UI = "Panel_r66451_120hz_fhd_plus_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_cmd.xml -} - + } -FILE FREEFORM = 61156380-EB8A-4618-940F-AB9BDEA1EEC2 { + FILE FREEFORM = 61156380-EB8A-4618-940F-AB9BDEA1EEC2 { SECTION UI = "Panel_r66451_120hz_fhd_plus_dsc_cmd_hdk.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_cmd_hdk.xml -} - + } -FILE FREEFORM = 44B09226-C2B4-45ED-AA6F-6686DB103978 { + FILE FREEFORM = 44B09226-C2B4-45ED-AA6F-6686DB103978 { SECTION UI = "Panel_r66451_120hz_fhd_plus_dsc_vid.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_vid.xml -} + } - -FILE FREEFORM = D3F8580C-CCB8-4804-BB03-776E7B542FC2 { + FILE FREEFORM = D3F8580C-CCB8-4804-BB03-776E7B542FC2 { SECTION UI = "Panel_secondary_truly_1080p_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_secondary_truly_1080p_cmd.xml -} - + } -FILE FREEFORM = D192FEE9-6A04-4BE8-ABFE-5534E2B457EC { + FILE FREEFORM = D192FEE9-6A04-4BE8-ABFE-5534E2B457EC { SECTION UI = "Panel_secondary_truly_1080p_vid.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_secondary_truly_1080p_vid.xml -} + } - -FILE FREEFORM = 714A3E09-FCBF-41BE-983D-65C015E0349E { + FILE FREEFORM = 714A3E09-FCBF-41BE-983D-65C015E0349E { SECTION UI = "Panel_r66451_60hz_fhd_plus_dsc_cmd_cphy.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_r66451_60hz_fhd_plus_dsc_cmd_cphy.xml -} - + } -FILE FREEFORM = 9599E50D-172D-403A-859E-3B744465D998 { + FILE FREEFORM = 9599E50D-172D-403A-859E-3B744465D998 { SECTION UI = "Panel_r66451_120hz_fhd_plus_dsc_cmd_cphy.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_cmd_cphy.xml -} + } - -FILE FREEFORM = CDE28842-A59C-46A0-B43B-1E1E49ACEE5A { + FILE FREEFORM = CDE28842-A59C-46A0-B43B-1E1E49ACEE5A { SECTION UI = "Panel_secondary_r66451_120hz_fhd_plus_dsc_cmd_cphy.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_secondary_r66451_120hz_fhd_plus_dsc_cmd_cphy.xml -} - + } -FILE FREEFORM = 9874B60A-6B80-4D76-8EEB-7862C780EC03 { + FILE FREEFORM = 9874B60A-6B80-4D76-8EEB-7862C780EC03 { SECTION UI = "Panel_r66451_144hz_fhd_plus_dsc_cmd_cphy.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_r66451_144hz_fhd_plus_dsc_cmd_cphy.xml -} - + } -FILE FREEFORM = BC28E12E-C7E0-47F9-BBF9-0B45ED6F4B18 { + FILE FREEFORM = BC28E12E-C7E0-47F9-BBF9-0B45ED6F4B18 { SECTION UI = "Panel_r66451_144hz_fhd_plus_dsc_vid_cphy.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_r66451_144hz_fhd_plus_dsc_vid_cphy.xml -} + } - -FILE FREEFORM = 637AD94D-7D9B-4D5F-B420-770B65BECDA8 { + FILE FREEFORM = 637AD94D-7D9B-4D5F-B420-770B65BECDA8 { SECTION UI = "Panel_r66451_60hz_fhd_plus_dsc_vid.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_r66451_60hz_fhd_plus_dsc_vid.xml -} - + } -FILE FREEFORM = 602CFFCD-8A5E-438E-B432-BF1A656A2561 { + FILE FREEFORM = 602CFFCD-8A5E-438E-B432-BF1A656A2561 { SECTION UI = "Panel_secondary_r66451_fhd_plus_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_secondary_r66451_fhd_plus_dsc_cmd.xml -} + } - -FILE FREEFORM = B2F70E67-7F12-4CA9-8E05-70D2A06A720D { + FILE FREEFORM = B2F70E67-7F12-4CA9-8E05-70D2A06A720D { SECTION UI = "Panel_secondary_r66451_120hz_fhd_plus_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_secondary_r66451_120hz_fhd_plus_dsc_cmd.xml -} - + } -FILE FREEFORM = 7321F393-1DF3-4A58-9040-DC1EEF15EB35 { + FILE FREEFORM = 7321F393-1DF3-4A58-9040-DC1EEF15EB35 { SECTION UI = "Panel_nt36672c_fhd_plus_90hz_video_cphy.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_nt36672c_fhd_plus_90hz_video_cphy.xml -} + } - -FILE FREEFORM = EB0A97F6-39DB-41D4-9B3C-CA3BADC144B4 { + FILE FREEFORM = EB0A97F6-39DB-41D4-9B3C-CA3BADC144B4 { SECTION UI = "Panel_truly_wqxga_cmd_splitlink.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_truly_wqxga_cmd_splitlink.xml -} - + } -FILE FREEFORM = F4A245C8-940E-4523-A53B-82E3C8BC6970 { + FILE FREEFORM = F4A245C8-940E-4523-A53B-82E3C8BC6970 { SECTION UI = "Panel_r66451_120hz_fhd_plus_dsc_cmd_demura.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_cmd_demura.xml -} - + } -FILE FREEFORM = 2C56DB5F-4DB8-4CF7-8151-435ABB1959DE { + FILE FREEFORM = 2C56DB5F-4DB8-4CF7-8151-435ABB1959DE { SECTION UI = "Panel_secondary_r66451_120hz_fhd_plus_dsc_vid.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_secondary_r66451_120hz_fhd_plus_dsc_vid.xml -} + } - -FILE FREEFORM = 2AA35939-4ECD-4EB5-AA0A-C07328F96FFF { + FILE FREEFORM = 2AA35939-4ECD-4EB5-AA0A-C07328F96FFF { SECTION UI = "Panel_r66451_144hz_fhd_plus_dsc_cmd_cphy_demura.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_r66451_144hz_fhd_plus_dsc_cmd_cphy_demura.xml -} - + } -FILE FREEFORM = 6165530E-F36D-4158-93A5-ABFDA6DD58DC { + FILE FREEFORM = 6165530E-F36D-4158-93A5-ABFDA6DD58DC { SECTION UI = "Panel_r66451_120hz_fhd_plus_dsc_vid_cphy.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_vid_cphy.xml -} + } - -FILE FREEFORM = 03E9256F-E621-48D8-8576-7E3B4FCF2D41 { + FILE FREEFORM = 03E9256F-E621-48D8-8576-7E3B4FCF2D41 { SECTION UI = "PanelSimConfig.csv" SECTION RAW = Binaries/marble/RawFiles/PanelSimConfig.csv -} - + } -FILE FREEFORM = 20DFC476-CB60-4613-8186-462062C102BB { + FILE FREEFORM = 20DFC476-CB60-4613-8186-462062C102BB { SECTION UI = "Panel_L2s_38_0c_0a_ltpo_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_L2s_38_0c_0a_ltpo_dsc_cmd.xml -} + } - -FILE FREEFORM = F2992DB9-EC8F-44DA-96D8-805F74EE205B { + FILE FREEFORM = F2992DB9-EC8F-44DA-96D8-805F74EE205B { SECTION UI = "Panel_L2s_42_02_0b_ltpo_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_L2s_42_02_0b_ltpo_dsc_cmd.xml -} - + } -FILE FREEFORM = 1DEAE31F-3216-4A2F-BC8E-F571356FCFF9 { + FILE FREEFORM = 1DEAE31F-3216-4A2F-BC8E-F571356FCFF9 { SECTION UI = "Panel_L1_38_0c_0a_ltpo_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_L1_38_0c_0a_ltpo_dsc_cmd.xml -} - + } -FILE FREEFORM = 801EAA85-90D2-4B0D-8126-4B892F870A83 { + FILE FREEFORM = 801EAA85-90D2-4B0D-8126-4B892F870A83 { SECTION UI = "Panel_L12_42_02_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_L12_42_02_0a_amoled_dsc_cmd.xml -} + } - -FILE FREEFORM = 86A049ED-45FA-46D7-86F7-DBDB169190B4 { + FILE FREEFORM = 86A049ED-45FA-46D7-86F7-DBDB169190B4 { SECTION UI = "Panel_L12_36_02_0b_amoled_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_L12_36_02_0b_amoled_dsc_cmd.xml -} - + } -FILE FREEFORM = 5A0F26F6-EA36-4610-89C8-CC1FA94155A8 { + FILE FREEFORM = 5A0F26F6-EA36-4610-89C8-CC1FA94155A8 { SECTION UI = "Panel_L3s_42_02_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_L3s_42_02_0a_amoled_dsc_cmd.xml -} + } - -FILE FREEFORM = CD4583D5-54E6-4322-A337-52E62F2C4B0D { + FILE FREEFORM = CD4583D5-54E6-4322-A337-52E62F2C4B0D { SECTION UI = "Panel_L18_38_0c_0a_sec_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_L18_38_0c_0a_sec_dsc_cmd.xml -} - + } -FILE FREEFORM = 31A71E4D-7B08-4254-A5B2-98F005D1FB8B { + FILE FREEFORM = 31A71E4D-7B08-4254-A5B2-98F005D1FB8B { SECTION UI = "Panel_L18_38_0c_0a_prim_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_L18_38_0c_0a_prim_dsc_cmd.xml -} + } - -FILE FREEFORM = 70AFC6EB-83B9-411E-8AA4-A417060B73B1 { + FILE FREEFORM = 70AFC6EB-83B9-411E-8AA4-A417060B73B1 { SECTION UI = "Panel_M11a_42_02_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_M11a_42_02_0a_amoled_dsc_cmd.xml -} - + } -FILE FREEFORM = 8B9500EB-AAC2-4C28-BDBB-31BCAA8A8BB0 { + FILE FREEFORM = 8B9500EB-AAC2-4C28-BDBB-31BCAA8A8BB0 { SECTION UI = "Panel_M81_36_02_0a_dualdsi_dsc_lcd_video.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_M81_36_02_0a_dualdsi_dsc_lcd_video.xml -} - + } -FILE FREEFORM = 96BEE5CB-A665-4192-81E3-587A7F89B6FB { + FILE FREEFORM = 96BEE5CB-A665-4192-81E3-587A7F89B6FB { SECTION UI = "Panel_M81_42_02_0b_dualdsi_dsc_lcd_video.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_M81_42_02_0b_dualdsi_dsc_lcd_video.xml -} + } - -FILE FREEFORM = C5284DC2-862A-40EE-8A78-3F7793D0D049 { + FILE FREEFORM = C5284DC2-862A-40EE-8A78-3F7793D0D049 { SECTION UI = "Panel_secondary_sim_vdo.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_secondary_sim_vdo.xml -} - + } -FILE FREEFORM = 795F640A-1DA3-436E-86B9-8F14B3D99569 { + FILE FREEFORM = 795F640A-1DA3-436E-86B9-8F14B3D99569 { SECTION UI = "Panel_M16t_36_02_0a_amoled_dsc_vid.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_M16t_36_02_0a_amoled_dsc_vid.xml -} - + } -FILE FREEFORM = 3448F286-7E1B-4784-92E3-06D8EDBCA002 { + FILE FREEFORM = 3448F286-7E1B-4784-92E3-06D8EDBCA002 { SECTION UI = "Panel_M16t_36_0d_0b_amoled_dsc_vid.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_M16t_36_0d_0b_amoled_dsc_vid.xml -} + } - -FILE FREEFORM = 179EA33F-F374-46A8-8719-D8AB78B6332E { + FILE FREEFORM = 179EA33F-F374-46A8-8719-D8AB78B6332E { SECTION UI = "Panel_M80_42_02_0a_dsi_dsc_video.xml" SECTION RAW = Binaries/marble/RawFiles/Panel_M80_42_02_0a_dsi_dsc_video.xml -} - + } -FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { + FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { SECTION UI = "uefipil.cfg" SECTION RAW = Binaries/marble/RawFiles/uefipil.cfg -} - + } -FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { + FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { SECTION UI = "QcomChargerCfg.cfg" SECTION RAW = Binaries/marble/RawFiles/QcomChargerCfg.cfg -} + } diff --git a/Platforms/Xiaomi/marblePkg/PlatformBuild.py b/Platforms/Xiaomi/marblePkg/PlatformBuild.py index 1992cbe2f..821e9ede7 100644 --- a/Platforms/Xiaomi/marblePkg/PlatformBuild.py +++ b/Platforms/Xiaomi/marblePkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi POCO F5 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("marblePkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("marblePkg/marble.dsc", {}) - def GetName(self): + def GetName (self): return "marble" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "marblePkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "marble", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "marblePkg/marble.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to CLANGDWARF") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "marble", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "marblePkg/marble.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/marblePkg/marble.dec b/Platforms/Xiaomi/marblePkg/marble.dec index cd6b92c11..e69de29bb 100644 --- a/Platforms/Xiaomi/marblePkg/marble.dec +++ b/Platforms/Xiaomi/marblePkg/marble.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = marble - PACKAGE_GUID = 11525221-3953-4778-B18F-45AD6419D181 - PACKAGE_VERSION = 0.1 - -[Guids] - gmarbleTokenSpaceGuid = { 0x1ead32ce, 0x3165, 0x49eb, { 0xa9, 0x2d, 0xe8, 0x8a, 0x42, 0x57, 0x20, 0x02 } } diff --git a/Platforms/Xiaomi/marblePkg/marble.dsc b/Platforms/Xiaomi/marblePkg/marble.dsc index eb4615021..caa2b5851 100644 --- a/Platforms/Xiaomi/marblePkg/marble.dsc +++ b/Platforms/Xiaomi/marblePkg/marble.dsc @@ -23,11 +23,12 @@ BUILD_TARGETS = RELEASE|DEBUG SKUID_IDENTIFIER = DEFAULT FLASH_DEFINITION = marblePkg/marble.fdf - USE_DISPLAYDXE = 0 + USE_CUSTOM_DISPLAY_DRIVER = 0 AB_SLOT_SUPPORT = 1 - - [BuildOptions] - *_*_*_CC_FLAGS = -DAB_SLOT_SUPPORT=$(AB_SLOT_SUPPORT) + HAS_BUILD_IN_KEYBOARD = 0 + +[BuildOptions] + *_*_*_CC_FLAGS = -DAB_SLOT_SUPPORT=$(AB_SLOT_SUPPORT) -DHAS_BUILD_IN_KEYBOARD=$(HAS_BUILD_IN_KEYBOARD) [LibraryClasses] DeviceMemoryMapLib|marblePkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.inf @@ -38,7 +39,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"tagicmi" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"tagicmi" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0xA7600000 @@ -67,7 +68,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0x80000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/miatollPkg/Include/APRIORI.inc b/Platforms/Xiaomi/miatollPkg/Include/APRIORI.inc index 07509d614..541f380e6 100644 --- a/Platforms/Xiaomi/miatollPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/miatollPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/miatoll/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/miatollPkg/Include/DXE.inc b/Platforms/Xiaomi/miatollPkg/Include/DXE.inc index 70b647e3f..3fcbd1913 100644 --- a/Platforms/Xiaomi/miatollPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/miatollPkg/Include/DXE.inc @@ -30,7 +30,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/miatoll/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/miatoll/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/miatollPkg/Include/RAW.inc b/Platforms/Xiaomi/miatollPkg/Include/RAW.inc index a89244c1c..64fcd91c9 100644 --- a/Platforms/Xiaomi/miatollPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/miatollPkg/Include/RAW.inc @@ -1,39 +1,39 @@ -FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { + FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { SECTION UI = "BDS_Menu.cfg" SECTION RAW = Binaries/miatoll/RawFiles/BDS_Menu.cfg -} + } -FILE FREEFORM = 8CAE2C55-FC5A-410B-812B-8CA22F572F36 { + FILE FREEFORM = 8CAE2C55-FC5A-410B-812B-8CA22F572F36 { SECTION UI = "Panel_rm69299_amoled_fhd_plus_video.xml" SECTION RAW = Binaries/miatoll/RawFiles/Panel_rm69299_amoled_fhd_plus_video.xml -} + } -FILE FREEFORM = 8CAE2C55-FC5A-410B-812B-8CA22F557623 { + FILE FREEFORM = 8CAE2C55-FC5A-410B-812B-8CA22F557623 { SECTION UI = "Panel_huaxing_ft8756_fhd_vid.xml" SECTION RAW = Binaries/miatoll/RawFiles/Panel_huaxing_ft8756_fhd_vid.xml -} + } -FILE FREEFORM = 4042B497-0B6E-490E-90DC-E321C75B5CE9 { + FILE FREEFORM = 4042B497-0B6E-490E-90DC-E321C75B5CE9 { SECTION UI = "Panel_tianma_nt36675_fhd_vid.xml" SECTION RAW = Binaries/miatoll/RawFiles/Panel_tianma_nt36675_fhd_vid.xml -} + } -FILE FREEFORM = CE09CA21-74A1-41F1-A2A2-6C3114EB5AD7 { + FILE FREEFORM = CE09CA21-74A1-41F1-A2A2-6C3114EB5AD7 { SECTION UI = "Panel_nt36672c_boe_fhd_plus_video.xml" SECTION RAW = Binaries/miatoll/RawFiles/Panel_nt36672c_boe_fhd_plus_video.xml -} + } -FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { + FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { SECTION UI = "SecParti.cfg" SECTION RAW = Binaries/miatoll/RawFiles/SecParti.cfg -} + } -FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { + FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { SECTION UI = "uefipil.cfg" SECTION RAW = Binaries/miatoll/RawFiles/uefipil.cfg -} + } -FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { + FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { SECTION UI = "QcomChargerCfg.cfg" SECTION RAW = Binaries/miatoll/RawFiles/QcomChargerCfg.cfg -} \ No newline at end of file + } diff --git a/Platforms/Xiaomi/miatollPkg/PlatformBuild.py b/Platforms/Xiaomi/miatollPkg/PlatformBuild.py index 32e7c1313..628acd39d 100644 --- a/Platforms/Xiaomi/miatollPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/miatollPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Redmi Note 9 Pro UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("miatollPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,192 +41,136 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("miatollPkg/miatoll.dsc", {}) - def GetName(self): + def GetName (self): return "miatoll" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "miatollPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "miatoll", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "miatollPkg/miatoll.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_DEVICE_MODEL", self.env.GetValue("DEVICE_MODEL"), "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "miatoll", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "miatollPkg/miatoll.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_DEVICE_MODEL", self.env.GetValue("DEVICE_MODEL"), "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -240,17 +180,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/miatollPkg/miatoll.dec b/Platforms/Xiaomi/miatollPkg/miatoll.dec index 97a65f9a0..e69de29bb 100644 --- a/Platforms/Xiaomi/miatollPkg/miatoll.dec +++ b/Platforms/Xiaomi/miatollPkg/miatoll.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = miatoll - PACKAGE_GUID = 3BFFEB18-3948-4022-888F-608530C61CDD - PACKAGE_VERSION = 1.0 - -[Guids] - gmiatollTokenSpaceGuid = { 0x3BFFEB18, 0x3948, 0x4022, { 0x88, 0x8F, 0x60, 0x85, 0x30, 0xC6, 0x1C, 0xDD } } diff --git a/Platforms/Xiaomi/miatollPkg/miatoll.dsc b/Platforms/Xiaomi/miatollPkg/miatoll.dsc index 1bcbf5ef3..713dfd789 100644 --- a/Platforms/Xiaomi/miatollPkg/miatoll.dsc +++ b/Platforms/Xiaomi/miatollPkg/miatoll.dsc @@ -39,7 +39,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"N1kroks" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"N1kroks" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -93,7 +93,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xA0000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/munchPkg/Include/APRIORI.inc b/Platforms/Xiaomi/munchPkg/Include/APRIORI.inc index 687ea35d1..65f2c852d 100644 --- a/Platforms/Xiaomi/munchPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/munchPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/munch/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/munchPkg/Include/DXE.inc b/Platforms/Xiaomi/munchPkg/Include/DXE.inc index ba6ba8883..e537d2859 100644 --- a/Platforms/Xiaomi/munchPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/munchPkg/Include/DXE.inc @@ -31,7 +31,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/munch/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/munch/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/munchPkg/Include/RAW.inc b/Platforms/Xiaomi/munchPkg/Include/RAW.inc index 9be588be3..4f61b2ce4 100644 --- a/Platforms/Xiaomi/munchPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/munchPkg/Include/RAW.inc @@ -1,341 +1,244 @@ -FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { + FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { SECTION UI = "BDS_Menu.cfg" SECTION RAW = Binaries/munch/RawFiles/BDS_Menu.cfg -} + } - -FILE FREEFORM = A91D838E-A5FA-4138-825D-455E23030794 { - SECTION UI = "logo1.bmp" - SECTION RAW = Binaries/munch/RawFiles/logo1.bmp -} - - -FILE FREEFORM = 8CAE2C55-FC5A-410B-812B-8CA22F572F36 { + FILE FREEFORM = 8CAE2C55-FC5A-410B-812B-8CA22F572F36 { SECTION UI = "Panel_truly_wqxga_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_truly_wqxga_dsc_cmd.xml -} + } - -FILE FREEFORM = 13AC9DC9-0092-4374-AE1A-06FF35950FD0 { + FILE FREEFORM = 13AC9DC9-0092-4374-AE1A-06FF35950FD0 { SECTION UI = "Panel_truly_wqxga_dsc_vid.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_truly_wqxga_dsc_vid.xml -} - + } -FILE FREEFORM = FC6315F9-F8FE-4222-A1E3-226DF55D7592 { + FILE FREEFORM = FC6315F9-F8FE-4222-A1E3-226DF55D7592 { SECTION UI = "Panel_truly_wqxga_dual_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_truly_wqxga_dual_cmd.xml -} + } - -FILE FREEFORM = 95E7B040-26A2-4511-9ABB-1D95D6DA7082 { + FILE FREEFORM = 95E7B040-26A2-4511-9ABB-1D95D6DA7082 { SECTION UI = "Panel_truly_wqxga_dual_vid.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_truly_wqxga_dual_vid.xml -} - + } -FILE FREEFORM = 8BC595B7-391A-4A9A-8256-5B9983B30392 { + FILE FREEFORM = 8BC595B7-391A-4A9A-8256-5B9983B30392 { SECTION UI = "Panel_sharp_4k_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_sharp_4k_dsc_cmd.xml -} + } - -FILE FREEFORM = 19B58ACD-B1F8-4078-B9A5-A33584B680E2 { + FILE FREEFORM = 19B58ACD-B1F8-4078-B9A5-A33584B680E2 { SECTION UI = "Panel_sharp_4k_dsc_vid.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_sharp_4k_dsc_vid.xml -} - + } -FILE FREEFORM = 0AE323D6-2EBE-11E8-8349-9BA636A0D80C { + FILE FREEFORM = 0AE323D6-2EBE-11E8-8349-9BA636A0D80C { SECTION UI = "Panel_sharp_1080p_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_sharp_1080p_cmd.xml -} + } - -FILE FREEFORM = 87273B42-311D-11E8-9324-DFB2DADFC3D1 { + FILE FREEFORM = 87273B42-311D-11E8-9324-DFB2DADFC3D1 { SECTION UI = "Panel_truly_1080p_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_truly_1080p_cmd.xml -} - + } -FILE FREEFORM = BAFD3200-311D-11E8-8651-0FB3CACF38FB { + FILE FREEFORM = BAFD3200-311D-11E8-8651-0FB3CACF38FB { SECTION UI = "Panel_truly_1080p_vid.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_truly_1080p_vid.xml -} + } - -FILE FREEFORM = 88CA5ABF-D0AC-4093-A68C-0CFAE1EF9635 { + FILE FREEFORM = 88CA5ABF-D0AC-4093-A68C-0CFAE1EF9635 { SECTION UI = "Panel_boe_amoled_wqhd_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd.xml -} - + } -FILE FREEFORM = 6523A5C9-91CB-45C0-A2DC-25997CF23369 { + FILE FREEFORM = 6523A5C9-91CB-45C0-A2DC-25997CF23369 { SECTION UI = "Panel_boe_amoled_wqhd_dsc_vid.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_boe_amoled_wqhd_dsc_vid.xml -} + } - -FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BE { + FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BE { SECTION UI = "Panel_boe_amoled_fhd_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_boe_amoled_fhd_dsc_cmd.xml -} - + } -FILE FREEFORM = 2BCA3B86-E175-4609-AC7F-207908B89C75 { + FILE FREEFORM = 2BCA3B86-E175-4609-AC7F-207908B89C75 { SECTION UI = "Panel_primary_sharp_1080p_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_primary_sharp_1080p_cmd.xml -} + } - -FILE FREEFORM = 6343A5E1-E477-452A-B62C-1560C4CBD9F5 { + FILE FREEFORM = 6343A5E1-E477-452A-B62C-1560C4CBD9F5 { SECTION UI = "Panel_secondary_truly_1080p_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_secondary_truly_1080p_cmd.xml -} - + } -FILE FREEFORM = 151C5D22-957F-4861-A605-E27154BBDA25 { + FILE FREEFORM = 151C5D22-957F-4861-A605-E27154BBDA25 { SECTION UI = "Panel_secondary_truly_1080p_vid.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_secondary_truly_1080p_vid.xml -} + } - -FILE FREEFORM = F07B31B1-2881-4279-B5C5-7893BE5E57F5 { + FILE FREEFORM = F07B31B1-2881-4279-B5C5-7893BE5E57F5 { SECTION UI = "Panel_J2_38_0c_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_J2_38_0c_0a_amoled_dsc_cmd.xml -} - + } -FILE FREEFORM = 047DB9C9-34EB-4DDF-AE78-7E817306B995 { + FILE FREEFORM = 047DB9C9-34EB-4DDF-AE78-7E817306B995 { SECTION UI = "Panel_J2_P2_1_38_0c_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_J2_P2_1_38_0c_0a_amoled_dsc_cmd.xml -} + } - -FILE FREEFORM = F961ECD7-53AD-4A52-BB53-1A7990E8C1CC { + FILE FREEFORM = F961ECD7-53AD-4A52-BB53-1A7990E8C1CC { SECTION UI = "Panel_J2_42_02_0b_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_J2_42_02_0b_amoled_dsc_cmd.xml -} - + } -FILE FREEFORM = 342B4484-A21C-4D3D-ABD7-F1D451D6EC36 { + FILE FREEFORM = 342B4484-A21C-4D3D-ABD7-F1D451D6EC36 { SECTION UI = "Panel_J2_P1_42_02_0b_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_J2_P1_42_02_0b_amoled_dsc_cmd.xml -} + } - -FILE FREEFORM = 1E865D95-BF7E-484C-95CC-CE330E6135EC { + FILE FREEFORM = 1E865D95-BF7E-484C-95CC-CE330E6135EC { SECTION UI = "Panel_J2_P2_1_42_02_0b_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_J2_P2_1_42_02_0b_amoled_dsc_cmd.xml -} - + } -FILE FREEFORM = 9C5CCE01-F224-491F-8663-5D72789DE3DB { + FILE FREEFORM = 9C5CCE01-F224-491F-8663-5D72789DE3DB { SECTION UI = "Panel_J2_MP_42_02_0b_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_J2_MP_42_02_0b_amoled_dsc_cmd.xml -} + } - -FILE FREEFORM = E1E6BA0E-FFA9-49F6-B12F-EE91173B055C { + FILE FREEFORM = E1E6BA0E-FFA9-49F6-B12F-EE91173B055C { SECTION UI = "Panel_J1S_42_02_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_J1S_42_02_0a_amoled_dsc_cmd.xml -} - + } -FILE FREEFORM = 4FD1327D-DA2C-4C68-A8E9-9FFD79C40549 { + FILE FREEFORM = 4FD1327D-DA2C-4C68-A8E9-9FFD79C40549 { SECTION UI = "Panel_K11A_38_08_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_K11A_38_08_0a_amoled_dsc_cmd.xml -} + } - -FILE FREEFORM = AD9F7C88-FAAF-43D6-B5B9-EE420E8673D5 { + FILE FREEFORM = AD9F7C88-FAAF-43D6-B5B9-EE420E8673D5 { SECTION UI = "Panel_L11R_38_08_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_L11R_38_08_0a_amoled_dsc_cmd.xml -} - + } -FILE FREEFORM = 85F54ABD-6BBE-48EB-9699-37B6C68BCAAF { + FILE FREEFORM = 85F54ABD-6BBE-48EB-9699-37B6C68BCAAF { SECTION UI = "Panel_j11_38_08_0a_fhd_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_j11_38_08_0a_fhd_cmd.xml -} + } - -FILE FREEFORM = AD2628E7-35EE-4208-9893-B8057E5D3789 { + FILE FREEFORM = AD2628E7-35EE-4208-9893-B8057E5D3789 { SECTION UI = "Panel_J1T_38_0c_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_J1T_38_0c_0a_amoled_dsc_cmd.xml -} - + } -FILE FREEFORM = 85FBE80E-C122-4D73-B5E7-2FEB8CB98016 { + FILE FREEFORM = 85FBE80E-C122-4D73-B5E7-2FEB8CB98016 { SECTION UI = "Panel_J3S_37_02_0a_lcd_dsc_vid.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_J3S_37_02_0a_lcd_dsc_vid.xml -} + } - -FILE FREEFORM = 2962BFBA-D7E7-4F37-A4C6-E28F7B5A685A { + FILE FREEFORM = 2962BFBA-D7E7-4F37-A4C6-E28F7B5A685A { SECTION UI = "Panel_K81_42_02_0a_dualdsi_cphy_lcd_vid.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_K81_42_02_0a_dualdsi_cphy_lcd_vid.xml -} - + } -FILE FREEFORM = C3F9FA09-0B18-B0F8-7AA7-10F761A6C699 { + FILE FREEFORM = C3F9FA09-0B18-B0F8-7AA7-10F761A6C699 { SECTION UI = "Panel_K81_35_02_0b_dualdsi_cphy_lcd_vid.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_K81_35_02_0b_dualdsi_cphy_lcd_vid.xml -} + } - -FILE FREEFORM = 8F276EE4-E75E-4C3B-8BCC-C37771E26478 { + FILE FREEFORM = 8F276EE4-E75E-4C3B-8BCC-C37771E26478 { SECTION UI = "Panel_nt36860_wqhd_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_nt36860_wqhd_dsc_cmd.xml -} - + } -FILE FREEFORM = 6F2D4884-D8A0-11E9-AF7A-D77B1FE990EC { + FILE FREEFORM = 6F2D4884-D8A0-11E9-AF7A-D77B1FE990EC { SECTION UI = "Panel_nt36860_wqhd_dsc_vid.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_nt36860_wqhd_dsc_vid.xml -} + } - -FILE FREEFORM = 189B1AA7-8C72-4547-8EEB-B4FFD7500282 { + FILE FREEFORM = 189B1AA7-8C72-4547-8EEB-B4FFD7500282 { SECTION UI = "Panel_J2S_MP_42_02_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_J2S_MP_42_02_0a_amoled_dsc_cmd.xml -} - + } -FILE FREEFORM = FBC172E3-D704-431B-8358-2A6E7C714D06 { + FILE FREEFORM = FBC172E3-D704-431B-8358-2A6E7C714D06 { SECTION UI = "Panel_J2S_MP_42_02_0b_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_J2S_MP_42_02_0b_amoled_dsc_cmd.xml -} + } - -FILE FREEFORM = 608D5DBA-0EC0-4BB9-8BFC-1BD132603084 { + FILE FREEFORM = 608D5DBA-0EC0-4BB9-8BFC-1BD132603084 { SECTION UI = "Panel_L3A_MP_42_02_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_L3A_MP_42_02_0a_amoled_dsc_cmd.xml -} - + } -FILE FREEFORM = FC919C74-46DA-4147-A590-E00F3F1A1875 { + FILE FREEFORM = FC919C74-46DA-4147-A590-E00F3F1A1875 { SECTION UI = "Panel_L10A_42_02_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_L10A_42_02_0a_amoled_dsc_cmd.xml -} + } - -FILE FREEFORM = 664E5A9E-17F4-4C12-B4F1-CC171CF5C71C { + FILE FREEFORM = 664E5A9E-17F4-4C12-B4F1-CC171CF5C71C { SECTION UI = "Panel_L10A_42_02_0b_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_L10A_42_02_0b_amoled_dsc_cmd.xml -} - + } -FILE FREEFORM = 70702D1F-C448-491A-91D7-FE5BE5B5E15B { + FILE FREEFORM = 70702D1F-C448-491A-91D7-FE5BE5B5E15B { SECTION UI = "Panel_L10A_36_02_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_L10A_36_02_0a_amoled_dsc_cmd.xml -} + } - -FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BF { + FILE FREEFORM = D7170685-5965-4B44-9305-37CDB199B9BF { SECTION UI = "Panel_nt36672e_fhd_plus_60hz_vid.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_nt36672e_fhd_plus_60hz_vid.xml -} - + } -FILE FREEFORM = 7C33C94F-0619-4DE0-84A8-B2BCC98245B0 { + FILE FREEFORM = 7C33C94F-0619-4DE0-84A8-B2BCC98245B0 { SECTION UI = "Panel_seeya_uoled_1080p_vid.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_seeya_uoled_1080p_vid.xml -} + } - -FILE FREEFORM = CE2946CF-9FC5-44B6-A499-0D5B4D4D08E2 { + FILE FREEFORM = CE2946CF-9FC5-44B6-A499-0D5B4D4D08E2 { SECTION UI = "Panel_r66451_fhd_plus_60hz_cmd.xml" SECTION RAW = Binaries/munch/RawFiles/Panel_r66451_fhd_plus_60hz_cmd.xml -} - - -FILE FREEFORM = 3E5584ED-05D4-4267-9048-0D47F76F4248 { - SECTION UI = "battery_symbol_Soc10.bmp" - SECTION RAW = Binaries/munch/RawFiles/battery_symbol_Soc10.bmp -} - - -FILE FREEFORM = 4753E815-DDD8-402D-BF69-9B8C4EB7573E { - SECTION UI = "battery_symbol_NoBattery.bmp" - SECTION RAW = Binaries/munch/RawFiles/battery_symbol_NoBattery.bmp -} - - -FILE FREEFORM = 03DED53E-BECD-428F-9F79-5ABA64C58445 { - SECTION UI = "battery_symbol_Nocharger.bmp" - SECTION RAW = Binaries/munch/RawFiles/battery_symbol_Nocharger.bmp -} - + } -FILE FREEFORM = 8B86CD38-C772-4FCF-85AA-345B2B3C1AB4 { - SECTION UI = "battery_symbol_LowBatteryCharging.bmp" - SECTION RAW = Binaries/munch/RawFiles/battery_symbol_LowBatteryCharging.bmp -} - - -FILE FREEFORM = 3FD97907-93F1-4349-AF3C-3B68B0A5E626 { - SECTION UI = "battery_symbol_LowBattery.bmp" - SECTION RAW = Binaries/munch/RawFiles/battery_symbol_LowBattery.bmp -} - - -FILE FREEFORM = E2EA5A4F-98BD-4203-AB49-399505DDFB7D { - SECTION UI = "tsens_thermal_symbol.bmp" - SECTION RAW = Binaries/munch/RawFiles/tsens_thermal_symbol.bmp -} - - -FILE FREEFORM = C72FB1A9-5527-4E13-BAC4-F671D0330145 { - SECTION UI = "tsens_thermal_err_symbol.bmp" - SECTION RAW = Binaries/munch/RawFiles/tsens_thermal_err_symbol.bmp -} - - -FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { + FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { SECTION UI = "SecParti.cfg" SECTION RAW = Binaries/munch/RawFiles/SecParti.cfg -} + } - -FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { + FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { SECTION UI = "uefipil.cfg" SECTION RAW = Binaries/munch/RawFiles/uefipil.cfg -} - + } -FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { + FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { SECTION UI = "QcomChargerCfg.cfg" SECTION RAW = Binaries/munch/RawFiles/QcomChargerCfg.cfg -} + } - -FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { + FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/munch/RawFiles/BATTERY.PROVISION -} - + } -FILE FREEFORM = 2580262C-6CFD-4BF0-BDD9-2CE2BA612FB9 { + FILE FREEFORM = 2580262C-6CFD-4BF0-BDD9-2CE2BA612FB9 { SECTION UI = "GY.BATTERY.PROVISION" SECTION RAW = Binaries/munch/RawFiles/GY.BATTERY.PROVISION -} + } - -FILE FREEFORM = B538D218-A2A5-4073-A725-8D9AE349D041 { + FILE FREEFORM = B538D218-A2A5-4073-A725-8D9AE349D041 { SECTION UI = "NVT.BATTERY.PROVISION" SECTION RAW = Binaries/munch/RawFiles/NVT.BATTERY.PROVISION -} - + } -FILE FREEFORM = 984FBC3C-3860-4282-BAF5-87513350E29D { + FILE FREEFORM = 984FBC3C-3860-4282-BAF5-87513350E29D { SECTION UI = "BATTERY.PROVISION1" SECTION RAW = Binaries/munch/RawFiles/BATTERY.PROVISION1 -} + } - -FILE FREEFORM = 73315170-E849-4E57-BD96-F9107B85B1AE { + FILE FREEFORM = 73315170-E849-4E57-BD96-F9107B85B1AE { SECTION UI = "BATTERY.PROVISION2" SECTION RAW = Binaries/munch/RawFiles/BATTERY.PROVISION2 -} - + } diff --git a/Platforms/Xiaomi/munchPkg/PlatformBuild.py b/Platforms/Xiaomi/munchPkg/PlatformBuild.py index 501582950..47cdba1d2 100644 --- a/Platforms/Xiaomi/munchPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/munchPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Poco F3 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("munchPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("munchPkg/munch.dsc", {}) - def GetName(self): + def GetName (self): return "munch" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "munchPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "munch", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "munchPkg/munch.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "munch", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "munchPkg/munch.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/munchPkg/munch.dec b/Platforms/Xiaomi/munchPkg/munch.dec index 8a9ac5a45..e69de29bb 100644 --- a/Platforms/Xiaomi/munchPkg/munch.dec +++ b/Platforms/Xiaomi/munchPkg/munch.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = munch - PACKAGE_GUID = 3D80EFD3-B29B-4953-9AC9-993FE08997D - PACKAGE_VERSION = 0.1 - -[Guids] - galiothTokenSpaceGuid = { 0x3D80EFD3, 0xB29B, 0x4953, { 0x9A, 0xC9, 0x98, 0x93, 0xFE, 0x08, 0x99, 0x7D } } diff --git a/Platforms/Xiaomi/munchPkg/munch.dsc b/Platforms/Xiaomi/munchPkg/munch.dsc index 3673671c8..31328dbbd 100644 --- a/Platforms/Xiaomi/munchPkg/munch.dsc +++ b/Platforms/Xiaomi/munchPkg/munch.dsc @@ -27,13 +27,15 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8250 # 1 = SM8250-AB # 2 = SM8250-AC + # SOC_TYPE = 2 [BuildOptions] - *_*_*_CC_FLAGS = -DSOC_TYPE=$(SOC_TYPE) + *_*_*_CC_FLAGS = -DSOC_TYPE=$(SOC_TYPE) -DAB_SLOT_SUPPORT=$(AB_SLOT_SUPPORT) -DHAS_BUILD_IN_KEYBOARD=$(HAS_BUILD_IN_KEYBOARD) [LibraryClasses] DeviceMemoryMapLib|munchPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.inf @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Albert753258" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Albert753258" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,10 +71,10 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xA0000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller - gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE # This should be TRUE unless your UsbConfigDxe is Patched to be Dual Role. //TODO + gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE [PcdsDynamicDefault] gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|1080 diff --git a/Platforms/Xiaomi/nitrogenPkg/Include/APRIORI.inc b/Platforms/Xiaomi/nitrogenPkg/Include/APRIORI.inc index 7ec2c9eca..69c45b754 100644 --- a/Platforms/Xiaomi/nitrogenPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/nitrogenPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/nitrogen/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/nitrogenPkg/Include/DXE.inc b/Platforms/Xiaomi/nitrogenPkg/Include/DXE.inc index 00445542b..784f1a6fc 100644 --- a/Platforms/Xiaomi/nitrogenPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/nitrogenPkg/Include/DXE.inc @@ -28,7 +28,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/nitrogen/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/nitrogen/QcomPkg/Drivers/GLinkDxe/GLinkDxe.inf diff --git a/Platforms/Xiaomi/nitrogenPkg/Include/RAW.inc b/Platforms/Xiaomi/nitrogenPkg/Include/RAW.inc index 3773df37e..2aa4e5ecc 100644 --- a/Platforms/Xiaomi/nitrogenPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/nitrogenPkg/Include/RAW.inc @@ -31,4 +31,4 @@ FILE FREEFORM = CFB033FD-8FE4-47B9-A7B6-78E488B6E9C5 { SECTION UI = "BATTERY.PROVISION3" SECTION RAW = Binaries/nitrogen/RawFiles/BATTERY.PROVISION3 - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/nitrogenPkg/PlatformBuild.py b/Platforms/Xiaomi/nitrogenPkg/PlatformBuild.py index d7958250d..e1d85faae 100644 --- a/Platforms/Xiaomi/nitrogenPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/nitrogenPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Mi Max 3 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("nitrogenPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("nitrogenPkg/nitrogen.dsc", {}) - def GetName(self): + def GetName (self): return "nitrogen" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "nitrogenPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "nitrogen", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "nitrogenPkg/nitrogen.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "nitrogen", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "nitrogenPkg/nitrogen.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/nitrogenPkg/nitrogen.dec b/Platforms/Xiaomi/nitrogenPkg/nitrogen.dec index cd5e0a363..e69de29bb 100644 --- a/Platforms/Xiaomi/nitrogenPkg/nitrogen.dec +++ b/Platforms/Xiaomi/nitrogenPkg/nitrogen.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = nitrogen - PACKAGE_GUID = 15CA1E02-EFDF-4AA5-8A57-947641E3BE4F - PACKAGE_VERSION = 1.0 - -[Guids] - gnitrogenTokenSpaceGuid = { 0x15CA1E02, 0xEFDF, 0x4AA5, { 0x8A, 0x57, 0x94, 0x76, 0x41, 0xE3, 0xBE, 0x4F } } diff --git a/Platforms/Xiaomi/nitrogenPkg/nitrogen.dsc b/Platforms/Xiaomi/nitrogenPkg/nitrogen.dsc index 5b9fa6c8e..e6207c799 100644 --- a/Platforms/Xiaomi/nitrogenPkg/nitrogen.dsc +++ b/Platforms/Xiaomi/nitrogenPkg/nitrogen.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 0 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SDM660 # 1 = SDM636 # 2 = SDM630 + # SOC_TYPE = 1 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"AistopGit" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"AistopGit" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xA0000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/pipaPkg/Include/APRIORI.inc b/Platforms/Xiaomi/pipaPkg/Include/APRIORI.inc index 3703aaa67..4da1b9e2f 100644 --- a/Platforms/Xiaomi/pipaPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/pipaPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/pipa/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/pipaPkg/Include/DXE.inc b/Platforms/Xiaomi/pipaPkg/Include/DXE.inc index 91c5bbc44..378d6f11a 100644 --- a/Platforms/Xiaomi/pipaPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/pipaPkg/Include/DXE.inc @@ -30,7 +30,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/pipa/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/pipa/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/pipaPkg/Include/RAW.inc b/Platforms/Xiaomi/pipaPkg/Include/RAW.inc index c81bd40f5..1e016b174 100644 --- a/Platforms/Xiaomi/pipaPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/pipaPkg/Include/RAW.inc @@ -231,4 +231,4 @@ FILE FREEFORM = FC41D4C6-31F0-450D-A666-FE4738C20F8A { SECTION UI = "SUNWODA.M82.BATTERY.PROVISION" SECTION RAW = Binaries/pipa/RawFiles/SUNWODA.M82.BATTERY.PROVISION - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/pipaPkg/PlatformBuild.py b/Platforms/Xiaomi/pipaPkg/PlatformBuild.py index 0d5d27899..5f8c93cc9 100644 --- a/Platforms/Xiaomi/pipaPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/pipaPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Pad 6 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("pipaPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("pipaPkg/pipa.dsc", {}) - def GetName(self): + def GetName (self): return "pipa" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "pipaPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "pipa", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "pipaPkg/pipa.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "pipa", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "pipaPkg/pipa.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/pipaPkg/pipa.dec b/Platforms/Xiaomi/pipaPkg/pipa.dec index 1466c919c..e69de29bb 100644 --- a/Platforms/Xiaomi/pipaPkg/pipa.dec +++ b/Platforms/Xiaomi/pipaPkg/pipa.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = pipa - PACKAGE_GUID = 0965E99C-81B3-4F49-9ABF-A7A39F591528 - PACKAGE_VERSION = 0.1 - -[Guids] - gpipaTokenSpaceGuid = { 0x0965E99C, 0x81B3, 0x4F49, { 0x9A, 0xBF, 0xA7, 0xA3, 0x9F, 0x59, 0x15, 0x28 } } diff --git a/Platforms/Xiaomi/pipaPkg/pipa.dsc b/Platforms/Xiaomi/pipaPkg/pipa.dsc index 4db1186b0..fbf6e323b 100644 --- a/Platforms/Xiaomi/pipaPkg/pipa.dsc +++ b/Platforms/Xiaomi/pipaPkg/pipa.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8250 # 1 = SM8250-AB # 2 = SM8250-AC + # SOC_TYPE = 2 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"6adp" # Device Maintainer + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"6adp" # Device Maintainer # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xB4500000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|FALSE diff --git a/Platforms/Xiaomi/spesPkg/Include/APRIORI.inc b/Platforms/Xiaomi/spesPkg/Include/APRIORI.inc index 7dbc47af5..8002a5685 100644 --- a/Platforms/Xiaomi/spesPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/spesPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/spes/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/spesPkg/Include/DXE.inc b/Platforms/Xiaomi/spesPkg/Include/DXE.inc index 37ca1dcb1..328f28d9c 100644 --- a/Platforms/Xiaomi/spesPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/spesPkg/Include/DXE.inc @@ -31,7 +31,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/spes/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/spes/QcomPkg/Drivers/GLinkDxe/GLinkDxe.inf diff --git a/Platforms/Xiaomi/spesPkg/Include/RAW.inc b/Platforms/Xiaomi/spesPkg/Include/RAW.inc index f0db0e2ce..9edcb042c 100644 --- a/Platforms/Xiaomi/spesPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/spesPkg/Include/RAW.inc @@ -51,4 +51,4 @@ FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/spes/RawFiles/BATTERY.PROVISION - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/spesPkg/PlatformBuild.py b/Platforms/Xiaomi/spesPkg/PlatformBuild.py index 9b8faadd8..82b346a06 100644 --- a/Platforms/Xiaomi/spesPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/spesPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Redmi Note 11 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("spesPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("spesPkg/spes.dsc", {}) - def GetName(self): + def GetName (self): return "spes" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "spesPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "spes", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "spesPkg/spes.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "spes", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "spesPkg/spes.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/spesPkg/spes.dec b/Platforms/Xiaomi/spesPkg/spes.dec index 12fd7b253..e69de29bb 100644 --- a/Platforms/Xiaomi/spesPkg/spes.dec +++ b/Platforms/Xiaomi/spesPkg/spes.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = spes - PACKAGE_GUID = A43A1082-0066-4CC0-BC78-E3A59A3E5832 - PACKAGE_VERSION = 1.0 - -[Guids] - gspesTokenSpaceGuid = { 0xA43A1082, 0x0066, 0x4CC0, { 0xBC, 0x78, 0xE3, 0xA5, 0x9A, 0x3E, 0x58, 0x32 } } diff --git a/Platforms/Xiaomi/spesPkg/spes.dsc b/Platforms/Xiaomi/spesPkg/spes.dsc index 7ef3de0f8..ac315ed3a 100644 --- a/Platforms/Xiaomi/spesPkg/spes.dsc +++ b/Platforms/Xiaomi/spesPkg/spes.dsc @@ -27,8 +27,10 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM6225 # 1 = SM6225-AD + # SOC_TYPE = 0 [BuildOptions] @@ -43,7 +45,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Statzar" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Statzar" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x5FF8C000 @@ -68,7 +70,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0x60000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/suryaPkg/Include/APRIORI.inc b/Platforms/Xiaomi/suryaPkg/Include/APRIORI.inc index 3f23f0e9c..a201d7acd 100644 --- a/Platforms/Xiaomi/suryaPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/suryaPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/surya/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/suryaPkg/Include/DXE.inc b/Platforms/Xiaomi/suryaPkg/Include/DXE.inc index 75b55f701..5e7b39fae 100644 --- a/Platforms/Xiaomi/suryaPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/suryaPkg/Include/DXE.inc @@ -30,7 +30,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/surya/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/surya/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/suryaPkg/Include/RAW.inc b/Platforms/Xiaomi/suryaPkg/Include/RAW.inc index d1c079eaf..ed60086ec 100644 --- a/Platforms/Xiaomi/suryaPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/suryaPkg/Include/RAW.inc @@ -3,62 +3,52 @@ SECTION RAW = Binaries/surya/RawFiles/BDS_Menu.cfg } - FILE FREEFORM = 92FA25C1-5EDD-4328-8924-A66F25F82500 { SECTION UI = "Panel_boe_amoled_fhd_plus_dsc_cmd.xml" SECTION RAW = Binaries/surya/RawFiles/Panel_boe_amoled_fhd_plus_dsc_cmd.xml } - FILE FREEFORM = 6343A5E1-E477-452A-B62C-1560C4CBD9F5 { SECTION UI = "Panel_secondary_truly_1080p_cmd.xml" SECTION RAW = Binaries/surya/RawFiles/Panel_secondary_truly_1080p_cmd.xml } - FILE FREEFORM = 151C5D22-957F-4861-A605-E27154BBDA25 { SECTION UI = "Panel_secondary_truly_1080p_vid.xml" SECTION RAW = Binaries/surya/RawFiles/Panel_secondary_truly_1080p_vid.xml } - FILE FREEFORM = 0155F46D-AE6B-45F3-9273-ED5234366857 { SECTION UI = "Panel_sharp_wqhd_dualdsi_cmd.xml" SECTION RAW = Binaries/surya/RawFiles/Panel_sharp_wqhd_dualdsi_cmd.xml } - FILE FREEFORM = 6AA4C932-31FA-4136-9F8F-0954BB55C2F3 { SECTION UI = "Panel_sharp_wqhd_dualdsi_vid.xml" SECTION RAW = Binaries/surya/RawFiles/Panel_sharp_wqhd_dualdsi_vid.xml } - FILE FREEFORM = CF65ABBD-9041-464B-84F4-2ACD1AC44A0D { SECTION UI = "Panel_sharp_qsync_fhd_vid.xml" SECTION RAW = Binaries/surya/RawFiles/Panel_sharp_qsync_fhd_vid.xml } - FILE FREEFORM = F898317F-88CE-4839-89ED-B80E94E4CBBC { SECTION UI = "Panel_sharp_qsync_fhd_cmd.xml" SECTION RAW = Binaries/surya/RawFiles/Panel_sharp_qsync_fhd_cmd.xml } - FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { SECTION UI = "SecParti.cfg" SECTION RAW = Binaries/surya/RawFiles/SecParti.cfg } - FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { SECTION UI = "uefipil.cfg" SECTION RAW = Binaries/surya/RawFiles/uefipil.cfg } - FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { SECTION UI = "QcomChargerCfg.cfg" SECTION RAW = Binaries/surya/RawFiles/QcomChargerCfg.cfg - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/suryaPkg/PlatformBuild.py b/Platforms/Xiaomi/suryaPkg/PlatformBuild.py index 1e87d5b59..2848ed1e4 100644 --- a/Platforms/Xiaomi/suryaPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/suryaPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Redmi Note 12 4G UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("suryaPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("suryaPkg/surya.dsc", {}) - def GetName(self): + def GetName (self): return "surya" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "suryaPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "surya", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "suryaPkg/surya.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "surya", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "suryaPkg/surya.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/suryaPkg/surya.dec b/Platforms/Xiaomi/suryaPkg/surya.dec index 0eda35e45..e69de29bb 100644 --- a/Platforms/Xiaomi/suryaPkg/surya.dec +++ b/Platforms/Xiaomi/suryaPkg/surya.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = surya - PACKAGE_GUID = D5A334DF-5B96-485A-BBE0-308EFA44E1C6 - PACKAGE_VERSION = 1.0 - -[Guids] - gsuryaTokenSpaceGuid = { 0xD5A334DF, 0x5B96, 0x485A, { 0xBB, 0xE0, 0x30, 0x8E, 0xFA, 0x44, 0xE1, 0xC6 } } diff --git a/Platforms/Xiaomi/suryaPkg/surya.dsc b/Platforms/Xiaomi/suryaPkg/surya.dsc index 3c6ce621a..7693de98a 100644 --- a/Platforms/Xiaomi/suryaPkg/surya.dsc +++ b/Platforms/Xiaomi/suryaPkg/surya.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 0 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM7150 # 1 = SM7150-AB # 2 = SM7150-AC + # SOC_TYPE = 2 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"remtrik" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"remtrik" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xA2370000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/sweetPkg/Include/APRIORI.inc b/Platforms/Xiaomi/sweetPkg/Include/APRIORI.inc index a9fbd95e6..5e1cf15a2 100644 --- a/Platforms/Xiaomi/sweetPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/sweetPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/sweet/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/sweetPkg/Include/DXE.inc b/Platforms/Xiaomi/sweetPkg/Include/DXE.inc index 6df03ee4a..582d42e0e 100644 --- a/Platforms/Xiaomi/sweetPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/sweetPkg/Include/DXE.inc @@ -30,7 +30,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/sweet/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/sweet/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/sweetPkg/Include/RAW.inc b/Platforms/Xiaomi/sweetPkg/Include/RAW.inc index 25f0685b1..440932b1c 100644 --- a/Platforms/Xiaomi/sweetPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/sweetPkg/Include/RAW.inc @@ -3,152 +3,127 @@ SECTION RAW = Binaries/sweet/RawFiles/BDS_Menu.cfg } - FILE FREEFORM = 88CA5ABF-D0AC-4093-A68C-0CFAE1EF9635 { SECTION UI = "Panel_boe_amoled_wqhd_dsc_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd.xml } - FILE FREEFORM = 3D930A62-5744-492B-B192-EA2EE59C125C { SECTION UI = "Panel_ss_ea_f10_fhd_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_ss_ea_f10_fhd_cmd.xml } - FILE FREEFORM = 38A1D1FF-C445-4658-BB43-0488B30CFFFB { SECTION UI = "Panel_ss_eb_f10_fhd_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_ss_eb_f10_fhd_cmd.xml } - FILE FREEFORM = ED2E57C9-20CE-4130-8EA5-7FB92855B519 { SECTION UI = "Panel_xiaomi_f4_41_06_0a_fhd_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_xiaomi_f4_41_06_0a_fhd_cmd.xml } - FILE FREEFORM = 678BF8FA-97FB-4F1A-9DA1-CAD9EBB87CC5 { SECTION UI = "Panel_xiaomi_f4_36_02_0b_fhd_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_xiaomi_f4_36_02_0b_fhd_cmd.xml } - FILE FREEFORM = 18B067CE-338D-460D-A7C0-C8D2CFB6068C { SECTION UI = "Panel_xiaomi_f4_42_06_0c_fhd_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_xiaomi_f4_42_06_0c_fhd_cmd.xml } - FILE FREEFORM = 299CB997-C9C6-4645-B6F0-7B476C06698C { SECTION UI = "Panel_k6_38_0c_0a_fhd_dsc_vid.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_k6_38_0c_0a_fhd_dsc_vid.xml } - FILE FREEFORM = 76E38CA3-9625-4F36-A7FB-C63D7A00BF2A { SECTION UI = "Panel_k6_38_0e_0b_fhd_dsc_vid.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_k6_38_0e_0b_fhd_dsc_vid.xml } - FILE FREEFORM = 15F937C5-96B0-4A3A-C23E-9853E1C5226D { SECTION UI = "Panel_K9A_36_02_0a_amoled_dsc_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_K9A_36_02_0a_amoled_dsc_cmd.xml } - FILE FREEFORM = 17A3739E-1D01-11EB-AD0C-DFBF6717A8A5 { SECTION UI = "Panel_K9A_36_02_0a_p1_amoled_dsc_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_K9A_36_02_0a_p1_amoled_dsc_cmd.xml } - FILE FREEFORM = AB95C40E-A14E-41F1-90B9-2CBF3FF735A7 { SECTION UI = "Panel_K9A_36_02_0a_p2_amoled_dsc_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_K9A_36_02_0a_p2_amoled_dsc_cmd.xml } - FILE FREEFORM = 28035A03-0D4A-40B4-971E-F2527832B997 { SECTION UI = "Panel_K9A_36_02_0a_mp_amoled_dsc_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_K9A_36_02_0a_mp_amoled_dsc_cmd.xml } - FILE FREEFORM = 62146B52-0581-4CF9-8177-2F353257807F { SECTION UI = "Panel_K9A_42_02_0b_mp_amoled_dsc_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_K9A_42_02_0b_mp_amoled_dsc_cmd.xml } - FILE FREEFORM = 45A8FDA2-4FAD-4234-BCDA-D1778611CE13 { SECTION UI = "Panel_boe_amoled_wqhd_dsc_vid.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_boe_amoled_wqhd_dsc_vid.xml } - FILE FREEFORM = 97CEB64B-29D5-42DF-9755-036D253C4B63 { SECTION UI = "Panel_G7B_37_02_0a_lcd_dsc_vid.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_G7B_37_02_0a_lcd_dsc_vid.xml } - FILE FREEFORM = 32E62D13-ADEA-41A0-896E-86F6FC5E9926 { SECTION UI = "Panel_G7B_42_02_0b_lcd_dsc_vid.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_G7B_42_02_0b_lcd_dsc_vid.xml } - FILE FREEFORM = 32E62D13-ADEA-41A0-896E-86F6FC5E9815 { SECTION UI = "Panel_G7B_37_02_0b_lcd_dsc_vid.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_G7B_37_02_0b_lcd_dsc_vid.xml } - FILE FREEFORM = 92FA25C1-5EDD-4328-8924-A66F25F82500 { SECTION UI = "Panel_boe_amoled_fhd_plus_dsc_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_boe_amoled_fhd_plus_dsc_cmd.xml } - FILE FREEFORM = 0155F46D-AE6B-45F3-9273-ED5234366857 { SECTION UI = "Panel_sharp_wqhd_dualdsi_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_sharp_wqhd_dualdsi_cmd.xml } - FILE FREEFORM = 6AA4C932-31FA-4136-9F8F-0954BB55C2F3 { SECTION UI = "Panel_sharp_wqhd_dualdsi_vid.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_sharp_wqhd_dualdsi_vid.xml } - FILE FREEFORM = CF65ABBD-9041-464B-84F4-2ACD1AC44A0D { SECTION UI = "Panel_sharp_qsync_fhd_vid.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_sharp_qsync_fhd_vid.xml } - FILE FREEFORM = F898317F-88CE-4839-89ED-B80E94E4CBBC { SECTION UI = "Panel_sharp_qsync_fhd_cmd.xml" SECTION RAW = Binaries/sweet/RawFiles/Panel_sharp_qsync_fhd_cmd.xml } - FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { SECTION UI = "SecParti.cfg" SECTION RAW = Binaries/sweet/RawFiles/SecParti.cfg } - FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { SECTION UI = "uefipil.cfg" SECTION RAW = Binaries/sweet/RawFiles/uefipil.cfg } - FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { SECTION UI = "QcomChargerCfg.cfg" SECTION RAW = Binaries/sweet/RawFiles/QcomChargerCfg.cfg - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/sweetPkg/PlatformBuild.py b/Platforms/Xiaomi/sweetPkg/PlatformBuild.py index 7b58df0c4..99b47afea 100644 --- a/Platforms/Xiaomi/sweetPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/sweetPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Redmi Note 12 4G UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("sweetPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("sweetPkg/sweet.dsc", {}) - def GetName(self): + def GetName (self): return "sweet" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "sweetPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "sweet", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "sweetPkg/sweet.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "sweet", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "sweetPkg/sweet.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/sweetPkg/sweet.dec b/Platforms/Xiaomi/sweetPkg/sweet.dec index 1f7ecc178..e69de29bb 100644 --- a/Platforms/Xiaomi/sweetPkg/sweet.dec +++ b/Platforms/Xiaomi/sweetPkg/sweet.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = sweet - PACKAGE_GUID = FB8B7932-7626-4D3B-AD8E-370652E0D2C0 - PACKAGE_VERSION = 1.0 - -[Guids] - gsweetTokenSpaceGuid = { 0xFB8B7932, 0x7626, 0x4D3B, { 0xAD, 0x8E, 0x37, 0x06, 0x52, 0xE0, 0xD2, 0xC0 } } diff --git a/Platforms/Xiaomi/sweetPkg/sweet.dsc b/Platforms/Xiaomi/sweetPkg/sweet.dsc index 96aeb56d2..a03ec3bc2 100644 --- a/Platforms/Xiaomi/sweetPkg/sweet.dsc +++ b/Platforms/Xiaomi/sweetPkg/sweet.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 0 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM7150 # 1 = SM7150-AB # 2 = SM7150-AC + # SOC_TYPE = 2 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"remtrik, hiprivsid" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"remtrik, hiprivsid" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xA2370000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|FALSE diff --git a/Platforms/Xiaomi/sweet_k6aPkg/Include/APRIORI.inc b/Platforms/Xiaomi/sweet_k6aPkg/Include/APRIORI.inc index 0a8aab7b0..e854a8a9a 100644 --- a/Platforms/Xiaomi/sweet_k6aPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/sweet_k6aPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/sweet_k6a/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/sweet_k6aPkg/Include/DXE.inc b/Platforms/Xiaomi/sweet_k6aPkg/Include/DXE.inc index 8fe850734..561dd6584 100644 --- a/Platforms/Xiaomi/sweet_k6aPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/sweet_k6aPkg/Include/DXE.inc @@ -30,7 +30,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/sweet_k6a/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/sweet_k6a/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/sweet_k6aPkg/Include/RAW.inc b/Platforms/Xiaomi/sweet_k6aPkg/Include/RAW.inc index 7631b058f..57e55ead5 100644 --- a/Platforms/Xiaomi/sweet_k6aPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/sweet_k6aPkg/Include/RAW.inc @@ -111,4 +111,4 @@ FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { SECTION UI = "QcomChargerCfg.cfg" SECTION RAW = Binaries/sweet_k6a/RawFiles/QcomChargerCfg.cfg - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/sweet_k6aPkg/PlatformBuild.py b/Platforms/Xiaomi/sweet_k6aPkg/PlatformBuild.py index fb53b39d1..42dca1723 100644 --- a/Platforms/Xiaomi/sweet_k6aPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/sweet_k6aPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Redmi Note 12 4G UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("sweet_k6aPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("sweet_k6aPkg/sweet_k6a.dsc", {}) - def GetName(self): + def GetName (self): return "sweet_k6a" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "sweet_k6aPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "sweet_k6a", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "sweet_k6aPkg/sweet_k6a.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "sweet_k6a", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "sweet_k6aPkg/sweet_k6a.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/sweet_k6aPkg/sweet_k6a.dec b/Platforms/Xiaomi/sweet_k6aPkg/sweet_k6a.dec index 0ce9db42b..e69de29bb 100644 --- a/Platforms/Xiaomi/sweet_k6aPkg/sweet_k6a.dec +++ b/Platforms/Xiaomi/sweet_k6aPkg/sweet_k6a.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = sweet_k6a - PACKAGE_GUID = 13D651DF-5D7E-4516-AB02-371A565AB594 - PACKAGE_VERSION = 1.0 - -[Guids] - gsweet_k6aTokenSpaceGuid = { 0x13D651DF, 0x5D7E, 0x4516, { 0xAB, 0x02, 0x37, 0x1A, 0x56, 0x5A, 0xB5, 0x94 } } diff --git a/Platforms/Xiaomi/sweet_k6aPkg/sweet_k6a.dsc b/Platforms/Xiaomi/sweet_k6aPkg/sweet_k6a.dsc index 9e62596cc..e5d224a4a 100644 --- a/Platforms/Xiaomi/sweet_k6aPkg/sweet_k6a.dsc +++ b/Platforms/Xiaomi/sweet_k6aPkg/sweet_k6a.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 0 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM7150 # 1 = SM7150-AB # 2 = SM7150-AC + # SOC_TYPE = 2 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"No Maintainer" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"No Maintainer" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -69,7 +71,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xA2370000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/tapasPkg/Include/APRIORI.inc b/Platforms/Xiaomi/tapasPkg/Include/APRIORI.inc index 56d18ecb5..96b357f43 100644 --- a/Platforms/Xiaomi/tapasPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/tapasPkg/Include/APRIORI.inc @@ -17,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/tapas/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/tapasPkg/Include/DXE.inc b/Platforms/Xiaomi/tapasPkg/Include/DXE.inc index 55cf14da9..cef0922f6 100644 --- a/Platforms/Xiaomi/tapasPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/tapasPkg/Include/DXE.inc @@ -31,7 +31,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/tapas/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/tapas/QcomPkg/Drivers/GLinkDxe/GLinkDxe.inf diff --git a/Platforms/Xiaomi/tapasPkg/Include/RAW.inc b/Platforms/Xiaomi/tapasPkg/Include/RAW.inc index 0163d0cb0..78b3d0370 100644 --- a/Platforms/Xiaomi/tapasPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/tapasPkg/Include/RAW.inc @@ -1,125 +1,59 @@ -FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { + FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E { SECTION UI = "BDS_Menu.cfg" SECTION RAW = Binaries/tapas/RawFiles/BDS_Menu.cfg -} + } - -FILE FREEFORM = 02E0AF91-5D44-424F-828F-211ADC520B0C { + FILE FREEFORM = 02E0AF91-5D44-424F-828F-211ADC520B0C { SECTION UI = "Panel_truly_td4330_fhd_cmd.xml" SECTION RAW = Binaries/tapas/RawFiles/Panel_truly_td4330_fhd_cmd.xml -} - + } -FILE FREEFORM = A6A0544E-98E2-4E23-8C68-71B29359DEC1 { + FILE FREEFORM = A6A0544E-98E2-4E23-8C68-71B29359DEC1 { SECTION UI = "Panel_samsung_8fc3_fhdp_video.xml" SECTION RAW = Binaries/tapas/RawFiles/Panel_samsung_8fc3_fhdp_video.xml -} + } - -FILE FREEFORM = 5D481285-4B38-4DAB-AC07-1647EAC02B80 { + FILE FREEFORM = 5D481285-4B38-4DAB-AC07-1647EAC02B80 { SECTION UI = "Panel_samsung_db7f_fhdp_video.xml" SECTION RAW = Binaries/tapas/RawFiles/Panel_samsung_db7f_fhdp_video.xml -} - + } -FILE FREEFORM = 9BAE75D9-A217-4B31-9DCD-00D2609BC6AE { + FILE FREEFORM = 9BAE75D9-A217-4B31-9DCD-00D2609BC6AE { SECTION UI = "Panel_truly_td4330_fhd_vid.xml" SECTION RAW = Binaries/tapas/RawFiles/Panel_truly_td4330_fhd_vid.xml -} + } - -FILE FREEFORM = 9BAE75D9-A217-4B31-9DCD-00D2609B6784 { + FILE FREEFORM = 9BAE75D9-A217-4B31-9DCD-00D2609B6784 { SECTION UI = "Panel_truly_nt36525_hd_plus_vid.xml" SECTION RAW = Binaries/tapas/RawFiles/Panel_truly_nt36525_hd_plus_vid.xml -} - + } -FILE FREEFORM = 9BAE75D9-A217-4B31-9DCD-00D2609B6785 { + FILE FREEFORM = 9BAE75D9-A217-4B31-9DCD-00D2609B6785 { SECTION UI = "Panel_nt36672e_fhd_plus_90hz_vid.xml" SECTION RAW = Binaries/tapas/RawFiles/Panel_nt36672e_fhd_plus_90hz_vid.xml -} + } - -FILE FREEFORM = 9BAE75D9-A217-4B31-9DCD-00D2609BC6BC { + FILE FREEFORM = 9BAE75D9-A217-4B31-9DCD-00D2609BC6BC { SECTION UI = "Panel_nt36672e_fhd_plus_120hz_vid.xml" SECTION RAW = Binaries/tapas/RawFiles/Panel_nt36672e_fhd_plus_120hz_vid.xml -} - - -FILE FREEFORM = 3E5584ED-05D4-4267-9048-0D47F76F4248 { - SECTION UI = "battery_symbol_Soc10.bmp" - SECTION RAW = Binaries/tapas/RawFiles/battery_symbol_Soc10.bmp -} - - -FILE FREEFORM = 4753E815-DDD8-402D-BF69-9B8C4EB7573E { - SECTION UI = "battery_symbol_NoBattery.bmp" - SECTION RAW = Binaries/tapas/RawFiles/battery_symbol_NoBattery.bmp -} - - -FILE FREEFORM = 03DED53E-BECD-428F-9F79-5ABA64C58445 { - SECTION UI = "battery_symbol_Nocharger.bmp" - SECTION RAW = Binaries/tapas/RawFiles/battery_symbol_Nocharger.bmp -} - - -FILE FREEFORM = 8B86CD38-C772-4FCF-85AA-345B2B3C1AB4 { - SECTION UI = "battery_symbol_LowBatteryCharging.bmp" - SECTION RAW = Binaries/tapas/RawFiles/battery_symbol_LowBatteryCharging.bmp -} + } - -FILE FREEFORM = 3FD97907-93F1-4349-AF3C-3B68B0A5E626 { - SECTION UI = "battery_symbol_LowBattery.bmp" - SECTION RAW = Binaries/tapas/RawFiles/battery_symbol_LowBattery.bmp -} - - -FILE FREEFORM = B0F8D1BE-5353-4812-B1F6-07E7768204CC { - SECTION UI = "battery_symbol_DebugBoot.bmp" - SECTION RAW = Binaries/tapas/RawFiles/battery_symbol_DebugBoot.bmp -} - - -FILE FREEFORM = F9E8F683-E065-4E09-B4F9-0230D7CECD08 { - SECTION UI = "battery_symbol_DebugStay.bmp" - SECTION RAW = Binaries/tapas/RawFiles/battery_symbol_DebugStay.bmp -} - - -FILE FREEFORM = E2EA5A4F-98BD-4203-AB49-399505DDFB7D { - SECTION UI = "tsens_thermal_symbol.bmp" - SECTION RAW = Binaries/tapas/RawFiles/tsens_thermal_symbol.bmp -} - - -FILE FREEFORM = C72FB1A9-5527-4E13-BAC4-F671D0330145 { - SECTION UI = "tsens_thermal_err_symbol.bmp" - SECTION RAW = Binaries/tapas/RawFiles/tsens_thermal_err_symbol.bmp -} - - -FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { + FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { SECTION UI = "SecParti.cfg" SECTION RAW = Binaries/tapas/RawFiles/SecParti.cfg -} - + } -FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { + FILE FREEFORM = 21E9BDD9-6C3F-4F10-84A5-BBEC322741F1 { SECTION UI = "uefipil.cfg" SECTION RAW = Binaries/tapas/RawFiles/uefipil.cfg -} + } - -FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { + FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F { SECTION UI = "QcomChargerCfg.cfg" SECTION RAW = Binaries/tapas/RawFiles/QcomChargerCfg.cfg -} - + } -FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { + FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/tapas/RawFiles/BATTERY.PROVISION -} - + } diff --git a/Platforms/Xiaomi/tapasPkg/PlatformBuild.py b/Platforms/Xiaomi/tapasPkg/PlatformBuild.py index 1e5e2b66b..396a388a6 100644 --- a/Platforms/Xiaomi/tapasPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/tapasPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Redmi 12 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("tapasPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("tapasPkg/tapas.dsc", {}) - def GetName(self): + def GetName (self): return "tapas" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "tapasPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "tapas", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "tapasPkg/tapas.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "tapas", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "tapasPkg/tapas.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/tapasPkg/tapas.dec b/Platforms/Xiaomi/tapasPkg/tapas.dec index 12d2a1a8c..e69de29bb 100644 --- a/Platforms/Xiaomi/tapasPkg/tapas.dec +++ b/Platforms/Xiaomi/tapasPkg/tapas.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x0001001A - PACKAGE_NAME = tapas - PACKAGE_GUID = B365F6C4-95F6-4B2A-8014-2407FCEC1EBF - PACKAGE_VERSION = 1.0 - -[Guids] - gtapasTokenSpaceGuid = { 0xB365F6C4, 0x95F6, 0x4B2A, { 0x80, 0x14, 0x24, 0x07, 0xFC, 0xEC, 0x1E, 0xBF } } diff --git a/Platforms/Xiaomi/tapasPkg/tapas.dsc b/Platforms/Xiaomi/tapasPkg/tapas.dsc index 034ae0407..0ac701b29 100644 --- a/Platforms/Xiaomi/tapasPkg/tapas.dsc +++ b/Platforms/Xiaomi/tapasPkg/tapas.dsc @@ -27,8 +27,10 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM6225 # 1 = SM6225-AD + # SOC_TYPE = 1 [BuildOptions] @@ -43,7 +45,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x45700000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"6adp" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"6adp" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x5FF8C000 @@ -68,7 +70,7 @@ gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0x60000000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|TRUE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|TRUE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/venusPkg/Include/ACPI.inc b/Platforms/Xiaomi/venusPkg/Include/ACPI.inc index b2aecba62..7bda0b47b 100644 --- a/Platforms/Xiaomi/venusPkg/Include/ACPI.inc +++ b/Platforms/Xiaomi/venusPkg/Include/ACPI.inc @@ -17,4 +17,4 @@ FILE FREEFORM = 7E374E25-8E01-4FEE-87F2-390C23C606CD { # SECTION RAW = SM8350Pkg/AcpiTables/TPM2.aml # SECTION RAW = SM8350Pkg/AcpiTables/XSDT.aml SECTION UI = "AcpiTables" -} \ No newline at end of file +} diff --git a/Platforms/Xiaomi/venusPkg/Include/APRIORI.inc b/Platforms/Xiaomi/venusPkg/Include/APRIORI.inc index 5400ab708..8595d2da4 100644 --- a/Platforms/Xiaomi/venusPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/venusPkg/Include/APRIORI.inc @@ -4,6 +4,8 @@ APRIORI DXE { INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + INF Binaries/venus/QcomPkg/Drivers/EnvDxe/EnvDxe.inf + #INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf #INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf @@ -15,7 +17,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/venus/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/venusPkg/Include/DXE.inc b/Platforms/Xiaomi/venusPkg/Include/DXE.inc index 5104f4e4c..1f03603ef 100644 --- a/Platforms/Xiaomi/venusPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/venusPkg/Include/DXE.inc @@ -1,5 +1,8 @@ INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + + INF Binaries/venus/QcomPkg/Drivers/EnvDxe/EnvDxe.inf + INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf @@ -24,7 +27,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/venus/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/venus/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf diff --git a/Platforms/Xiaomi/venusPkg/Include/RAW.inc b/Platforms/Xiaomi/venusPkg/Include/RAW.inc index 35708860f..77feaccd7 100644 --- a/Platforms/Xiaomi/venusPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/venusPkg/Include/RAW.inc @@ -231,4 +231,4 @@ FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 { SECTION UI = "SecParti.cfg" SECTION RAW = Binaries/venus/RawFiles/SecParti.cfg - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/venusPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c b/Platforms/Xiaomi/venusPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c index 661fcba30..0b65f7161 100644 --- a/Platforms/Xiaomi/venusPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c +++ b/Platforms/Xiaomi/venusPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c @@ -13,11 +13,11 @@ gDeviceMemoryDescriptorEx[] = { {"XBL Log Buffer", 0x80884000, 0x00010000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN}, {"SMEM", 0x80900000, 0x00200000, AddMem, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED_XN}, {"PIL Reserved", 0x85200000, 0x16600000, AddMem, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED_XN}, - {"DXE Heap", 0xB0000000, 0x04500000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, {"Sched Heap", 0x9F400000, 0x00400000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, {"FV Region", 0x9F800000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, {"ABOOT FV", 0x9FA00000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN}, - {"UEFI FD", 0x9FC00000, 0x00300000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, + {"FD Reserved", 0x9FC00000, 0x00100000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, + {"UEFI FD", 0x9FD00000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, {"SEC Heap", 0x9FF00000, 0x0008C000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, {"CPU Vectors", 0x9FF8C000, 0x00001000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, {"MMU PageTables", 0x9FF8D000, 0x00003000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, @@ -25,6 +25,7 @@ gDeviceMemoryDescriptorEx[] = { {"Log Buffer", 0x9FFF7000, 0x00008000, AddMem, SYS_MEM, SYS_MEM_CAP, RtData, WRITE_BACK_XN}, {"Info Blk", 0x9FFFF000, 0x00001000, AddMem, SYS_MEM, SYS_MEM_CAP, RtData, WRITE_BACK_XN}, {"Kernel", 0xA0000000, 0x10000000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN}, + {"DXE Heap", 0xB0000000, 0x04500000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, {"Guest VM", 0xD0000000, 0x08800000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN}, {"TZApps Reserved", 0xDA000000, 0x06A00000, HobOnlyNoCacheSetting, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED_XN}, {"DBI Dump", 0xE1A00000, 0x00F00000, NoHob, MMAP_IO, INITIALIZED, Conv, UNCACHED_UNBUFFERED_XN}, diff --git a/Platforms/Xiaomi/venusPkg/PlatformBuild.py b/Platforms/Xiaomi/venusPkg/PlatformBuild.py index fbea0b020..ba55e52c4 100644 --- a/Platforms/Xiaomi/venusPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/venusPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi Mi 11 UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("venusPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("venusPkg/venus.dsc", {}) - def GetName(self): + def GetName (self): return "venus" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "venusPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "venus", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "venusPkg/venus.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "venus", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "venusPkg/venus.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/venusPkg/venus.dec b/Platforms/Xiaomi/venusPkg/venus.dec index b4055c26c..e69de29bb 100644 --- a/Platforms/Xiaomi/venusPkg/venus.dec +++ b/Platforms/Xiaomi/venusPkg/venus.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = venus - PACKAGE_GUID = 03624C85-9D74-4E7E-85FF-A6B77DC2EEFA - PACKAGE_VERSION = 0.1 - -[Guids] - gvenusTokenSpaceGuid = { 0x03624C85, 0x9D74, 0x4E7E, { 0x85, 0xFF, 0xA6, 0xB7, 0x7D, 0xC2, 0xEE, 0xFA } } diff --git a/Platforms/Xiaomi/venusPkg/venus.dsc b/Platforms/Xiaomi/venusPkg/venus.dsc index e2b9fed0b..9113a8550 100644 --- a/Platforms/Xiaomi/venusPkg/venus.dsc +++ b/Platforms/Xiaomi/venusPkg/venus.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8350 # 1 = SM8350-AB # 2 = SM8350-AC + # SOC_TYPE = 0 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Daniel6745" # Device Maintainer + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Daniel6745" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -65,11 +67,14 @@ gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferHeight|3200 gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferColorDepth|32 + # XBL Protocol + gQcomPkgTokenSpaceGuid.PcdScheduleInterfaceAddr|0x9FC37980 + # Dynamic RAM Start Address gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xE4E00000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Platforms/Xiaomi/viliPkg/Include/APRIORI.inc b/Platforms/Xiaomi/viliPkg/Include/APRIORI.inc index 2c557c6ff..34e772f92 100644 --- a/Platforms/Xiaomi/viliPkg/Include/APRIORI.inc +++ b/Platforms/Xiaomi/viliPkg/Include/APRIORI.inc @@ -15,7 +15,6 @@ APRIORI DXE { # Core Drivers INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/vili/QcomPkg/Drivers/SmemDxe/SmemDxe.inf diff --git a/Platforms/Xiaomi/viliPkg/Include/DXE.inc b/Platforms/Xiaomi/viliPkg/Include/DXE.inc index 121167567..c7a74600a 100644 --- a/Platforms/Xiaomi/viliPkg/Include/DXE.inc +++ b/Platforms/Xiaomi/viliPkg/Include/DXE.inc @@ -24,7 +24,6 @@ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf - INF ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf INF Binaries/vili/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf INF Binaries/vili/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf diff --git a/Platforms/Xiaomi/viliPkg/Include/RAW.inc b/Platforms/Xiaomi/viliPkg/Include/RAW.inc index c39a37926..8ad1d9cd9 100644 --- a/Platforms/Xiaomi/viliPkg/Include/RAW.inc +++ b/Platforms/Xiaomi/viliPkg/Include/RAW.inc @@ -231,4 +231,4 @@ FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 { SECTION UI = "BATTERY.PROVISION" SECTION RAW = Binaries/vili/RawFiles/BATTERY.PROVISION - } \ No newline at end of file + } diff --git a/Platforms/Xiaomi/viliPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c b/Platforms/Xiaomi/viliPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c index a1be25cee..45e065f0a 100644 --- a/Platforms/Xiaomi/viliPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c +++ b/Platforms/Xiaomi/viliPkg/Library/DeviceMemoryMapLib/DeviceMemoryMapLib.c @@ -13,11 +13,11 @@ gDeviceMemoryDescriptorEx[] = { {"XBL Log Buffer", 0x80884000, 0x00010000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN}, {"SMEM", 0x80900000, 0x00200000, AddMem, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED_XN}, {"PIL Reserved", 0x85200000, 0x16600000, AddMem, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED_XN}, - {"DXE Heap", 0xB0000000, 0x04500000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, {"Sched Heap", 0x9F400000, 0x00400000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, {"FV Region", 0x9F800000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, {"ABOOT FV", 0x9FA00000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN}, - {"UEFI FD", 0x9FC00000, 0x00300000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, + {"FD Reserved", 0x9FC00000, 0x00100000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, + {"UEFI FD", 0x9FD00000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, {"SEC Heap", 0x9FF00000, 0x0008C000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, {"CPU Vectors", 0x9FF8C000, 0x00001000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, {"MMU PageTables", 0x9FF8D000, 0x00003000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN}, @@ -25,6 +25,7 @@ gDeviceMemoryDescriptorEx[] = { {"Log Buffer", 0x9FFF7000, 0x00008000, AddMem, SYS_MEM, SYS_MEM_CAP, RtData, WRITE_BACK_XN}, {"Info Blk", 0x9FFFF000, 0x00001000, AddMem, SYS_MEM, SYS_MEM_CAP, RtData, WRITE_BACK_XN}, {"Kernel", 0xA0000000, 0x10000000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN}, + {"DXE Heap", 0xB0000000, 0x04500000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, {"Guest VM", 0xD0000000, 0x08800000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN}, {"TZApps Reserved", 0xDA000000, 0x08800000, HobOnlyNoCacheSetting, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED_XN}, {"DBI Dump", 0xE9600000, 0x00F00000, NoHob, MMAP_IO, INITIALIZED, Conv, UNCACHED_UNBUFFERED_XN}, diff --git a/Platforms/Xiaomi/viliPkg/PlatformBuild.py b/Platforms/Xiaomi/viliPkg/PlatformBuild.py index aa8caacb7..36bca265b 100644 --- a/Platforms/Xiaomi/viliPkg/PlatformBuild.py +++ b/Platforms/Xiaomi/viliPkg/PlatformBuild.py @@ -1,13 +1,13 @@ ## -# Script to Build Xiaomi 11T Pro UEFI firmware -# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## + import datetime import logging import os import uuid + from io import StringIO from pathlib import Path @@ -15,19 +15,15 @@ from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager -from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, - SetupSettingsManager) +from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager) from edk2toolext.invocables.edk2_update import UpdateSettingsManager from edk2toolext.invocables.edk2_parse import ParseSettingsManager from edk2toollib.utility_functions import RunCmd - # ####################################################################################### # - # Common Configuration # - # ####################################################################################### # -class CommonPlatform(): - ''' Common settings for this platform. Define static data here and use - for the different parts of stuart - ''' +# ####################################################################################### # +# Common Configuration # +# ####################################################################################### # +class CommonPlatform (): PackagesSupported = ("viliPkg") ArchSupported = ("AARCH64") TargetsSupported = ("DEBUG", "RELEASE") @@ -45,191 +41,135 @@ class CommonPlatform(): "Silicon/Silicium" ) +# ####################################################################################### # +# Configuration for Update & Setup # +# ####################################################################################### # +class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - # ####################################################################################### # - # Configuration for Update & Setup # - # ####################################################################################### # -class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager): - - def GetPackagesSupported(self): - ''' return iterable of edk2 packages supported by this build. - These should be edk2 workspace relative paths ''' + def GetPackagesSupported (self): return CommonPlatform.PackagesSupported - def GetArchitecturesSupported(self): - ''' return iterable of edk2 architectures supported by this build ''' + def GetArchitecturesSupported (self): return CommonPlatform.ArchSupported - def GetTargetsSupported(self): - ''' return iterable of edk2 target tags supported by this build ''' + def GetTargetsSupported (self): return CommonPlatform.TargetsSupported - def GetRequiredSubmodules(self): - """Return iterable containing RequiredSubmodule objects. - - !!! note - If no RequiredSubmodules return an empty iterable - """ + def GetRequiredSubmodules (self): return [ - RequiredSubmodule("Binaries", True), - RequiredSubmodule("Common/Mu", True), - RequiredSubmodule("Common/Mu_OEM_Sample", True), - RequiredSubmodule("Common/Mu_Tiano_Plus", True), - RequiredSubmodule("Features/DFCI", True), - RequiredSubmodule("Mu_Basecore", True), - RequiredSubmodule("Silicon/Arm/Mu_Tiano", True), + RequiredSubmodule ("Binaries", True), + RequiredSubmodule ("Common/Mu", True), + RequiredSubmodule ("Common/Mu_OEM_Sample", True), + RequiredSubmodule ("Common/Mu_Tiano_Plus", True), + RequiredSubmodule ("Features/DFCI", True), + RequiredSubmodule ("Mu_Basecore", True), + RequiredSubmodule ("Silicon/Arm/Mu_Tiano", True), ] - def SetArchitectures(self, list_of_requested_architectures): - ''' Confirm the requests architecture list is valid and configure SettingsManager - to run only the requested architectures. - - Raise Exception if a list_of_requested_architectures is not supported - ''' - unsupported = set(list_of_requested_architectures) - \ - set(self.GetArchitecturesSupported()) - if(len(unsupported) > 0): - errorString = ( - "Unsupported Architecture Requested: " + " ".join(unsupported)) - logging.critical( errorString ) - raise Exception( errorString ) + def SetArchitectures (self, list_of_requested_architectures): + unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported()) + + if (len(unsupported) > 0): + errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported)) + logging.critical (errorString) + raise Exception (errorString) + self.ActualArchitectures = list_of_requested_architectures - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list: - ''' Filter other cases that this package should be built - based on changed files. This should cover things that can't - be detected as dependencies. ''' + def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list: build_these_packages = [] - possible_packages = potentialPackagesList.copy() + possible_packages = potentialPackagesList.copy () + for f in changedFilesList: - # BaseTools files that might change the build if "BaseTools" in f: if os.path.splitext(f) not in [".txt", ".md"]: build_these_packages = possible_packages break - # if the azure pipeline platform template file changed if "platform-build-run-steps.yml" in f: build_these_packages = possible_packages break return build_these_packages - def GetPlatformDscAndConfig(self) -> tuple: - ''' If a platform desires to provide its DSC then Policy 4 will evaluate if - any of the changes will be built in the dsc. - - The tuple should be (, ) - ''' + def GetPlatformDscAndConfig (self) -> tuple: return ("viliPkg/vili.dsc", {}) - def GetName(self): + def GetName (self): return "vili" - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' + def GetPackagesPath (self): return CommonPlatform.PackagesPath - # ####################################################################################### # - # Actual Configuration for Platform Build # - # ####################################################################################### # -class PlatformBuilder(UefiBuilder, BuildSettingsManager): - def __init__(self): - UefiBuilder.__init__(self) - - def AddCommandLineOptions(self, parserObj): - ''' Add command line options to the argparser ''' - - # In an effort to support common server based builds this parameter is added. It is - # checked for correctness but is never uses as this platform only supports a single set of - # architectures. - parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", - help="Optional - CSV of architecture to build. AARCH64 is used for PEI and " - "DXE and is the only valid option for this platform.") - - def RetrieveCommandLineOptions(self, args): - ''' Retrieve command line options from the argparser ''' +# ####################################################################################### # +# Actual Configuration for Platform Build # +# ####################################################################################### # +class PlatformBuilder (UefiBuilder, BuildSettingsManager): + def __init__ (self): + UefiBuilder.__init__ (self) + + def AddCommandLineOptions (self, parserObj): + parserObj.add_argument('-a', "--arch", dest="build_arch", type=str, default="AARCH64", help="Optional - CSV of architecture to build. AARCH64 is used for PEI and DXE and is the only valid option for this platform.") + + def RetrieveCommandLineOptions (self, args): if args.build_arch.upper() != "AARCH64": raise Exception("Invalid Arch Specified. Please see comments in PlatformBuild.py::PlatformBuilder::AddCommandLineOptions") - def GetWorkspaceRoot(self): - ''' get WorkspacePath ''' + def GetWorkspaceRoot (self): return CommonPlatform.WorkspaceRoot - def GetPackagesPath(self): - ''' Return a list of paths that should be mapped as edk2 PackagesPath ''' - result = [ - shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") - ] + def GetPackagesPath (self): + result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ] + for a in CommonPlatform.PackagesPath: result.append(a) + return result - def GetActiveScopes(self): - ''' return tuple containing scopes that should be active for this process ''' + def GetActiveScopes (self): return CommonPlatform.Scopes - def GetName(self): - ''' Get the name of the repo, platform, or product being build ''' - ''' Used for naming the log file, among others ''' + def GetName (self): return "viliPkg" - def GetLoggingLevel(self, loggerType): - """Get the logging level depending on logger type. - - Args: - loggerType (str): type of logger being logged to - - Returns: - (Logging.Level): The logging level - - !!! note "loggerType possible values" - "base": lowest logging level supported - - "con": logs to screen - - "txt": logs to plain text file - """ + def GetLoggingLevel (self, loggerType): return logging.INFO return super().GetLoggingLevel(loggerType) - def SetPlatformEnv(self): - logging.debug("PlatformBuilder SetPlatformEnv") - self.env.SetValue("PRODUCT_NAME", "vili", "Platform Hardcoded") - self.env.SetValue("ACTIVE_PLATFORM", "viliPkg/vili.dsc", "Platform Hardcoded") - self.env.SetValue("TARGET_ARCH", "AARCH64", "Platform Hardcoded") - self.env.SetValue("TOOL_CHAIN_TAG", "CLANGDWARF", "set default to clangdwarf") - self.env.SetValue("EMPTY_DRIVE", "FALSE", "Default to false") - self.env.SetValue("RUN_TESTS", "FALSE", "Default to false") - self.env.SetValue("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") - # needed to make FV size build report happy - self.env.SetValue("BLD_*_BUILDID_STRING", "Unknown", "Default") - # Default turn on build reporting. - self.env.SetValue("BUILDREPORTING", "TRUE", "Enabling build report") - self.env.SetValue("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") - self.env.SetValue("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") - # Include the MFCI test cert by default, override on the commandline with "BLD_*_SHIP_MODE=TRUE" if you want the retail MFCI cert - self.env.SetValue("BLD_*_SHIP_MODE", "FALSE", "Default") - self.env.SetValue("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") - self.env.SetValue("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") - self.env.SetValue("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + def SetPlatformEnv (self): + logging.debug ("PlatformBuilder SetPlatformEnv") + + self.env.SetValue ("PRODUCT_NAME", "vili", "Platform Hardcoded") + self.env.SetValue ("ACTIVE_PLATFORM", "viliPkg/vili.dsc", "Platform Hardcoded") + self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded") + self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb") + self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false") + self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false") + self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false") + self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default") + self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report") + self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types") + self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default") + self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default") + self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default") + self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default") + self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default") + return 0 - def PlatformPreBuild(self): + def PlatformPreBuild (self): return 0 - def PlatformPostBuild(self): + def PlatformPostBuild (self): return 0 - def FlashRomImage(self): + def FlashRomImage (self): return 0 if __name__ == "__main__": @@ -239,17 +179,23 @@ def FlashRomImage(self): from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup from edk2toolext.invocables.edk2_update import Edk2Update - SCRIPT_PATH = os.path.relpath(__file__) - parser = argparse.ArgumentParser(add_help=False) + + SCRIPT_PATH = os.path.relpath (__file__) + + parser = argparse.ArgumentParser (add_help=False) + parse_group = parser.add_mutually_exclusive_group() - parse_group.add_argument("--update", "--UPDATE", - action='store_true', help="Invokes stuart_update") - parse_group.add_argument("--setup", "--SETUP", - action='store_true', help="Invokes stuart_setup") + + parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update") + parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup") + args, remaining = parser.parse_known_args() + new_args = ["stuart", "-c", SCRIPT_PATH] new_args = new_args + remaining + sys.argv = new_args + if args.setup: Edk2PlatformSetup().Invoke() elif args.update: diff --git a/Platforms/Xiaomi/viliPkg/vili.dec b/Platforms/Xiaomi/viliPkg/vili.dec index 2995a64cd..e69de29bb 100644 --- a/Platforms/Xiaomi/viliPkg/vili.dec +++ b/Platforms/Xiaomi/viliPkg/vili.dec @@ -1,8 +0,0 @@ -[Defines] - DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = vili - PACKAGE_GUID = 1EAD32CE-3165-49EB-A92D-E88A42572002 - PACKAGE_VERSION = 0.1 - -[Guids] - gviliTokenSpaceGuid = { 0x1EAD32CE, 0x3165, 0x49EB, { 0xA9, 0x2D, 0xE8, 0x8A, 0x42, 0x57, 0x20, 0x02 } } diff --git a/Platforms/Xiaomi/viliPkg/vili.dsc b/Platforms/Xiaomi/viliPkg/vili.dsc index fd11a13be..17a2ab448 100644 --- a/Platforms/Xiaomi/viliPkg/vili.dsc +++ b/Platforms/Xiaomi/viliPkg/vili.dsc @@ -27,9 +27,11 @@ AB_SLOT_SUPPORT = 1 HAS_BUILD_IN_KEYBOARD = 0 + # # 0 = SM8350 # 1 = SM8350-AB # 2 = SM8350-AC + # SOC_TYPE = 0 [BuildOptions] @@ -44,7 +46,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 # Device Maintainer - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"No Maintainer" + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"No Maintainer" # CPU Vector Address gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x9FF8C000 @@ -65,11 +67,14 @@ gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferHeight|2400 gSiliciumPkgTokenSpaceGuid.PcdMipiFrameBufferColorDepth|32 + # XBL Protocol + gQcomPkgTokenSpaceGuid.PcdScheduleInterfaceAddr|0x9FC37980 + # Dynamic RAM Start Address gQcomPkgTokenSpaceGuid.PcdRamPartitionBase|0xECA00000 # SD Card Slot - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE # USB Controller gQcomPkgTokenSpaceGuid.PcdStartUsbController|TRUE diff --git a/Resources/Configs/i005d.conf b/Resources/Configs/i005d.conf index 983feb233..bd978df6b 100644 --- a/Resources/Configs/i005d.conf +++ b/Resources/Configs/i005d.conf @@ -4,9 +4,9 @@ TARGET_MULTIPLE_MODELS="FALSE" TARGET_NUMBER_OF_MODELS="0" # UEFI FD Configs -TARGET_FD_BASE="0x9FC00000" -TARGET_FD_SIZE="0x00300000" -TARGET_FD_BLOCKS="0x300" +TARGET_FD_BASE="0x9FD00000" +TARGET_FD_SIZE="0x00200000" +TARGET_FD_BLOCKS="0x200" # Arch Configs TARGET_ARCH="AARCH64" diff --git a/Resources/Configs/pong.conf b/Resources/Configs/pong.conf index 6347e15a5..486cae9ed 100644 --- a/Resources/Configs/pong.conf +++ b/Resources/Configs/pong.conf @@ -5,7 +5,7 @@ TARGET_NUMBER_OF_MODELS="0" # UEFI FD Configs TARGET_FD_BASE="0xE5700000" -TARGET_FD_SIZE="0x00600000" +TARGET_FD_SIZE="0x00600000" # Make the Size Bigger to prevent Nothing CrashDump TARGET_FD_BLOCKS="0x600" # Arch Configs diff --git a/Resources/Configs/venus.conf b/Resources/Configs/venus.conf index 5d0dabd3a..f2ce62a0d 100644 --- a/Resources/Configs/venus.conf +++ b/Resources/Configs/venus.conf @@ -4,9 +4,9 @@ TARGET_MULTIPLE_MODELS="FALSE" TARGET_NUMBER_OF_MODELS="0" # UEFI FD Configs -TARGET_FD_BASE="0x9FC00000" -TARGET_FD_SIZE="0x00300000" -TARGET_FD_BLOCKS="0x300" +TARGET_FD_BASE="0x9FD00000" +TARGET_FD_SIZE="0x00200000" +TARGET_FD_BLOCKS="0x200" # Arch Configs TARGET_ARCH="AARCH64" diff --git a/Resources/Configs/vili.conf b/Resources/Configs/vili.conf index f677349b5..436413bd4 100644 --- a/Resources/Configs/vili.conf +++ b/Resources/Configs/vili.conf @@ -4,9 +4,9 @@ TARGET_MULTIPLE_MODELS="FALSE" TARGET_NUMBER_OF_MODELS="0" # UEFI FD Configs -TARGET_FD_BASE="0x9FC00000" -TARGET_FD_SIZE="0x00300000" -TARGET_FD_BLOCKS="0x300" +TARGET_FD_BASE="0x9FD00000" +TARGET_FD_SIZE="0x00200000" +TARGET_FD_BLOCKS="0x200" # Arch Configs TARGET_ARCH="AARCH64" diff --git a/Resources/Scripts/9707f.sh b/Resources/Scripts/9707f.sh index c26ec8b31..5c4b0ac17 100644 --- a/Resources/Scripts/9707f.sh +++ b/Resources/Scripts/9707f.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/9707fPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LENOVO_9707F_UEFI.fd" > "./Build/9707fPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LENOVO_9707F_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/9707fPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LENOVO_9707F_UEFI.fd-bootshim" > "./Build/9707fPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LENOVO_9707F_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/9707fPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LENOVO_9707F_UEFI.fd-bootshim.gz" ./Resources/DTBs/9707f.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/9707fPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LENOVO_9707F_UEFI.fd" > "./Build/9707fPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LENOVO_9707F_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/9707fPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LENOVO_9707F_UEFI.fd-bootshim" > "./Build/9707fPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LENOVO_9707F_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/9707fPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LENOVO_9707F_UEFI.fd-bootshim.gz" ./Resources/DTBs/9707f.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/HAC-001.sh b/Resources/Scripts/HAC-001.sh index 328292b97..d291def3a 100644 --- a/Resources/Scripts/HAC-001.sh +++ b/Resources/Scripts/HAC-001.sh @@ -1,4 +1,4 @@ #!/bin/bash # Copy BootShim + UEFI to a Payload File -cat ./BootShim/AARCH64/BootShim.bin "./Build/HAC-001Pkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/HAC-001_UEFI.fd" > ./Mu-HAC-001-${TARGET_DEVICE_MODEL}-Model.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/HAC-001Pkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/HAC-001_UEFI.fd" > ./Mu-HAC-001-${TARGET_DEVICE_MODEL}-Model.bin||exit 1 diff --git a/Resources/Scripts/a10.sh b/Resources/Scripts/a10.sh index 36ca46091..69ac52166 100644 --- a/Resources/Scripts/a10.sh +++ b/Resources/Scripts/a10.sh @@ -1,7 +1,7 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/a10Pkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/A10_UEFI.fd" > "./Resources/bootpayload.bin"||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/a10Pkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/A10_UEFI.fd" > "./Resources/bootpayload.bin"||exit 1 # Create a Bootable Android Boot Image python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/a52sxq.sh b/Resources/Scripts/a52sxq.sh index a36aa4d13..2c23ec11a 100644 --- a/Resources/Scripts/a52sxq.sh +++ b/Resources/Scripts/a52sxq.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/a52sxqPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/A52SXQ_UEFI.fd" > "./Build/a52sxqPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/A52SXQ_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/a52sxqPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/A52SXQ_UEFI.fd-bootshim" > "./Build/a52sxqPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/A52SXQ_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/a52sxqPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/A52SXQ_UEFI.fd-bootshim.gz" ./Resources/DTBs/a52sxq.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/a52sxqPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/A52SXQ_UEFI.fd" > "./Build/a52sxqPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/A52SXQ_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/a52sxqPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/A52SXQ_UEFI.fd-bootshim" > "./Build/a52sxqPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/A52SXQ_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/a52sxqPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/A52SXQ_UEFI.fd-bootshim.gz" ./Resources/DTBs/a52sxq.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/alioth.sh b/Resources/Scripts/alioth.sh index a53fd84e2..6d1560ef6 100644 --- a/Resources/Scripts/alioth.sh +++ b/Resources/Scripts/alioth.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/aliothPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/ALIOTH_UEFI.fd" > "./Build/aliothPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/ALIOTH_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/aliothPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/ALIOTH_UEFI.fd-bootshim" > "./Build/aliothPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/ALIOTH_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/aliothPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/ALIOTH_UEFI.fd-bootshim.gz" ./Resources/DTBs/alioth.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/aliothPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/ALIOTH_UEFI.fd" > "./Build/aliothPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/ALIOTH_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/aliothPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/ALIOTH_UEFI.fd-bootshim" > "./Build/aliothPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/ALIOTH_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/aliothPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/ALIOTH_UEFI.fd-bootshim.gz" ./Resources/DTBs/alioth.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/beyond1lte.sh b/Resources/Scripts/beyond1lte.sh index b66ade259..16e05340a 100644 --- a/Resources/Scripts/beyond1lte.sh +++ b/Resources/Scripts/beyond1lte.sh @@ -1,8 +1,8 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/beyond1ltePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/BEYOND1LTE_UEFI.fd" > "./Build/beyond1ltePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/BEYOND1LTE_UEFI.fd-bootshim"||exit 1 -cat "./Build/beyond1ltePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/BEYOND1LTE_UEFI.fd-bootshim" ./Resources/DTBs/beyond1lte.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/beyond1ltePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/BEYOND1LTE_UEFI.fd" > "./Build/beyond1ltePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/BEYOND1LTE_UEFI.fd-bootshim"||exit 1 +cat "./Build/beyond1ltePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/BEYOND1LTE_UEFI.fd-bootshim" ./Resources/DTBs/beyond1lte.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/bitra.sh b/Resources/Scripts/bitra.sh index 3ce194dd4..2c48ba10a 100644 --- a/Resources/Scripts/bitra.sh +++ b/Resources/Scripts/bitra.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/bitraPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/BITRA_UEFI.fd" > "./Build/bitraPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/BITRA_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/bitraPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/BITRA_UEFI.fd-bootshim" > "./Build/bitraPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/BITRA_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/bitraPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/BITRA_UEFI.fd-bootshim.gz" ./Resources/DTBs/bitra.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/bitraPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/BITRA_UEFI.fd" > "./Build/bitraPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/BITRA_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/bitraPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/BITRA_UEFI.fd-bootshim" > "./Build/bitraPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/BITRA_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/bitraPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/BITRA_UEFI.fd-bootshim.gz" ./Resources/DTBs/bitra.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/c1s.sh b/Resources/Scripts/c1s.sh index cd5fca4cc..2fdea7f42 100644 --- a/Resources/Scripts/c1s.sh +++ b/Resources/Scripts/c1s.sh @@ -1,6 +1,6 @@ #!/bin/bash -cat ./BootShim/AARCH64/BootShim.bin "./Build/c1sPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/C1S_UEFI.fd" > "./Resources/bootpayload.bin"||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/c1sPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/C1S_UEFI.fd" > "./Resources/bootpayload.bin"||exit 1 python3 ./Resources/Scripts/mkbootimg.py \ --kernel ./Resources/bootpayload.bin \ diff --git a/Resources/Scripts/caprip.sh b/Resources/Scripts/caprip.sh index 62fdf4ca6..4b667d20e 100644 --- a/Resources/Scripts/caprip.sh +++ b/Resources/Scripts/caprip.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/capripPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CAPRIP_UEFI.fd" > "./Build/capripPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CAPRIP_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/capripPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CAPRIP_UEFI.fd-bootshim" > "./Build/capripPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CAPRIP_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/capripPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CAPRIP_UEFI.fd-bootshim.gz" ./Resources/DTBs/caprip.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/capripPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CAPRIP_UEFI.fd" > "./Build/capripPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CAPRIP_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/capripPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CAPRIP_UEFI.fd-bootshim" > "./Build/capripPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CAPRIP_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/capripPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CAPRIP_UEFI.fd-bootshim.gz" ./Resources/DTBs/caprip.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/caymanslm.sh b/Resources/Scripts/caymanslm.sh index fcfe554d3..7878d05e3 100644 --- a/Resources/Scripts/caymanslm.sh +++ b/Resources/Scripts/caymanslm.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/caymanslmPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CAYMANSLM_UEFI.fd" > "./Build/caymanslmPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CAYMANSLM_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/caymanslmPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CAYMANSLM_UEFI.fd-bootshim" > "./Build/caymanslmPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CAYMANSLM_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/caymanslmPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CAYMANSLM_UEFI.fd-bootshim.gz" ./Resources/DTBs/caymanslm.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/caymanslmPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CAYMANSLM_UEFI.fd" > "./Build/caymanslmPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CAYMANSLM_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/caymanslmPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CAYMANSLM_UEFI.fd-bootshim" > "./Build/caymanslmPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CAYMANSLM_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/caymanslmPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CAYMANSLM_UEFI.fd-bootshim.gz" ./Resources/DTBs/caymanslm.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/cebu.sh b/Resources/Scripts/cebu.sh index 613aa8b10..32838b33f 100644 --- a/Resources/Scripts/cebu.sh +++ b/Resources/Scripts/cebu.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/cebuPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CEBU_UEFI.fd" > "./Build/cebuPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CEBU_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/cebuPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CEBU_UEFI.fd-bootshim" > "./Build/cebuPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CEBU_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/cebuPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/CEBU_UEFI.fd-bootshim.gz" ./Resources/DTBs/cebu.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/cebuPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CEBU_UEFI.fd" > "./Build/cebuPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CEBU_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/cebuPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CEBU_UEFI.fd-bootshim" > "./Build/cebuPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CEBU_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/cebuPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/CEBU_UEFI.fd-bootshim.gz" ./Resources/DTBs/cebu.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/fog.sh b/Resources/Scripts/fog.sh index 26dddd02e..5ffefe13d 100644 --- a/Resources/Scripts/fog.sh +++ b/Resources/Scripts/fog.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/fogPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/FOG_UEFI.fd" > "./Build/fogPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/FOG_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/fogPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/FOG_UEFI.fd-bootshim" > "./Build/fogPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/FOG_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/fogPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/FOG_UEFI.fd-bootshim.gz" ./Resources/DTBs/fog.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/fogPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/FOG_UEFI.fd" > "./Build/fogPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/FOG_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/fogPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/FOG_UEFI.fd-bootshim" > "./Build/fogPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/FOG_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/fogPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/FOG_UEFI.fd-bootshim.gz" ./Resources/DTBs/fog.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/ginkgo.sh b/Resources/Scripts/ginkgo.sh index fa29ff3a0..3b50bf240 100644 --- a/Resources/Scripts/ginkgo.sh +++ b/Resources/Scripts/ginkgo.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/ginkgoPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/GINKGO_UEFI.fd" > "./Build/ginkgoPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/GINKGO_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/ginkgoPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/GINKGO_UEFI.fd-bootshim" > "./Build/ginkgoPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/GINKGO_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/ginkgoPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/GINKGO_UEFI.fd-bootshim.gz" ./Resources/DTBs/ginkgo.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/ginkgoPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/GINKGO_UEFI.fd" > "./Build/ginkgoPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/GINKGO_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/ginkgoPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/GINKGO_UEFI.fd-bootshim" > "./Build/ginkgoPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/GINKGO_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/ginkgoPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/GINKGO_UEFI.fd-bootshim.gz" ./Resources/DTBs/ginkgo.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/gts8.sh b/Resources/Scripts/gts8.sh index 3824cf95d..159ddc9e0 100644 --- a/Resources/Scripts/gts8.sh +++ b/Resources/Scripts/gts8.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/gts8Pkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/GTS8_UEFI.fd" > "./Build/gts8Pkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/GTS8_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/gts8Pkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/GTS8_UEFI.fd-bootshim" > "./Build/gts8Pkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/GTS8_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/gts8Pkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/GTS8_UEFI.fd-bootshim.gz" ./Resources/DTBs/gts8.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/gts8Pkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/GTS8_UEFI.fd" > "./Build/gts8Pkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/GTS8_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/gts8Pkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/GTS8_UEFI.fd-bootshim" > "./Build/gts8Pkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/GTS8_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/gts8Pkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/GTS8_UEFI.fd-bootshim.gz" ./Resources/DTBs/gts8.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/hotdog.sh b/Resources/Scripts/hotdog.sh index 1731cdf52..822d1af7c 100644 --- a/Resources/Scripts/hotdog.sh +++ b/Resources/Scripts/hotdog.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/hotdogPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/HOTDOG_UEFI.fd" > "./Build/hotdogPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/HOTDOG_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/hotdogPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/HOTDOG_UEFI.fd-bootshim" > "./Build/hotdogPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/HOTDOG_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/hotdogPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/HOTDOG_UEFI.fd-bootshim.gz" ./Resources/DTBs/hotdog.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/hotdogPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/HOTDOG_UEFI.fd" > "./Build/hotdogPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/HOTDOG_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/hotdogPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/HOTDOG_UEFI.fd-bootshim" > "./Build/hotdogPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/HOTDOG_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/hotdogPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/HOTDOG_UEFI.fd-bootshim.gz" ./Resources/DTBs/hotdog.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/i005d.sh b/Resources/Scripts/i005d.sh index 9aa86402c..3f08cb0da 100644 --- a/Resources/Scripts/i005d.sh +++ b/Resources/Scripts/i005d.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/i005dPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/I005D_UEFI.fd" > "./Build/i005dPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/I005D_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/i005dPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/I005D_UEFI.fd-bootshim" > "./Build/i005dPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/I005D_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/i005dPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/I005D_UEFI.fd-bootshim.gz" ./Resources/DTBs/i005d.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/i005dPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/I005D_UEFI.fd" > "./Build/i005dPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/I005D_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/i005dPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/I005D_UEFI.fd-bootshim" > "./Build/i005dPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/I005D_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/i005dPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/I005D_UEFI.fd-bootshim.gz" ./Resources/DTBs/i005d.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/j706f.sh b/Resources/Scripts/j706f.sh index 2bb886b35..916af63dc 100644 --- a/Resources/Scripts/j706f.sh +++ b/Resources/Scripts/j706f.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/j706fPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/J706F_UEFI.fd" > "./Build/j706fPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/J706F_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/j706fPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/J706F_UEFI.fd-bootshim" > "./Build/j706fPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/J706F_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/j706fPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/J706F_UEFI.fd-bootshim.gz" ./Resources/DTBs/j706f.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/j706fPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/J706F_UEFI.fd" > "./Build/j706fPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/J706F_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/j706fPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/J706F_UEFI.fd-bootshim" > "./Build/j706fPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/J706F_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/j706fPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/J706F_UEFI.fd-bootshim.gz" ./Resources/DTBs/j706f.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/kebab.sh b/Resources/Scripts/kebab.sh index f2c984936..7110ef961 100644 --- a/Resources/Scripts/kebab.sh +++ b/Resources/Scripts/kebab.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/kebabPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/KEBAB_UEFI.fd" > "./Build/kebabPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/KEBAB_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/kebabPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/KEBAB_UEFI.fd-bootshim" > "./Build/kebabPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/KEBAB_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/kebabPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/KEBAB_UEFI.fd-bootshim.gz" ./Resources/DTBs/kebab.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/kebabPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/KEBAB_UEFI.fd" > "./Build/kebabPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/KEBAB_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/kebabPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/KEBAB_UEFI.fd-bootshim" > "./Build/kebabPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/KEBAB_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/kebabPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/KEBAB_UEFI.fd-bootshim.gz" ./Resources/DTBs/kebab.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/laurel_sprout.sh b/Resources/Scripts/laurel_sprout.sh index c040af99b..3478c8aa1 100644 --- a/Resources/Scripts/laurel_sprout.sh +++ b/Resources/Scripts/laurel_sprout.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/laurel_sproutPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LAUREL_SPROUT_UEFI.fd" > "./Build/laurel_sproutPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LAUREL_SPROUT_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/laurel_sproutPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LAUREL_SPROUT_UEFI.fd-bootshim" > "./Build/laurel_sproutPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LAUREL_SPROUT_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/laurel_sproutPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LAUREL_SPROUT_UEFI.fd-bootshim.gz" ./Resources/DTBs/laurel_sprout.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/laurel_sproutPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LAUREL_SPROUT_UEFI.fd" > "./Build/laurel_sproutPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LAUREL_SPROUT_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/laurel_sproutPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LAUREL_SPROUT_UEFI.fd-bootshim" > "./Build/laurel_sproutPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LAUREL_SPROUT_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/laurel_sproutPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LAUREL_SPROUT_UEFI.fd-bootshim.gz" ./Resources/DTBs/laurel_sprout.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/lime.sh b/Resources/Scripts/lime.sh index a24d1bb2f..7b1258eb2 100644 --- a/Resources/Scripts/lime.sh +++ b/Resources/Scripts/lime.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/limePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LIME_UEFI.fd" > "./Build/limePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LIME_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/limePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LIME_UEFI.fd-bootshim" > "./Build/limePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LIME_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/limePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LIME_UEFI.fd-bootshim.gz" ./Resources/DTBs/lime.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/limePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LIME_UEFI.fd" > "./Build/limePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LIME_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/limePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LIME_UEFI.fd-bootshim" > "./Build/limePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LIME_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/limePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LIME_UEFI.fd-bootshim.gz" ./Resources/DTBs/lime.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/lisa.sh b/Resources/Scripts/lisa.sh index 77f4a3a97..d1b459e60 100644 --- a/Resources/Scripts/lisa.sh +++ b/Resources/Scripts/lisa.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/lisaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LISA_UEFI.fd" > "./Build/lisaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LISA_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/lisaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LISA_UEFI.fd-bootshim" > "./Build/lisaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LISA_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/lisaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LISA_UEFI.fd-bootshim.gz" ./Resources/DTBs/lisa.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/lisaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LISA_UEFI.fd" > "./Build/lisaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LISA_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/lisaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LISA_UEFI.fd-bootshim" > "./Build/lisaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LISA_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/lisaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LISA_UEFI.fd-bootshim.gz" ./Resources/DTBs/lisa.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/lmi.sh b/Resources/Scripts/lmi.sh index b4be23a6e..d453c4073 100644 --- a/Resources/Scripts/lmi.sh +++ b/Resources/Scripts/lmi.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/lmiPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LMI_UEFI.fd" > "./Build/lmiPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LMI_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/lmiPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LMI_UEFI.fd-bootshim" > "./Build/lmiPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LMI_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/lmiPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/LMI_UEFI.fd-bootshim.gz" ./Resources/DTBs/lmi.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/lmiPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LMI_UEFI.fd" > "./Build/lmiPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LMI_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/lmiPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LMI_UEFI.fd-bootshim" > "./Build/lmiPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LMI_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/lmiPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/LMI_UEFI.fd-bootshim.gz" ./Resources/DTBs/lmi.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/marble.sh b/Resources/Scripts/marble.sh index 5f2a299d4..f37c51e01 100644 --- a/Resources/Scripts/marble.sh +++ b/Resources/Scripts/marble.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/marblePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MARBLE_UEFI.fd" > "./Build/marblePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MARBLE_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/marblePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MARBLE_UEFI.fd-bootshim" > "./Build/marblePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MARBLE_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/marblePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MARBLE_UEFI.fd-bootshim.gz" ./Resources/DTBs/marble.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/marblePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MARBLE_UEFI.fd" > "./Build/marblePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MARBLE_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/marblePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MARBLE_UEFI.fd-bootshim" > "./Build/marblePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MARBLE_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/marblePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MARBLE_UEFI.fd-bootshim.gz" ./Resources/DTBs/marble.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/miatoll.sh b/Resources/Scripts/miatoll.sh index 0bfae320d..6d3331860 100644 --- a/Resources/Scripts/miatoll.sh +++ b/Resources/Scripts/miatoll.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/miatollPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MIATOLL_UEFI.fd" > "./Build/miatollPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MIATOLL_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/miatollPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MIATOLL_UEFI.fd-bootshim" > "./Build/miatollPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MIATOLL_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/miatollPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MIATOLL_UEFI.fd-bootshim.gz" ./Resources/DTBs/miatoll.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/miatollPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MIATOLL_UEFI.fd" > "./Build/miatollPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MIATOLL_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/miatollPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MIATOLL_UEFI.fd-bootshim" > "./Build/miatollPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MIATOLL_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/miatollPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MIATOLL_UEFI.fd-bootshim.gz" ./Resources/DTBs/miatoll.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/munch.sh b/Resources/Scripts/munch.sh index d59f19868..26099b10d 100644 --- a/Resources/Scripts/munch.sh +++ b/Resources/Scripts/munch.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/munchPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MUNCH_UEFI.fd" > "./Build/munchPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MUNCH_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/munchPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MUNCH_UEFI.fd-bootshim" > "./Build/munchPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MUNCH_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/munchPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/MUNCH_UEFI.fd-bootshim.gz" ./Resources/DTBs/munch.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/munchPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MUNCH_UEFI.fd" > "./Build/munchPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MUNCH_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/munchPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MUNCH_UEFI.fd-bootshim" > "./Build/munchPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MUNCH_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/munchPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/MUNCH_UEFI.fd-bootshim.gz" ./Resources/DTBs/munch.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/nitrogen.sh b/Resources/Scripts/nitrogen.sh index 37ce61593..5f84ed386 100644 --- a/Resources/Scripts/nitrogen.sh +++ b/Resources/Scripts/nitrogen.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/nitrogenPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/NITROGEN_UEFI.fd" > "./Build/nitrogenPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/NITROGEN_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/nitrogenPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/NITROGEN_UEFI.fd-bootshim" > "./Build/nitrogenPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/NITROGEN_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/nitrogenPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/NITROGEN_UEFI.fd-bootshim.gz" ./Resources/DTBs/nitrogen.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/nitrogenPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/NITROGEN_UEFI.fd" > "./Build/nitrogenPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/NITROGEN_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/nitrogenPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/NITROGEN_UEFI.fd-bootshim" > "./Build/nitrogenPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/NITROGEN_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/nitrogenPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/NITROGEN_UEFI.fd-bootshim.gz" ./Resources/DTBs/nitrogen.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/pipa.sh b/Resources/Scripts/pipa.sh index 05be83746..1a3a9d041 100644 --- a/Resources/Scripts/pipa.sh +++ b/Resources/Scripts/pipa.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/pipaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/PIPA_UEFI.fd" > "./Build/pipaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/PIPA_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/pipaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/PIPA_UEFI.fd-bootshim" > "./Build/pipaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/PIPA_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/pipaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/PIPA_UEFI.fd-bootshim.gz" ./Resources/DTBs/pipa.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/pipaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/PIPA_UEFI.fd" > "./Build/pipaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/PIPA_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/pipaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/PIPA_UEFI.fd-bootshim" > "./Build/pipaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/PIPA_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/pipaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/PIPA_UEFI.fd-bootshim.gz" ./Resources/DTBs/pipa.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/pong.sh b/Resources/Scripts/pong.sh index 826b8b3fe..da6d960da 100644 --- a/Resources/Scripts/pong.sh +++ b/Resources/Scripts/pong.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/pongPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/PONG_UEFI.fd" > "./Build/pongPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/PONG_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/pongPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/PONG_UEFI.fd-bootshim" > "./Build/pongPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/PONG_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/pongPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/PONG_UEFI.fd-bootshim.gz" ./Resources/DTBs/pong.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/pongPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/PONG_UEFI.fd" > "./Build/pongPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/PONG_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/pongPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/PONG_UEFI.fd-bootshim" > "./Build/pongPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/PONG_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/pongPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/PONG_UEFI.fd-bootshim.gz" ./Resources/DTBs/pong.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/poplar.sh b/Resources/Scripts/poplar.sh index 1d9ff30b6..f7577a3c7 100644 --- a/Resources/Scripts/poplar.sh +++ b/Resources/Scripts/poplar.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/poplarPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/POPLAR_UEFI.fd" > "./Build/poplarPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/POPLAR_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/poplarPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/POPLAR_UEFI.fd-bootshim" > "./Build/poplarPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/POPLAR_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/poplarPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/POPLAR_UEFI.fd-bootshim.gz" ./Resources/DTBs/poplar.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/poplarPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/POPLAR_UEFI.fd" > "./Build/poplarPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/POPLAR_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/poplarPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/POPLAR_UEFI.fd-bootshim" > "./Build/poplarPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/POPLAR_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/poplarPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/POPLAR_UEFI.fd-bootshim.gz" ./Resources/DTBs/poplar.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/q2q.sh b/Resources/Scripts/q2q.sh index 8ff006e50..0c6340f75 100644 --- a/Resources/Scripts/q2q.sh +++ b/Resources/Scripts/q2q.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/q2qPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/Q2Q_UEFI.fd" > "./Build/q2qPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/Q2Q_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/q2qPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/Q2Q_UEFI.fd-bootshim" > "./Build/q2qPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/Q2Q_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/q2qPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/Q2Q_UEFI.fd-bootshim.gz" ./Resources/DTBs/q2q.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/q2qPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/Q2Q_UEFI.fd" > "./Build/q2qPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/Q2Q_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/q2qPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/Q2Q_UEFI.fd-bootshim" > "./Build/q2qPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/Q2Q_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/q2qPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/Q2Q_UEFI.fd-bootshim.gz" ./Resources/DTBs/q2q.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/r8s.sh b/Resources/Scripts/r8s.sh index 5cea49aaf..8e92c6934 100644 --- a/Resources/Scripts/r8s.sh +++ b/Resources/Scripts/r8s.sh @@ -1,6 +1,6 @@ #!/bin/bash -cat ./BootShim/AARCH64/BootShim.bin "./Build/r8sPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/R8S_UEFI.fd" > "./Resources/bootpayload.bin"||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/r8sPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/R8S_UEFI.fd" > "./Resources/bootpayload.bin"||exit 1 python3 ./Resources/Scripts/mkbootimg.py \ --kernel ./Resources/bootpayload.bin \ diff --git a/Resources/Scripts/spes.sh b/Resources/Scripts/spes.sh index d774bbb5d..fa6894e60 100644 --- a/Resources/Scripts/spes.sh +++ b/Resources/Scripts/spes.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/spesPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SPES_UEFI.fd" > "./Build/spesPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SPES_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/spesPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SPES_UEFI.fd-bootshim" > "./Build/spesPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SPES_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/spesPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SPES_UEFI.fd-bootshim.gz" ./Resources/DTBs/spes.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/spesPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SPES_UEFI.fd" > "./Build/spesPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SPES_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/spesPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SPES_UEFI.fd-bootshim" > "./Build/spesPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SPES_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/spesPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SPES_UEFI.fd-bootshim.gz" ./Resources/DTBs/spes.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/starlte.sh b/Resources/Scripts/starlte.sh index 81d6afa65..e5ae8bc15 100644 --- a/Resources/Scripts/starlte.sh +++ b/Resources/Scripts/starlte.sh @@ -1,6 +1,6 @@ #!/bin/bash -cat ./BootShim/AARCH64/BootShim.bin "./Build/starltePkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/STARLTE_UEFI.fd" > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/starltePkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/STARLTE_UEFI.fd" > ./Resources/bootpayload.bin||exit 1 python3 ./Resources/Scripts/mkbootimg.py \ --kernel ./Resources/bootpayload.bin \ diff --git a/Resources/Scripts/surya.sh b/Resources/Scripts/surya.sh index 0d809e79a..38d53f147 100644 --- a/Resources/Scripts/surya.sh +++ b/Resources/Scripts/surya.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/suryaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SURYA_UEFI.fd" > "./Build/suryaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SURYA_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/suryaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SURYA_UEFI.fd-bootshim" > "./Build/suryaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SURYA_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/suryaPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SURYA_UEFI.fd-bootshim.gz" ./Resources/DTBs/surya.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/suryaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SURYA_UEFI.fd" > "./Build/suryaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SURYA_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/suryaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SURYA_UEFI.fd-bootshim" > "./Build/suryaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SURYA_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/suryaPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SURYA_UEFI.fd-bootshim.gz" ./Resources/DTBs/surya.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/sweet.sh b/Resources/Scripts/sweet.sh index ee0f2398c..852a1b19d 100644 --- a/Resources/Scripts/sweet.sh +++ b/Resources/Scripts/sweet.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/sweetPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SWEET_UEFI.fd" > "./Build/sweetPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SWEET_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/sweetPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SWEET_UEFI.fd-bootshim" > "./Build/sweetPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SWEET_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/sweetPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SWEET_UEFI.fd-bootshim.gz" ./Resources/DTBs/sweet.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/sweetPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SWEET_UEFI.fd" > "./Build/sweetPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SWEET_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/sweetPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SWEET_UEFI.fd-bootshim" > "./Build/sweetPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SWEET_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/sweetPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SWEET_UEFI.fd-bootshim.gz" ./Resources/DTBs/sweet.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/sweet_k6a.sh b/Resources/Scripts/sweet_k6a.sh index 73b1dba26..b692a1682 100644 --- a/Resources/Scripts/sweet_k6a.sh +++ b/Resources/Scripts/sweet_k6a.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/sweet_k6aPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SWEET_K6A_UEFI.fd" > "./Build/sweet_k6aPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SWEET_K6A_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/sweet_k6aPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SWEET_K6A_UEFI.fd-bootshim" > "./Build/sweet_k6aPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SWEET_K6A_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/sweet_k6aPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/SWEET_K6A_UEFI.fd-bootshim.gz" ./Resources/DTBs/sweet_k6a.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/sweet_k6aPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SWEET_K6A_UEFI.fd" > "./Build/sweet_k6aPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SWEET_K6A_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/sweet_k6aPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SWEET_K6A_UEFI.fd-bootshim" > "./Build/sweet_k6aPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SWEET_K6A_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/sweet_k6aPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/SWEET_K6A_UEFI.fd-bootshim.gz" ./Resources/DTBs/sweet_k6a.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/tapas.sh b/Resources/Scripts/tapas.sh index 8cf466380..254869c21 100644 --- a/Resources/Scripts/tapas.sh +++ b/Resources/Scripts/tapas.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/tapasPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/TAPAS_UEFI.fd" > "./Build/tapasPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/TAPAS_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/tapasPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/TAPAS_UEFI.fd-bootshim" > "./Build/tapasPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/TAPAS_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/tapasPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/TAPAS_UEFI.fd-bootshim.gz" ./Resources/DTBs/tapas.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/tapasPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/TAPAS_UEFI.fd" > "./Build/tapasPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/TAPAS_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/tapasPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/TAPAS_UEFI.fd-bootshim" > "./Build/tapasPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/TAPAS_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/tapasPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/TAPAS_UEFI.fd-bootshim.gz" ./Resources/DTBs/tapas.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/venus.sh b/Resources/Scripts/venus.sh index 3fbb863cc..a3710e5a6 100644 --- a/Resources/Scripts/venus.sh +++ b/Resources/Scripts/venus.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/venusPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/VENUS_UEFI.fd" > "./Build/venusPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/VENUS_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/venusPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/VENUS_UEFI.fd-bootshim" > "./Build/venusPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/VENUS_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/venusPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/VENUS_UEFI.fd-bootshim.gz" ./Resources/DTBs/venus.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/venusPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/VENUS_UEFI.fd" > "./Build/venusPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/VENUS_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/venusPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/VENUS_UEFI.fd-bootshim" > "./Build/venusPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/VENUS_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/venusPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/VENUS_UEFI.fd-bootshim.gz" ./Resources/DTBs/venus.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/vili.sh b/Resources/Scripts/vili.sh index e9cf97441..87857da6d 100644 --- a/Resources/Scripts/vili.sh +++ b/Resources/Scripts/vili.sh @@ -1,9 +1,9 @@ #!/bin/bash # Build an Android kernel that is actually UEFI disguised as the Kernel -cat ./BootShim/AARCH64/BootShim.bin "./Build/viliPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/VILI_UEFI.fd" > "./Build/viliPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/VILI_UEFI.fd-bootshim"||exit 1 -gzip -c < "./Build/viliPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/VILI_UEFI.fd-bootshim" > "./Build/viliPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/VILI_UEFI.fd-bootshim.gz"||exit 1 -cat "./Build/viliPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/VILI_UEFI.fd-bootshim.gz" ./Resources/DTBs/vili.dtb > ./Resources/bootpayload.bin||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/viliPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/VILI_UEFI.fd" > "./Build/viliPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/VILI_UEFI.fd-bootshim"||exit 1 +gzip -c < "./Build/viliPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/VILI_UEFI.fd-bootshim" > "./Build/viliPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/VILI_UEFI.fd-bootshim.gz"||exit 1 +cat "./Build/viliPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/VILI_UEFI.fd-bootshim.gz" ./Resources/DTBs/vili.dtb > ./Resources/bootpayload.bin||exit 1 # Create bootable Android boot.img python3 ./Resources/Scripts/mkbootimg.py \ diff --git a/Resources/Scripts/x1s.sh b/Resources/Scripts/x1s.sh index 045ac5b81..486d55953 100644 --- a/Resources/Scripts/x1s.sh +++ b/Resources/Scripts/x1s.sh @@ -1,6 +1,6 @@ #!/bin/bash -cat ./BootShim/AARCH64/BootShim.bin "./Build/x1sPkg/${_TARGET_BUILD_MODE}_CLANGDWARF/FV/X1S_UEFI.fd" > "./Resources/bootpayload.bin"||exit 1 +cat ./BootShim/AARCH64/BootShim.bin "./Build/x1sPkg/${_TARGET_BUILD_MODE}_CLANGPDB/FV/X1S_UEFI.fd" > "./Resources/bootpayload.bin"||exit 1 python3 ./Resources/Scripts/mkbootimg.py \ --kernel ./Resources/bootpayload.bin \ diff --git a/Silicon/Nvidia/NvidiaPkg/Library/BdsExtensionLib/BdsExtensionLib.c b/Silicon/Nvidia/NvidiaPkg/Library/BdsExtensionLib/BdsExtensionLib.c deleted file mode 100644 index 4b9e8ef1c..000000000 --- a/Silicon/Nvidia/NvidiaPkg/Library/BdsExtensionLib/BdsExtensionLib.c +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -VOID -BdsExtensionAfterConsole () -{ - EFI_STATUS Status; - EFI_GRAPHICS_OUTPUT_PROTOCOL *mConsoleOutHandle; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL Black; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL White; - - // Locate Console Out Handle - Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID *)&mConsoleOutHandle); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a: Failed to Locate Console Out Protocol! Status %r\n", __FUNCTION__, Status)); - } else { - // Combo Message - CHAR16 *ComboMessage = L"[Volume Up] UEFI Menu"; - - // Set Pos for Combo Message - UINTN XPos = (mConsoleOutHandle->Mode->Info->HorizontalResolution - StrLen(ComboMessage) * EFI_GLYPH_WIDTH) / 2; - UINTN YPos = (mConsoleOutHandle->Mode->Info->VerticalResolution - EFI_GLYPH_HEIGHT) * 48 / 50; - - // Set Color for the Message - Black.Blue = Black.Green = Black.Red = Black.Reserved = 0; - White.Blue = White.Green = White.Red = White.Reserved = 0xFF; - - // Display Combo Message - PrintXY (XPos, YPos, &White, &Black, ComboMessage); - } -} - -VOID -BdsExtensionPlatformConnectList () {} - -EFI_STATUS -EFIAPI -BdsExtensionPriorityBoot (EFI_BOOT_MANAGER_LOAD_OPTION *BootOption) -{ - EFI_STATUS Status = EFI_SUCCESS; - BOOLEAN FrontPageBoot = MsBootPolicyLibIsVolumeUp (); - - MsBootPolicyLibClearBootRequests (); - - // - // There are four cases: - // 1. Nothing pressed. - Return EFI_NOT_FOUND. - // 2. FrontPageBoot - Load FrontPage. - // - - if (FrontPageBoot) { - Status = MsBootOptionsLibGetBootManagerMenu (BootOption, "VOL+"); - SetRebootReason (OEM_REBOOT_TO_SETUP_KEY); - } else { - Status = EFI_NOT_FOUND; - } - - return Status; -} diff --git a/Silicon/Nvidia/NvidiaPkg/Library/BdsExtensionLib/BdsExtensionLib.inf b/Silicon/Nvidia/NvidiaPkg/Library/BdsExtensionLib/BdsExtensionLib.inf deleted file mode 100644 index ee6b5dad3..000000000 --- a/Silicon/Nvidia/NvidiaPkg/Library/BdsExtensionLib/BdsExtensionLib.inf +++ /dev/null @@ -1,27 +0,0 @@ -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = BdsExtensionLib - FILE_GUID = 00EF5892-29B0-4D6A-BE06-754BD319FB08 - VERSION_STRING = 1.0 - MODULE_TYPE = DXE_DRIVER - LIBRARY_CLASS = BdsExtensionLib|DXE_DRIVER - -[Sources] - BdsExtensionLib.c - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - MsCorePkg/MsCorePkg.dec - PcBdsPkg/PcBdsPkg.dec - SiliciumPkg/SiliciumPkg.dec - -[LibraryClasses] - DebugLib - MsBootPolicyLib - MsBootOptionsLib - UefiRuntimeServicesTableLib - MsNVBootReasonLib - UefiBootServicesTableLib - DeviceBootManagerLib - UefiLib diff --git a/Silicon/Nvidia/NvidiaPkg/NvidiaPkg.dsc.inc b/Silicon/Nvidia/NvidiaPkg/NvidiaPkg.dsc.inc index f7038dbaa..6d3a54362 100644 --- a/Silicon/Nvidia/NvidiaPkg/NvidiaPkg.dsc.inc +++ b/Silicon/Nvidia/NvidiaPkg/NvidiaPkg.dsc.inc @@ -11,16 +11,11 @@ [LibraryClasses] # Custom Libraries - PowerServicesLib|PcBdsPkg/Library/PowerServicesLibNull/PowerServicesLibNull.inf - BdsExtensionLib|NvidiaPkg/Library/BdsExtensionLib/BdsExtensionLib.inf !if $(USE_CUSTOM_TIMER) == 1 TimerLib|NvidiaPkg/GPLLibrary/TegraTimerLib/TegraTimerLib.inf !endif [Components] - # BDS - MdeModulePkg/Universal/BdsDxe/BdsDxe.inf - # Custom Tegra Drivers NvidiaPkg/GPLDrivers/TegraGpioDxe/TegraGpioDxe.inf !if $(USE_CUSTOM_TIMER) == 1 diff --git a/Silicon/Nvidia/Tegra210Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Nvidia/Tegra210Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 09f3302ce..e2528d328 100644 --- a/Silicon/Nvidia/Tegra210Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Nvidia/Tegra210Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Nvidia/Tegra210Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Nvidia/Tegra210Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 7165f4bc5..3e2af5af3 100644 --- a/Silicon/Nvidia/Tegra210Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Nvidia/Tegra210Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -122,9 +123,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Nvidia/Tegra210Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Nvidia/Tegra210Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4111b4e43..55b31a79b 100644 --- a/Silicon/Nvidia/Tegra210Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Nvidia/Tegra210Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -26,8 +26,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -35,6 +33,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Nvidia/Tegra210Pkg/Tegra210Pkg.dsc.inc b/Silicon/Nvidia/Tegra210Pkg/Tegra210Pkg.dsc.inc index 3d2989846..477d0453f 100644 --- a/Silicon/Nvidia/Tegra210Pkg/Tegra210Pkg.dsc.inc +++ b/Silicon/Nvidia/Tegra210Pkg/Tegra210Pkg.dsc.inc @@ -9,9 +9,19 @@ ## [Defines] - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 1 + # GIC + USE_CUSTOM_GIC = 0 + + # Timer + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 1 + + # KEP + ENABLE_KEP = 0 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8-a+crypto+rcpc diff --git a/Silicon/Nvidia/Tegra30Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Nvidia/Tegra30Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index e64cdd457..07a82716c 100644 --- a/Silicon/Nvidia/Tegra30Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Nvidia/Tegra30Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Nvidia/Tegra30Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Nvidia/Tegra30Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 7c3462bcb..c629119ce 100644 --- a/Silicon/Nvidia/Tegra30Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Nvidia/Tegra30Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -122,9 +123,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Nvidia/Tegra30Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Nvidia/Tegra30Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4111b4e43..55b31a79b 100644 --- a/Silicon/Nvidia/Tegra30Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Nvidia/Tegra30Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -26,8 +26,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -35,6 +33,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Nvidia/Tegra30Pkg/Tegra30Pkg.dsc.inc b/Silicon/Nvidia/Tegra30Pkg/Tegra30Pkg.dsc.inc index 038b5a841..4a1f46327 100644 --- a/Silicon/Nvidia/Tegra30Pkg/Tegra30Pkg.dsc.inc +++ b/Silicon/Nvidia/Tegra30Pkg/Tegra30Pkg.dsc.inc @@ -9,9 +9,19 @@ ## [Defines] - USE_CUSTOM_GIC = 0 # Might be needed Later? - USE_CUSTOM_TIMER = 1 - USE_PHYSICAL_TIMER = 1 + # GIC + USE_CUSTOM_GIC = 0 # Might be needed Later? + + # Timer + USE_CUSTOM_TIMER = 1 + USE_PHYSICAL_TIMER = 1 + + # KEP + ENABLE_KEP = 0 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 [PcdsFixedAtBuild] # Timer diff --git a/Silicon/Qualcomm/MSM8998Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/MSM8998Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 3425444fe..97fad34cd 100644 --- a/Silicon/Qualcomm/MSM8998Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/MSM8998Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/MSM8998Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/MSM8998Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 2ba81c986..1235a33ca 100644 --- a/Silicon/Qualcomm/MSM8998Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/MSM8998Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/MSM8998Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/MSM8998Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..0f2f2c8d1 100644 --- a/Silicon/Qualcomm/MSM8998Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/MSM8998Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,7 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor @@ -37,6 +36,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/MSM8998Pkg/MSM8998Pkg.dsc.inc b/Silicon/Qualcomm/MSM8998Pkg/MSM8998Pkg.dsc.inc index f6c1bb9c3..85613770a 100644 --- a/Silicon/Qualcomm/MSM8998Pkg/MSM8998Pkg.dsc.inc +++ b/Silicon/Qualcomm/MSM8998Pkg/MSM8998Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 1 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 1 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8-a+crypto+rcpc @@ -48,9 +51,6 @@ gArmPlatformTokenSpaceGuid.PcdClusterCount|2 gQcomPkgTokenSpaceGuid.PcdHasLevel3Cache|FALSE - # Power Services - gQcomPkgTokenSpaceGuid.PcdIsPowerOkImplemented|FALSE - # CPU Max Freq gQcomPkgTokenSpaceGuid.PcdMaxFreqSupported|FALSE diff --git a/Silicon/Qualcomm/QcomPkg/Drivers/PeripheralInitDxe/PeripheralInitDxe.c b/Silicon/Qualcomm/QcomPkg/Drivers/PeripheralInitDxe/PeripheralInitDxe.c new file mode 100644 index 000000000..e3aa9c730 --- /dev/null +++ b/Silicon/Qualcomm/QcomPkg/Drivers/PeripheralInitDxe/PeripheralInitDxe.c @@ -0,0 +1,50 @@ +#include +#include +#include +#include + +STATIC +VOID +DummyNotify ( + IN EFI_EVENT Event, + IN VOID *Context) +{ + // Dummy Function Needed for Event Notification Callback +} + +EFI_STATUS +EFIAPI +InitPeripherals ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable) +{ + EFI_STATUS Status; + EFI_EVENT InitEvent; + + // Update the ACPI Tables + PlatformUpdateAcpiTables (); + + // Start the USB Port Controller + if (FixedPcdGetBool(PcdStartUsbController)) { + Status = gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_CALLBACK, DummyNotify, NULL, &gUsbControllerInitGuid, &InitEvent); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "Failed to Create USB Port Controller Start Event! Status = %r\n", Status)); + } else { + gBS->SignalEvent (InitEvent); + gBS->CloseEvent (InitEvent); + } + } + + // Init SD Card Slot + if (FixedPcdGetBool(PcdInitCardSlot)) { + Status = gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_CALLBACK, DummyNotify, NULL, &gSDCardInitGuid, &InitEvent); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "Failed to Create SD Card Init Event! Status = %r\n", Status)); + } else { + gBS->SignalEvent (InitEvent); + gBS->CloseEvent (InitEvent); + } + } + + return Status; +} diff --git a/Silicon/Qualcomm/QcomPkg/Drivers/PeripheralInitDxe/PeripheralInitDxe.inf b/Silicon/Qualcomm/QcomPkg/Drivers/PeripheralInitDxe/PeripheralInitDxe.inf new file mode 100644 index 000000000..11cada3f6 --- /dev/null +++ b/Silicon/Qualcomm/QcomPkg/Drivers/PeripheralInitDxe/PeripheralInitDxe.inf @@ -0,0 +1,32 @@ +[Defines] + INF_VERSION = 0x0010005 + BASE_NAME = PeripheralInitDxe + FILE_GUID = 1706748B-CD5E-4589-A6CF-047DBA0A72A0 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + ENTRY_POINT = InitPeripherals + +[Sources] + PeripheralInitDxe.c + +[Packages] + MdePkg/MdePkg.dec + QcomPkg/QcomPkg.dec + +[LibraryClasses] + PcdLib + DebugLib + UefiDriverEntryPoint + UefiBootServicesTableLib + AcpiPlatformUpdateLib + +[FixedPcd] + gQcomPkgTokenSpaceGuid.PcdStartUsbController + gQcomPkgTokenSpaceGuid.PcdInitCardSlot + +[Guids] + gUsbControllerInitGuid + gSDCardInitGuid + +[Depex] + TRUE diff --git a/Silicon/Qualcomm/QcomPkg/Extra.fdf.inc b/Silicon/Qualcomm/QcomPkg/Extra.fdf.inc index e6615aa24..c9e9e0fd3 100644 --- a/Silicon/Qualcomm/QcomPkg/Extra.fdf.inc +++ b/Silicon/Qualcomm/QcomPkg/Extra.fdf.inc @@ -3,4 +3,6 @@ INF QcomPkg/GPLApplications/SwitchSlotsApp/SwitchSlotsApp.inf !endif + INF QcomPkg/Drivers/PeripheralInitDxe/PeripheralInitDxe.inf + !include SiliciumPkg/Extra.fdf.inc diff --git a/Silicon/Qualcomm/QcomPkg/Library/BdsExtensionLib/BdsExtensionLib.c b/Silicon/Qualcomm/QcomPkg/Library/BdsExtensionLib/BdsExtensionLib.c deleted file mode 100644 index 7957a417b..000000000 --- a/Silicon/Qualcomm/QcomPkg/Library/BdsExtensionLib/BdsExtensionLib.c +++ /dev/null @@ -1,121 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -VOID -BdsExtensionAfterConsole () -{ - EFI_STATUS Status; - EFI_GRAPHICS_OUTPUT_PROTOCOL *mConsoleOutHandle; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL Black; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL White; - - // Locate Console Out Handle - Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID *)&mConsoleOutHandle); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a: Failed to Locate Console Out Protocol! Status %r\n", __FUNCTION__, Status)); - } else { - // Combo Message -#if AB_SLOT_SUPPORT == 1 - CHAR16 *ComboMessage = L"[Volume Up] UEFI Menu - [Volume Down] Slot Switch"; -#else - CHAR16 *ComboMessage = L"[Volume Up] UEFI Menu"; -#endif - - // Set Pos for Combo Message - UINTN XPos = (mConsoleOutHandle->Mode->Info->HorizontalResolution - StrLen(ComboMessage) * EFI_GLYPH_WIDTH) / 2; - UINTN YPos = (mConsoleOutHandle->Mode->Info->VerticalResolution - EFI_GLYPH_HEIGHT) * 48 / 50; - - // Set Color for the Message - Black.Blue = Black.Green = Black.Red = Black.Reserved = 0; - White.Blue = White.Green = White.Red = White.Reserved = 0xFF; - - // Display Combo Message - PrintXY (XPos, YPos, &White, &Black, ComboMessage); - } -} - -// Dummy Function Needed for Event Notification Callback -STATIC -VOID -DummyNotify ( - IN EFI_EVENT Event, - IN VOID *Context) -{ - // Do Nothing -} - -VOID -BdsExtensionPlatformConnectList () -{ - EFI_STATUS Status; - EFI_EVENT UsbConfigEvt; - EFI_EVENT SDCardEvt; - - // Update the ACPI Tables with SoC Runtime Information - PlatformUpdateAcpiTables (); - - if (FixedPcdGetBool(PcdStartUsbController)) { - // Notify the USB Controller to Start Now - Status = gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_CALLBACK, DummyNotify, NULL, &gUsbControllerInitGuid, &UsbConfigEvt); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a: Failed to Signal USB Controller Start Event! Status = %r\n", __FUNCTION__, Status)); - } else { - gBS->SignalEvent (UsbConfigEvt); - gBS->CloseEvent (UsbConfigEvt); - } - } - - if (FixedPcdGetBool(PcdSDCardSlotPresent)) { - // Notify the SDC Controller to Init SD Card Now - Status = gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_CALLBACK, DummyNotify, NULL, &gSDCardInitGuid, &SDCardEvt); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a: Failed to Signal SD Card Init Event! Status = %r\n", __FUNCTION__, Status)); - } else { - gBS->SignalEvent (SDCardEvt); - gBS->CloseEvent (SDCardEvt); - } - } -} - -EFI_STATUS -EFIAPI -BdsExtensionPriorityBoot (EFI_BOOT_MANAGER_LOAD_OPTION *BootOption) -{ - EFI_STATUS Status = EFI_SUCCESS; - BOOLEAN FrontPageBoot = MsBootPolicyLibIsVolumeUp (); - BOOLEAN SlotSwitch = MsBootPolicyLibIsVolumeDown (); - - MsBootPolicyLibClearBootRequests (); - - // - // There are four cases: - // 1. Nothing pressed. - Return EFI_NOT_FOUND. - // 2. FrontPageBoot - Load FrontPage. - // 3. SlotSwitch - Load Slot Switch App. - // - - if (SlotSwitch) { -#if AB_SLOT_SUPPORT == 1 - Status = BuildFwLoadOption (BootOption, PcdGetPtr (PcdSlotSwitchApp), "VOL-"); -#else - Status = EFI_NOT_FOUND; -#endif - } else if (FrontPageBoot) { - Status = MsBootOptionsLibGetBootManagerMenu (BootOption, "VOL+"); - SetRebootReason (OEM_REBOOT_TO_SETUP_KEY); - } else { - Status = EFI_NOT_FOUND; - } - - return Status; -} diff --git a/Silicon/Qualcomm/QcomPkg/Library/BdsExtensionLib/BdsExtensionLib.inf b/Silicon/Qualcomm/QcomPkg/Library/BdsExtensionLib/BdsExtensionLib.inf deleted file mode 100644 index 0705f7520..000000000 --- a/Silicon/Qualcomm/QcomPkg/Library/BdsExtensionLib/BdsExtensionLib.inf +++ /dev/null @@ -1,38 +0,0 @@ -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = BdsExtensionLib - FILE_GUID = 00EF5892-29B0-4D6A-BE06-754BD319FB08 - VERSION_STRING = 1.0 - MODULE_TYPE = DXE_DRIVER - LIBRARY_CLASS = BdsExtensionLib|DXE_DRIVER - -[Sources] - BdsExtensionLib.c - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - MsCorePkg/MsCorePkg.dec - PcBdsPkg/PcBdsPkg.dec - QcomPkg/QcomPkg.dec - SiliciumPkg/SiliciumPkg.dec - -[LibraryClasses] - DebugLib - MsBootPolicyLib - MsBootOptionsLib - UefiRuntimeServicesTableLib - MsNVBootReasonLib - UefiBootServicesTableLib - DeviceBootManagerLib - UefiLib - AcpiPlatformUpdateLib - -[FixedPcd] - gQcomPkgTokenSpaceGuid.PcdStartUsbController - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent - gQcomPkgTokenSpaceGuid.PcdSlotSwitchApp - -[Guids] - gUsbControllerInitGuid - gSDCardInitGuid diff --git a/Silicon/Qualcomm/QcomPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.c b/Silicon/Qualcomm/QcomPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.c index 8c1295534..892b253af 100644 --- a/Silicon/Qualcomm/QcomPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.c +++ b/Silicon/Qualcomm/QcomPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.c @@ -170,10 +170,7 @@ UpdateNameAslCode ( // Locate ACPI Table with matching Signature Status = LocateAcpiTableBySignature (EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, (EFI_ACPI_DESCRIPTION_HEADER **)&Table, &Handle); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Failed to Locate ACPI Table with its Signature! Status = %r\n", Status)); - goto exit; - } + if (EFI_ERROR (Status)) { goto exit; } // Point to the Beginning of the DSDT Table CurrPtr = (UINT8 *)Table; @@ -334,10 +331,7 @@ UpdateMethodAslCode ( // Locate ACPI Table with matching Signature Status = LocateAcpiTableBySignature (EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, (EFI_ACPI_DESCRIPTION_HEADER **)&Table, &Handle); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Failed to Locate ACPI Table with its Signature! Status = %r\n", Status)); - goto exit; - } + if (EFI_ERROR (Status)) { goto exit; } // Point to the Beginning of the DSDT Table CurrPtr = (UINT8 *)Table; diff --git a/Silicon/Qualcomm/QcomPkg/Library/PowerServicesLib/PowerServicesLib.c b/Silicon/Qualcomm/QcomPkg/Library/PowerServicesLib/PowerServicesLib.c deleted file mode 100644 index 3c6a7f349..000000000 --- a/Silicon/Qualcomm/QcomPkg/Library/PowerServicesLib/PowerServicesLib.c +++ /dev/null @@ -1,51 +0,0 @@ -/** - Copyright (C) Microsoft Corporation. All rights reserved. - - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#include -#include -#include -#include - -#include - -EFI_STATUS -EFIAPI -SystemPowerCheck ( - IN POWER_CASE Case, - OUT BOOLEAN *Good) -{ - EFI_STATUS Status = EFI_SUCCESS; - EFI_CHARGER_EX_PROTOCOL *gEfiChargerExProtocol = NULL; - EFI_CHARGER_EX_FLASH_INFO FlashInfo; - - if (FixedPcdGetBool(PcdIsPowerOkImplemented)) { - // Locate Charger Ex Protocol - Status = gBS->LocateProtocol (&gChargerExProtocolGuid, NULL, (VOID *)&gEfiChargerExProtocol); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a: Failed to Locate Charger Ex Protocol! Status = %r\n", __FUNCTION__, Status)); - *Good = TRUE; - goto exit; - } - - // Check if Battery has Enough Power to Boot. - Status = gEfiChargerExProtocol->IsPowerOk (EFI_CHARGER_EX_POWER_FLASH_BATTERY_VOLTAGE_TYPE, &FlashInfo); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a: Failed to Check if Battery has Enough Power! Status = %r\n", __FUNCTION__, Status)); - *Good = TRUE; - } else { - *Good = FlashInfo.bCanFlash; - } - } else { - *Good = TRUE; - } - -exit: - return Status; -} - -EFI_STATUS -EFIAPI -SystemPowerMitigate (IN POWER_CASE Case) { return EFI_UNSUPPORTED; } diff --git a/Silicon/Qualcomm/QcomPkg/Library/PowerServicesLib/PowerServicesLib.inf b/Silicon/Qualcomm/QcomPkg/Library/PowerServicesLib/PowerServicesLib.inf deleted file mode 100644 index c330e64fd..000000000 --- a/Silicon/Qualcomm/QcomPkg/Library/PowerServicesLib/PowerServicesLib.inf +++ /dev/null @@ -1,34 +0,0 @@ -## -# Power Services Library Class to Support Platforms that have a Battery. -# -# Copyright (C) Microsoft Corporation. All rights reserved. -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -## - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = PowerServicesLib - FILE_GUID = 288AC8FF-0670-49e4-BB57-6A16F89D0C5A - MODULE_TYPE = DXE_DRIVER - VERSION_STRING = 1.0 - LIBRARY_CLASS = PowerServicesLib|DXE_DRIVER - -[Sources] - PowerServicesLib.c - -[Packages] - MdePkg/MdePkg.dec - PcBdsPkg/PcBdsPkg.dec - QcomPkg/QcomPkg.dec - -[LibraryClasses] - DebugLib - UefiBootServicesTableLib - PcdLib - -[FixedPcd] - gQcomPkgTokenSpaceGuid.PcdIsPowerOkImplemented - -[Protocols] - gChargerExProtocolGuid diff --git a/Silicon/Qualcomm/QcomPkg/QcomPkg.dec b/Silicon/Qualcomm/QcomPkg/QcomPkg.dec index 5d4197905..7002ea9e7 100644 --- a/Silicon/Qualcomm/QcomPkg/QcomPkg.dec +++ b/Silicon/Qualcomm/QcomPkg/QcomPkg.dec @@ -104,14 +104,12 @@ gQcomPkgTokenSpaceGuid.PcdMaxFreqSupported|FALSE|BOOLEAN|0x0000A200 gQcomPkgTokenSpaceGuid.PcdHasLevel3Cache|FALSE|BOOLEAN|0x0000A201 - # USB Controller PCD + # Start USB Controller PCD gQcomPkgTokenSpaceGuid.PcdStartUsbController|FALSE|BOOLEAN|0x0000A300 - # SD Card Slot PCD - gQcomPkgTokenSpaceGuid.PcdSDCardSlotPresent|FALSE|BOOLEAN|0x0000A400 + # SD Card Init PCD + gQcomPkgTokenSpaceGuid.PcdInitCardSlot|FALSE|BOOLEAN|0x0000A400 # Power Services PCD gQcomPkgTokenSpaceGuid.PcdIsPowerOkImplemented|FALSE|BOOLEAN|0x0000A500 - # Slot Switch App PCD - gQcomPkgTokenSpaceGuid.PcdSlotSwitchApp|{ 0xB1, 0x0F, 0xBC, 0xD5, 0x33, 0xA8, 0x07, 0x46, 0xB7, 0xB6, 0x5E, 0xF9, 0xD1, 0x0B, 0xEE, 0xB7 }|VOID*|0x0000A600 diff --git a/Silicon/Qualcomm/QcomPkg/QcomPkg.dsc.inc b/Silicon/Qualcomm/QcomPkg/QcomPkg.dsc.inc index 1bf1c0ac0..1587c0b42 100644 --- a/Silicon/Qualcomm/QcomPkg/QcomPkg.dsc.inc +++ b/Silicon/Qualcomm/QcomPkg/QcomPkg.dsc.inc @@ -10,12 +10,17 @@ ## [BuildOptions] - *_*_*_CC_FLAGS = -DPLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA=$(PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA) -DPLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA=$(PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA) -DPLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA=$(PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA) -DPLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA=$(PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA) + *_*_*_CC_FLAGS = -DHAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA=$(HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA) -DHAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA=$(HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA) -DHAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA=$(HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA) -DHAS_PSCI_MEMPROTECT_FAILING_ERRATA=$(HAS_PSCI_MEMPROTECT_FAILING_ERRATA) [PcdsFixedAtBuild] # RAM Size (512 MB) gArmTokenSpaceGuid.PcdSystemMemorySize|0x20000000 +!if $(AB_SLOT_SUPPORT) == 1 + # Slot Switch App GUID + gSiliciumPkgTokenSpaceGuid.PcdSpecificApp|{ 0xB1, 0x0F, 0xBC, 0xD5, 0x33, 0xA8, 0x07, 0x46, 0xB7, 0xB6, 0x5E, 0xF9, 0xD1, 0x0B, 0xEE, 0xB7 } +!endif + [LibraryClasses] # Custom Libraries !if $(AB_SLOT_SUPPORT) == 1 @@ -23,25 +28,13 @@ !endif AslUpdateLib|QcomPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.inf RamPartitionTableLib|QcomPkg/Library/RamPartitionTableLib/RamPartitionTableLib.inf - PowerServicesLib|QcomPkg/Library/PowerServicesLib/PowerServicesLib.inf - BdsExtensionLib|QcomPkg/Library/BdsExtensionLib/BdsExtensionLib.inf - -[Components.AArch64] - # BDS - MdeModulePkg/Universal/BdsDxe/BdsDxe.inf { - - NULL|QcomPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.inf - } - -[Components.Arm] - # BDS - MdeModulePkg/Universal/BdsDxe/BdsDxe.inf [Components] # Custom Drivers QcomPkg/Drivers/ClockSpeedUpDxe/ClockSpeedUpDxe.inf QcomPkg/Drivers/DynamicRamDxe/DynamicRamDxe.inf QcomPkg/Drivers/DisplayReEnablerDxe/DisplayReEnablerDxe.inf + QcomPkg/Drivers/PeripheralInitDxe/PeripheralInitDxe.inf !if $(AB_SLOT_SUPPORT) == 1 QcomPkg/GPLDrivers/BootSlotDxe/BootSlotDxe.inf QcomPkg/GPLApplications/SwitchSlotsApp/SwitchSlotsApp.inf diff --git a/Silicon/Qualcomm/SDM660Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SDM660Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 86f6003b5..5b4173e89 100644 --- a/Silicon/Qualcomm/SDM660Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SDM660Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SDM660Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SDM660Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index fdffe9cce..dca34ccba 100644 --- a/Silicon/Qualcomm/SDM660Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SDM660Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SDM660Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SDM660Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..fd7924a50 100644 --- a/Silicon/Qualcomm/SDM660Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SDM660Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SDM660Pkg/SDM660Pkg.dsc.inc b/Silicon/Qualcomm/SDM660Pkg/SDM660Pkg.dsc.inc index 35ebcdf25..5ccfba849 100644 --- a/Silicon/Qualcomm/SDM660Pkg/SDM660Pkg.dsc.inc +++ b/Silicon/Qualcomm/SDM660Pkg/SDM660Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 1 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 1 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8-a+crypto+rcpc @@ -56,9 +59,6 @@ gArmPlatformTokenSpaceGuid.PcdClusterCount|2 gQcomPkgTokenSpaceGuid.PcdHasLevel3Cache|FALSE - # Power Services - gQcomPkgTokenSpaceGuid.PcdIsPowerOkImplemented|FALSE - # CPU Max Freq gQcomPkgTokenSpaceGuid.PcdMaxFreqSupported|FALSE diff --git a/Silicon/Qualcomm/SDM845Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SDM845Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 3425444fe..97fad34cd 100644 --- a/Silicon/Qualcomm/SDM845Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SDM845Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SDM845Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SDM845Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 78a5fed46..37221f2f4 100644 --- a/Silicon/Qualcomm/SDM845Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SDM845Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SDM845Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SDM845Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index e91158b7c..36a94697d 100644 --- a/Silicon/Qualcomm/SDM845Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SDM845Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SDM845Pkg/SDM845Pkg.dsc.inc b/Silicon/Qualcomm/SDM845Pkg/SDM845Pkg.dsc.inc index 9fe6def48..24d3f3ebe 100644 --- a/Silicon/Qualcomm/SDM845Pkg/SDM845Pkg.dsc.inc +++ b/Silicon/Qualcomm/SDM845Pkg/SDM845Pkg.dsc.inc @@ -11,16 +11,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 1 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 1 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8-a+crypto+rcpc @@ -48,8 +51,8 @@ gArmPlatformTokenSpaceGuid.PcdClusterCount|2 gQcomPkgTokenSpaceGuid.PcdHasLevel3Cache|FALSE - # Power Services - gQcomPkgTokenSpaceGuid.PcdIsPowerOkImplemented|FALSE + # CPU Max Freq + gQcomPkgTokenSpaceGuid.PcdMaxFreqSupported|TRUE [LibraryClasses] PlatformPeiLib|SDM845Pkg/Library/PlatformPeiLib/PlatformPeiLib.inf diff --git a/Silicon/Qualcomm/SM6115Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SM6115Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 63086cff9..c654cc3fd 100644 --- a/Silicon/Qualcomm/SM6115Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SM6115Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SM6115Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SM6115Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 2ba81c986..1235a33ca 100644 --- a/Silicon/Qualcomm/SM6115Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SM6115Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SM6115Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SM6115Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..fd7924a50 100644 --- a/Silicon/Qualcomm/SM6115Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SM6115Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SM6115Pkg/SM6115Pkg.dsc.inc b/Silicon/Qualcomm/SM6115Pkg/SM6115Pkg.dsc.inc index 436e13e1d..9afd53629 100644 --- a/Silicon/Qualcomm/SM6115Pkg/SM6115Pkg.dsc.inc +++ b/Silicon/Qualcomm/SM6115Pkg/SM6115Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 1 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 1 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8-a+crypto+rcpc @@ -48,9 +51,6 @@ gArmPlatformTokenSpaceGuid.PcdClusterCount|2 gQcomPkgTokenSpaceGuid.PcdHasLevel3Cache|FALSE - # Power Services - gQcomPkgTokenSpaceGuid.PcdIsPowerOkImplemented|TRUE - # CPU Max Freq gQcomPkgTokenSpaceGuid.PcdMaxFreqSupported|TRUE diff --git a/Silicon/Qualcomm/SM6125Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SM6125Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 63086cff9..c654cc3fd 100644 --- a/Silicon/Qualcomm/SM6125Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SM6125Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SM6125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SM6125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 2ba81c986..1235a33ca 100644 --- a/Silicon/Qualcomm/SM6125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SM6125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SM6125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SM6125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..fd7924a50 100644 --- a/Silicon/Qualcomm/SM6125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SM6125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SM6125Pkg/SM6125Pkg.dsc.inc b/Silicon/Qualcomm/SM6125Pkg/SM6125Pkg.dsc.inc index 6f897472e..1d0ad61eb 100644 --- a/Silicon/Qualcomm/SM6125Pkg/SM6125Pkg.dsc.inc +++ b/Silicon/Qualcomm/SM6125Pkg/SM6125Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 1 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 1 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8-a+crypto+rcpc @@ -48,9 +51,6 @@ gArmPlatformTokenSpaceGuid.PcdClusterCount|2 gQcomPkgTokenSpaceGuid.PcdHasLevel3Cache|FALSE - # Power Services - gQcomPkgTokenSpaceGuid.PcdIsPowerOkImplemented|TRUE - # CPU Max Freq gQcomPkgTokenSpaceGuid.PcdMaxFreqSupported|TRUE diff --git a/Silicon/Qualcomm/SM6225Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SM6225Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 3959115c2..ed6b51d4d 100644 --- a/Silicon/Qualcomm/SM6225Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SM6225Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SM6225Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SM6225Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index c39da5c85..d99e032c8 100644 --- a/Silicon/Qualcomm/SM6225Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SM6225Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SM6225Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SM6225Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..fd7924a50 100644 --- a/Silicon/Qualcomm/SM6225Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SM6225Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SM6225Pkg/SM6225Pkg.dsc.inc b/Silicon/Qualcomm/SM6225Pkg/SM6225Pkg.dsc.inc index d66dcc583..06df55500 100644 --- a/Silicon/Qualcomm/SM6225Pkg/SM6225Pkg.dsc.inc +++ b/Silicon/Qualcomm/SM6225Pkg/SM6225Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 1 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 1 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8-a+crypto+rcpc @@ -53,9 +56,6 @@ gArmPlatformTokenSpaceGuid.PcdClusterCount|2 gQcomPkgTokenSpaceGuid.PcdHasLevel3Cache|FALSE - # Power Services - gQcomPkgTokenSpaceGuid.PcdIsPowerOkImplemented|TRUE - # CPU Max Freq gQcomPkgTokenSpaceGuid.PcdMaxFreqSupported|TRUE diff --git a/Silicon/Qualcomm/SM7125Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SM7125Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index d09dd78b0..41a109d66 100644 --- a/Silicon/Qualcomm/SM7125Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SM7125Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SM7125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SM7125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index f19ad870a..d69a50762 100644 --- a/Silicon/Qualcomm/SM7125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SM7125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SM7125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SM7125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..fd7924a50 100644 --- a/Silicon/Qualcomm/SM7125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SM7125Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SM7125Pkg/SM7125Pkg.dsc.inc b/Silicon/Qualcomm/SM7125Pkg/SM7125Pkg.dsc.inc index 1424042ec..29174dfe3 100644 --- a/Silicon/Qualcomm/SM7125Pkg/SM7125Pkg.dsc.inc +++ b/Silicon/Qualcomm/SM7125Pkg/SM7125Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 1 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 1 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8.2-a+crypto+rcpc @@ -48,9 +51,6 @@ gArmPlatformTokenSpaceGuid.PcdClusterCount|2 gQcomPkgTokenSpaceGuid.PcdHasLevel3Cache|TRUE - # Power Services - gQcomPkgTokenSpaceGuid.PcdIsPowerOkImplemented|TRUE - # CPU Max Freq gQcomPkgTokenSpaceGuid.PcdMaxFreqSupported|TRUE diff --git a/Silicon/Qualcomm/SM7150Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SM7150Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 5d8ba4051..b62067bfa 100644 --- a/Silicon/Qualcomm/SM7150Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SM7150Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SM7150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SM7150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index f19ad870a..d69a50762 100644 --- a/Silicon/Qualcomm/SM7150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SM7150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SM7150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SM7150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..fd7924a50 100644 --- a/Silicon/Qualcomm/SM7150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SM7150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SM7150Pkg/SM7150Pkg.dsc.inc b/Silicon/Qualcomm/SM7150Pkg/SM7150Pkg.dsc.inc index bb19c98a3..c0df14df3 100644 --- a/Silicon/Qualcomm/SM7150Pkg/SM7150Pkg.dsc.inc +++ b/Silicon/Qualcomm/SM7150Pkg/SM7150Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 1 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 1 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8.2-a+crypto+rcpc @@ -56,9 +59,6 @@ gArmPlatformTokenSpaceGuid.PcdClusterCount|2 gQcomPkgTokenSpaceGuid.PcdHasLevel3Cache|TRUE - # Power Services - gQcomPkgTokenSpaceGuid.PcdIsPowerOkImplemented|TRUE - # CPU Max Freq gQcomPkgTokenSpaceGuid.PcdMaxFreqSupported|TRUE diff --git a/Silicon/Qualcomm/SM7325Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SM7325Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index c18654825..f563518ed 100644 --- a/Silicon/Qualcomm/SM7325Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SM7325Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SM7325Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SM7325Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 87f10614c..3d52e875d 100644 --- a/Silicon/Qualcomm/SM7325Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SM7325Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SM7325Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SM7325Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..fd7924a50 100644 --- a/Silicon/Qualcomm/SM7325Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SM7325Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SM7325Pkg/Library/PlatformPeiLib/PlatformPeiLib.c b/Silicon/Qualcomm/SM7325Pkg/Library/PlatformPeiLib/PlatformPeiLib.c index 346082973..4eeb942d3 100644 --- a/Silicon/Qualcomm/SM7325Pkg/Library/PlatformPeiLib/PlatformPeiLib.c +++ b/Silicon/Qualcomm/SM7325Pkg/Library/PlatformPeiLib/PlatformPeiLib.c @@ -198,7 +198,7 @@ InstallPlatformHob () BuildGuidDataHob (&gEfiShimLibraryHobGuid, &ShLibAddress, sizeof(ShLibAddress)); BuildGuidDataHob (&gFvDecompressHobGuid, &FvDecompressAddress, sizeof(FvDecompressAddress)); - if (PcdGet64(PcdScheduleInterfaceAddr) != 0) { + if (PcdGet64(PcdScheduleInterfaceAddr)) { UINTN SchedIntfAddress = PcdGet64(PcdScheduleInterfaceAddr); BuildGuidDataHob (&gEfiScheduleInterfaceHobGuid, &SchedIntfAddress, sizeof(SchedIntfAddress)); diff --git a/Silicon/Qualcomm/SM7325Pkg/SM7325Pkg.dsc.inc b/Silicon/Qualcomm/SM7325Pkg/SM7325Pkg.dsc.inc index f79144e98..5f190b489 100644 --- a/Silicon/Qualcomm/SM7325Pkg/SM7325Pkg.dsc.inc +++ b/Silicon/Qualcomm/SM7325Pkg/SM7325Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 0 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 0 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 1 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 1 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 1 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 1 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8.2-a+crypto+rcpc @@ -56,9 +59,6 @@ gArmPlatformTokenSpaceGuid.PcdClusterCount|3 gQcomPkgTokenSpaceGuid.PcdHasLevel3Cache|TRUE - # Power Services - gQcomPkgTokenSpaceGuid.PcdIsPowerOkImplemented|TRUE - # CPU Max Freq gQcomPkgTokenSpaceGuid.PcdMaxFreqSupported|TRUE diff --git a/Silicon/Qualcomm/SM7475Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SM7475Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 26dd8794b..646ce2981 100644 --- a/Silicon/Qualcomm/SM7475Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SM7475Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SM7475Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SM7475Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 3dfcc3a2f..7a8e80016 100644 --- a/Silicon/Qualcomm/SM7475Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SM7475Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SM7475Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SM7475Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..fd7924a50 100644 --- a/Silicon/Qualcomm/SM7475Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SM7475Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SM7475Pkg/Library/PlatformPeiLib/PlatformPeiLib.c b/Silicon/Qualcomm/SM7475Pkg/Library/PlatformPeiLib/PlatformPeiLib.c index b8609b44f..c8da46c4b 100644 --- a/Silicon/Qualcomm/SM7475Pkg/Library/PlatformPeiLib/PlatformPeiLib.c +++ b/Silicon/Qualcomm/SM7475Pkg/Library/PlatformPeiLib/PlatformPeiLib.c @@ -202,12 +202,16 @@ InstallPlatformHob () BuildGuidDataHob (&gFvDecompressHobGuid, &FvDecompressAddress, sizeof(FvDecompressAddress)); BuildGuidDataHob (&gEfiProdmodeHobGuid, &Prodmode, sizeof(Prodmode)); - if (PcdGet64(PcdScheduleInterfaceAddr) != 0 && PcdGet64(PcdDTBExtensionAddr) != 0) { - EFI_KERNEL_PROTOCOL *SchedIntf = (VOID *)PcdGet64(PcdScheduleInterfaceAddr); + if (PcdGet64(PcdScheduleInterfaceAddr)) { + EFI_KERNEL_PROTOCOL *SchedIntf = (VOID *)PcdGet64(PcdScheduleInterfaceAddr); + + BuildGuidDataHob (&gEfiScheduleInterfaceHobGuid, &SchedIntf, sizeof(SchedIntf)); + } + + if (PcdGet64(PcdDTBExtensionAddr)) { EFI_DTB_EXTN_PROTOCOL *DTBExtnProtocol = (VOID *)PcdGet64(PcdDTBExtensionAddr); - BuildGuidDataHob (&gEfiScheduleInterfaceHobGuid, &SchedIntf, sizeof(SchedIntf)); - BuildGuidDataHob (&gEfiDTBExtnHobGuid, &DTBExtnProtocol, sizeof(DTBExtnProtocol)); + BuildGuidDataHob (&gEfiDTBExtnHobGuid, &DTBExtnProtocol, sizeof(DTBExtnProtocol)); } } diff --git a/Silicon/Qualcomm/SM7475Pkg/SM7475Pkg.dsc.inc b/Silicon/Qualcomm/SM7475Pkg/SM7475Pkg.dsc.inc index a42171a2e..5ecfd0660 100644 --- a/Silicon/Qualcomm/SM7475Pkg/SM7475Pkg.dsc.inc +++ b/Silicon/Qualcomm/SM7475Pkg/SM7475Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 0 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 0 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 1 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 1 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 # TODO: Replace this with working one #[BuildOptions] @@ -49,9 +52,6 @@ gArmPlatformTokenSpaceGuid.PcdClusterCount|3 gQcomPkgTokenSpaceGuid.PcdHasLevel3Cache|TRUE - # Power Services - gQcomPkgTokenSpaceGuid.PcdIsPowerOkImplemented|TRUE - # CPU Max Freq gQcomPkgTokenSpaceGuid.PcdMaxFreqSupported|TRUE diff --git a/Silicon/Qualcomm/SM8150Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SM8150Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index c09cbd91f..1d4ad8d70 100644 --- a/Silicon/Qualcomm/SM8150Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SM8150Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SM8150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SM8150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index d127a4683..fb1f7d312 100644 --- a/Silicon/Qualcomm/SM8150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SM8150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SM8150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SM8150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..fd7924a50 100644 --- a/Silicon/Qualcomm/SM8150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SM8150Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SM8150Pkg/SM8150Pkg.dsc.inc b/Silicon/Qualcomm/SM8150Pkg/SM8150Pkg.dsc.inc index d7538031b..8013a8534 100644 --- a/Silicon/Qualcomm/SM8150Pkg/SM8150Pkg.dsc.inc +++ b/Silicon/Qualcomm/SM8150Pkg/SM8150Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 0 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 0 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8.2-a+crypto+rcpc diff --git a/Silicon/Qualcomm/SM8250Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SM8250Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 5a2aa11b3..c86ec64fb 100644 --- a/Silicon/Qualcomm/SM8250Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SM8250Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SM8250Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SM8250Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 7b6e232d5..a9b917aa1 100644 --- a/Silicon/Qualcomm/SM8250Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SM8250Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SM8250Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SM8250Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..fd7924a50 100644 --- a/Silicon/Qualcomm/SM8250Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SM8250Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SM8250Pkg/SM8250Pkg.dsc.inc b/Silicon/Qualcomm/SM8250Pkg/SM8250Pkg.dsc.inc index 01ae33392..cdd9898bb 100644 --- a/Silicon/Qualcomm/SM8250Pkg/SM8250Pkg.dsc.inc +++ b/Silicon/Qualcomm/SM8250Pkg/SM8250Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 0 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 0 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 1 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8.2-a+crypto+rcpc diff --git a/Silicon/Qualcomm/SM8350Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SM8350Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 8824db00e..8a3df436f 100644 --- a/Silicon/Qualcomm/SM8350Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SM8350Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SM8350Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SM8350Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 94d5e036e..8b29a4df6 100644 --- a/Silicon/Qualcomm/SM8350Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SM8350Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SM8350Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SM8350Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..fd7924a50 100644 --- a/Silicon/Qualcomm/SM8350Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SM8350Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SM8350Pkg/Library/PlatformPeiLib/PlatformPeiLib.c b/Silicon/Qualcomm/SM8350Pkg/Library/PlatformPeiLib/PlatformPeiLib.c index 346082973..4eeb942d3 100644 --- a/Silicon/Qualcomm/SM8350Pkg/Library/PlatformPeiLib/PlatformPeiLib.c +++ b/Silicon/Qualcomm/SM8350Pkg/Library/PlatformPeiLib/PlatformPeiLib.c @@ -198,7 +198,7 @@ InstallPlatformHob () BuildGuidDataHob (&gEfiShimLibraryHobGuid, &ShLibAddress, sizeof(ShLibAddress)); BuildGuidDataHob (&gFvDecompressHobGuid, &FvDecompressAddress, sizeof(FvDecompressAddress)); - if (PcdGet64(PcdScheduleInterfaceAddr) != 0) { + if (PcdGet64(PcdScheduleInterfaceAddr)) { UINTN SchedIntfAddress = PcdGet64(PcdScheduleInterfaceAddr); BuildGuidDataHob (&gEfiScheduleInterfaceHobGuid, &SchedIntfAddress, sizeof(SchedIntfAddress)); diff --git a/Silicon/Qualcomm/SM8350Pkg/SM8350Pkg.dsc.inc b/Silicon/Qualcomm/SM8350Pkg/SM8350Pkg.dsc.inc index f281a3a42..942125a74 100644 --- a/Silicon/Qualcomm/SM8350Pkg/SM8350Pkg.dsc.inc +++ b/Silicon/Qualcomm/SM8350Pkg/SM8350Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 0 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 0 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 1 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 1 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 1 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 1 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8.2-a+crypto+rcpc diff --git a/Silicon/Qualcomm/SM8450Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Qualcomm/SM8450Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 26dd8794b..646ce2981 100644 --- a/Silicon/Qualcomm/SM8450Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Qualcomm/SM8450Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Qualcomm/SM8450Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Qualcomm/SM8450Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 3dfcc3a2f..7a8e80016 100644 --- a/Silicon/Qualcomm/SM8450Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Qualcomm/SM8450Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -123,9 +124,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Qualcomm/SM8450Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Qualcomm/SM8450Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4e5f07230..fd7924a50 100644 --- a/Silicon/Qualcomm/SM8450Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Qualcomm/SM8450Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -28,8 +28,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -37,6 +35,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Qualcomm/SM8450Pkg/Library/PlatformPeiLib/PlatformPeiLib.c b/Silicon/Qualcomm/SM8450Pkg/Library/PlatformPeiLib/PlatformPeiLib.c index b8609b44f..c8da46c4b 100644 --- a/Silicon/Qualcomm/SM8450Pkg/Library/PlatformPeiLib/PlatformPeiLib.c +++ b/Silicon/Qualcomm/SM8450Pkg/Library/PlatformPeiLib/PlatformPeiLib.c @@ -202,12 +202,16 @@ InstallPlatformHob () BuildGuidDataHob (&gFvDecompressHobGuid, &FvDecompressAddress, sizeof(FvDecompressAddress)); BuildGuidDataHob (&gEfiProdmodeHobGuid, &Prodmode, sizeof(Prodmode)); - if (PcdGet64(PcdScheduleInterfaceAddr) != 0 && PcdGet64(PcdDTBExtensionAddr) != 0) { - EFI_KERNEL_PROTOCOL *SchedIntf = (VOID *)PcdGet64(PcdScheduleInterfaceAddr); + if (PcdGet64(PcdScheduleInterfaceAddr)) { + EFI_KERNEL_PROTOCOL *SchedIntf = (VOID *)PcdGet64(PcdScheduleInterfaceAddr); + + BuildGuidDataHob (&gEfiScheduleInterfaceHobGuid, &SchedIntf, sizeof(SchedIntf)); + } + + if (PcdGet64(PcdDTBExtensionAddr)) { EFI_DTB_EXTN_PROTOCOL *DTBExtnProtocol = (VOID *)PcdGet64(PcdDTBExtensionAddr); - BuildGuidDataHob (&gEfiScheduleInterfaceHobGuid, &SchedIntf, sizeof(SchedIntf)); - BuildGuidDataHob (&gEfiDTBExtnHobGuid, &DTBExtnProtocol, sizeof(DTBExtnProtocol)); + BuildGuidDataHob (&gEfiDTBExtnHobGuid, &DTBExtnProtocol, sizeof(DTBExtnProtocol)); } } diff --git a/Silicon/Qualcomm/SM8450Pkg/SM8450Pkg.dsc.inc b/Silicon/Qualcomm/SM8450Pkg/SM8450Pkg.dsc.inc index c69a13a64..7058a1e5e 100644 --- a/Silicon/Qualcomm/SM8450Pkg/SM8450Pkg.dsc.inc +++ b/Silicon/Qualcomm/SM8450Pkg/SM8450Pkg.dsc.inc @@ -9,16 +9,19 @@ ## [Defines] + # GIC + USE_CUSTOM_GIC = 0 + # Timer - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 0 + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 0 # KEP - PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 1 - PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 - PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 - PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 + ENABLE_KEP = 1 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 1 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 # TODO: Replace this with working one #[BuildOptions] diff --git a/Silicon/Samsung/E7885Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Samsung/E7885Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 8e7f05f8d..8b02d4b00 100644 --- a/Silicon/Samsung/E7885Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Samsung/E7885Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Samsung/E7885Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Samsung/E7885Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 9add1078e..e70570c7d 100644 --- a/Silicon/Samsung/E7885Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Samsung/E7885Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -122,9 +123,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Samsung/E7885Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Samsung/E7885Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4111b4e43..55b31a79b 100644 --- a/Silicon/Samsung/E7885Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Samsung/E7885Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -26,8 +26,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -35,6 +33,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Samsung/E7885Pkg/E7885Pkg.dsc.inc b/Silicon/Samsung/E7885Pkg/E7885Pkg.dsc.inc index 983dbe391..d9788b158 100644 --- a/Silicon/Samsung/E7885Pkg/E7885Pkg.dsc.inc +++ b/Silicon/Samsung/E7885Pkg/E7885Pkg.dsc.inc @@ -9,9 +9,19 @@ ## [Defines] - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 0 + # GIC + USE_CUSTOM_GIC = 0 + + # Timer + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 0 + + # KEP + ENABLE_KEP = 0 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8.2-a+crypto+rcpc diff --git a/Silicon/Samsung/E9810Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Samsung/E9810Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index c89ce81f9..65ee4ad7b 100644 --- a/Silicon/Samsung/E9810Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Samsung/E9810Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Samsung/E9810Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Samsung/E9810Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index 76070ce24..a10cc33d9 100644 --- a/Silicon/Samsung/E9810Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Samsung/E9810Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -122,9 +123,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Samsung/E9810Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Samsung/E9810Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4111b4e43..55b31a79b 100644 --- a/Silicon/Samsung/E9810Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Samsung/E9810Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -26,8 +26,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -35,6 +33,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Samsung/E9810Pkg/E9810Pkg.dsc.inc b/Silicon/Samsung/E9810Pkg/E9810Pkg.dsc.inc index 779f1c1c5..f6124f8ec 100644 --- a/Silicon/Samsung/E9810Pkg/E9810Pkg.dsc.inc +++ b/Silicon/Samsung/E9810Pkg/E9810Pkg.dsc.inc @@ -9,9 +9,19 @@ ## [Defines] - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 1 + # GIC + USE_CUSTOM_GIC = 0 + + # Timer + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 1 + + # KEP + ENABLE_KEP = 0 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8.2-a+crypto+rcpc diff --git a/Silicon/Samsung/E9820Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Samsung/E9820Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index 2b99e1059..3a202a9c1 100644 --- a/Silicon/Samsung/E9820Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Samsung/E9820Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Samsung/E9820Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Samsung/E9820Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index bbfd9c288..5110194f3 100644 --- a/Silicon/Samsung/E9820Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Samsung/E9820Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -122,9 +123,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Samsung/E9820Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Samsung/E9820Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4111b4e43..55b31a79b 100644 --- a/Silicon/Samsung/E9820Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Samsung/E9820Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -26,8 +26,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -35,6 +33,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Samsung/E9820Pkg/E9820Pkg.dsc.inc b/Silicon/Samsung/E9820Pkg/E9820Pkg.dsc.inc index e2b5d07a8..eeca02269 100644 --- a/Silicon/Samsung/E9820Pkg/E9820Pkg.dsc.inc +++ b/Silicon/Samsung/E9820Pkg/E9820Pkg.dsc.inc @@ -9,9 +9,19 @@ ## [Defines] - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 1 + # GIC + USE_CUSTOM_GIC = 0 + + # Timer + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 1 + + # KEP + ENABLE_KEP = 0 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8.2-a+crypto+rcpc diff --git a/Silicon/Samsung/E9830Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h b/Silicon/Samsung/E9830Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h index b14c6141f..5c783f1c4 100644 --- a/Silicon/Samsung/E9830Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h +++ b/Silicon/Samsung/E9830Pkg/Drivers/SmBiosTableDxe/DataDefinitions.h @@ -111,7 +111,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = { CHAR8 *mBIOSInfoType0Strings[] = { "Not Specified", // Vendor String - "Not Specified", // BiosVersion String + "2.7", // BiosVersion String __DATE__, // BiosReleaseDate String NULL }; diff --git a/Silicon/Samsung/E9830Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c b/Silicon/Samsung/E9830Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c index a3adbb688..66e5f7f54 100644 --- a/Silicon/Samsung/E9830Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c +++ b/Silicon/Samsung/E9830Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -122,9 +123,16 @@ LogSmbiosData ( VOID BIOSInfoUpdateSmbiosType0 () { + CHAR8 FirmwareVendor[100] = ""; + + // Give Space to FirmwareVendor Variable + ZeroMem (FirmwareVendor, 100); + + // Append Device Maintainer + AsciiSPrint (FirmwareVendor, sizeof(FirmwareVendor), "Project Silicium & %a", FixedPcdGetPtr(PcdDeviceMaintainer)); + // Update String Table - mBIOSInfoType0Strings[0] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVendor); - mBIOSInfoType0Strings[1] = (CHAR8 *)FixedPcdGetPtr(PcdFirmwareVersionString); + mBIOSInfoType0Strings[0] = FirmwareVendor; LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings, NULL); } diff --git a/Silicon/Samsung/E9830Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf b/Silicon/Samsung/E9830Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf index 4111b4e43..55b31a79b 100644 --- a/Silicon/Samsung/E9830Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf +++ b/Silicon/Samsung/E9830Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf @@ -26,8 +26,6 @@ [FixedPcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemVendor gSiliciumPkgTokenSpaceGuid.PcdSmbiosProcessorModel @@ -35,6 +33,7 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailModel gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Protocols] gEfiSmbiosProtocolGuid diff --git a/Silicon/Samsung/E9830Pkg/E9830Pkg.dsc.inc b/Silicon/Samsung/E9830Pkg/E9830Pkg.dsc.inc index 24d920759..b6a432d7a 100644 --- a/Silicon/Samsung/E9830Pkg/E9830Pkg.dsc.inc +++ b/Silicon/Samsung/E9830Pkg/E9830Pkg.dsc.inc @@ -9,9 +9,19 @@ ## [Defines] - USE_CUSTOM_GIC = 0 - USE_CUSTOM_TIMER = 0 - USE_PHYSICAL_TIMER = 0 + # GIC + USE_CUSTOM_GIC = 0 + + # Timer + USE_CUSTOM_TIMER = 0 + USE_PHYSICAL_TIMER = 0 + + # KEP + ENABLE_KEP = 0 + HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA = 0 + HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA = 0 + HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA = 0 + HAS_PSCI_MEMPROTECT_FAILING_ERRATA = 0 [BuildOptions] *_*_AARCH64_CC_FLAGS = -march=armv8.2-a+crypto+rcpc diff --git a/Silicon/Samsung/SamsungPkg/Library/BdsExtensionLib/BdsExtensionLib.c b/Silicon/Samsung/SamsungPkg/Library/BdsExtensionLib/BdsExtensionLib.c deleted file mode 100644 index 4b9e8ef1c..000000000 --- a/Silicon/Samsung/SamsungPkg/Library/BdsExtensionLib/BdsExtensionLib.c +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -VOID -BdsExtensionAfterConsole () -{ - EFI_STATUS Status; - EFI_GRAPHICS_OUTPUT_PROTOCOL *mConsoleOutHandle; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL Black; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL White; - - // Locate Console Out Handle - Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID *)&mConsoleOutHandle); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "%a: Failed to Locate Console Out Protocol! Status %r\n", __FUNCTION__, Status)); - } else { - // Combo Message - CHAR16 *ComboMessage = L"[Volume Up] UEFI Menu"; - - // Set Pos for Combo Message - UINTN XPos = (mConsoleOutHandle->Mode->Info->HorizontalResolution - StrLen(ComboMessage) * EFI_GLYPH_WIDTH) / 2; - UINTN YPos = (mConsoleOutHandle->Mode->Info->VerticalResolution - EFI_GLYPH_HEIGHT) * 48 / 50; - - // Set Color for the Message - Black.Blue = Black.Green = Black.Red = Black.Reserved = 0; - White.Blue = White.Green = White.Red = White.Reserved = 0xFF; - - // Display Combo Message - PrintXY (XPos, YPos, &White, &Black, ComboMessage); - } -} - -VOID -BdsExtensionPlatformConnectList () {} - -EFI_STATUS -EFIAPI -BdsExtensionPriorityBoot (EFI_BOOT_MANAGER_LOAD_OPTION *BootOption) -{ - EFI_STATUS Status = EFI_SUCCESS; - BOOLEAN FrontPageBoot = MsBootPolicyLibIsVolumeUp (); - - MsBootPolicyLibClearBootRequests (); - - // - // There are four cases: - // 1. Nothing pressed. - Return EFI_NOT_FOUND. - // 2. FrontPageBoot - Load FrontPage. - // - - if (FrontPageBoot) { - Status = MsBootOptionsLibGetBootManagerMenu (BootOption, "VOL+"); - SetRebootReason (OEM_REBOOT_TO_SETUP_KEY); - } else { - Status = EFI_NOT_FOUND; - } - - return Status; -} diff --git a/Silicon/Samsung/SamsungPkg/Library/BdsExtensionLib/BdsExtensionLib.inf b/Silicon/Samsung/SamsungPkg/Library/BdsExtensionLib/BdsExtensionLib.inf deleted file mode 100644 index ee6b5dad3..000000000 --- a/Silicon/Samsung/SamsungPkg/Library/BdsExtensionLib/BdsExtensionLib.inf +++ /dev/null @@ -1,27 +0,0 @@ -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = BdsExtensionLib - FILE_GUID = 00EF5892-29B0-4D6A-BE06-754BD319FB08 - VERSION_STRING = 1.0 - MODULE_TYPE = DXE_DRIVER - LIBRARY_CLASS = BdsExtensionLib|DXE_DRIVER - -[Sources] - BdsExtensionLib.c - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - MsCorePkg/MsCorePkg.dec - PcBdsPkg/PcBdsPkg.dec - SiliciumPkg/SiliciumPkg.dec - -[LibraryClasses] - DebugLib - MsBootPolicyLib - MsBootOptionsLib - UefiRuntimeServicesTableLib - MsNVBootReasonLib - UefiBootServicesTableLib - DeviceBootManagerLib - UefiLib diff --git a/Silicon/Samsung/SamsungPkg/SamsungPkg.dsc.inc b/Silicon/Samsung/SamsungPkg/SamsungPkg.dsc.inc index ac8a2c56e..a7961a886 100644 --- a/Silicon/Samsung/SamsungPkg/SamsungPkg.dsc.inc +++ b/Silicon/Samsung/SamsungPkg/SamsungPkg.dsc.inc @@ -9,15 +9,7 @@ # ## -[LibraryClasses] - # Custom Libraries - PowerServicesLib|PcBdsPkg/Library/PowerServicesLibNull/PowerServicesLibNull.inf - BdsExtensionLib|SamsungPkg/Library/BdsExtensionLib/BdsExtensionLib.inf - [Components] - # BDS - MdeModulePkg/Universal/BdsDxe/BdsDxe.inf - # Custom Drivers SamsungPkg/Drivers/ExynosGpioDxe/ExynosGpioDxe.inf SamsungPkg/Drivers/ExynosSpeedyDxe/ExynosSpeedyDxe.inf diff --git a/Silicon/Silicium/SiliciumPkg/Applications/FrontPage/FrontPage.c b/Silicon/Silicium/SiliciumPkg/Applications/FrontPage/FrontPage.c index 9c6e1c832..e3b3e8d10 100644 --- a/Silicon/Silicium/SiliciumPkg/Applications/FrontPage/FrontPage.c +++ b/Silicon/Silicium/SiliciumPkg/Applications/FrontPage/FrontPage.c @@ -261,12 +261,6 @@ UpdateDisplayStrings ( SMBIOS_TABLE_TYPE3 *Type3Record; SMBIOS_TABLE_TYPE4 *Type4Record; - // Get UEFI Version Value - HiiSetString (HiiHandle, STRING_TOKEN (STR_INF_VIEW_UEFI_VERSION_VALUE), (CHAR16 *)PcdGetPtr(PcdFirmwareVersionString), NULL); - - // Get Device Maintainer Value - HiiSetString (HiiHandle, STRING_TOKEN (STR_INF_VIEW_DEVICE_MAINTAINER_VALUE), (CHAR16 *)PcdGetPtr(PcdFirmwareVendor), NULL); - Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **)&SmbiosProtocol); if (EFI_ERROR (Status)) { DEBUG ((EFI_D_ERROR, "Could not locate SMBIOS protocol. %r\n", Status)); @@ -279,6 +273,18 @@ UpdateDisplayStrings ( if (!EFI_ERROR (Status)) { Type0Record = (SMBIOS_TABLE_TYPE0 *)Record; + Status = GetOptionalStringByIndex ((CHAR8 *)((UINT8 *)Type0Record + Type0Record->Hdr.Length), Type0Record->Vendor, &NewString); + if (!EFI_ERROR (Status)) { + HiiSetString (HiiHandle, STRING_TOKEN (STR_INF_VIEW_DEVICE_MAINTAINER_VALUE), NewString, NULL); + FreePool (NewString); + } + + Status = GetOptionalStringByIndex ((CHAR8 *)((UINT8 *)Type0Record + Type0Record->Hdr.Length), Type0Record->BiosVersion, &NewString); + if (!EFI_ERROR (Status)) { + HiiSetString (HiiHandle, STRING_TOKEN (STR_INF_VIEW_UEFI_VERSION_VALUE), NewString, NULL); + FreePool (NewString); + } + Status = GetOptionalStringByIndex ((CHAR8 *)((UINT8 *)Type0Record + Type0Record->Hdr.Length), Type0Record->BiosReleaseDate, &NewString); if (!EFI_ERROR (Status)) { HiiSetString (HiiHandle, STRING_TOKEN (STR_INF_VIEW_UEFI_BUILD_DATE_VALUE), NewString, NULL); diff --git a/Silicon/Silicium/SiliciumPkg/Applications/FrontPage/FrontPage.inf b/Silicon/Silicium/SiliciumPkg/Applications/FrontPage/FrontPage.inf index f5e23e540..affca27cb 100644 --- a/Silicon/Silicium/SiliciumPkg/Applications/FrontPage/FrontPage.inf +++ b/Silicon/Silicium/SiliciumPkg/Applications/FrontPage/FrontPage.inf @@ -37,6 +37,7 @@ DfciPkg/DfciPkg.dec MsWheaPkg/MsWheaPkg.dec SecurityPkg/SecurityPkg.dec + SiliciumPkg/SiliciumPkg.dec [LibraryClasses] BaseLib @@ -114,8 +115,7 @@ gMsGraphicsPkgTokenSpaceGuid.PcdCurrentPointerState gDfciPkgTokenSpaceGuid.PcdSetupUiReducedFunction gDfciPkgTokenSpaceGuid.PcdDfciEnabled - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer [Depex] TRUE diff --git a/Silicon/Silicium/SiliciumPkg/Frontpage.dsc.inc b/Silicon/Silicium/SiliciumPkg/Frontpage.dsc.inc index aee0d3d5e..618892243 100644 --- a/Silicon/Silicium/SiliciumPkg/Frontpage.dsc.inc +++ b/Silicon/Silicium/SiliciumPkg/Frontpage.dsc.inc @@ -30,6 +30,11 @@ # ThermalServicesLib|PcBdsPkg/Library/ThermalServicesLibNull/ThermalServicesLibNull.inf + # + # Null Power Services Library class to support Platforms that dont have battery + # + PowerServicesLib|PcBdsPkg/Library/PowerServicesLibNull/PowerServicesLibNull.inf + # # Empty Platform Library of power check. # @@ -132,8 +137,8 @@ gMsGraphicsPkgTokenSpaceGuid.PcdUiThemeInDxe|TRUE - gOemPkgTokenSpaceGuid.PcdUefiVersionNumber|0x0000026 - gOemPkgTokenSpaceGuid.PcdUefiBuildDate|0x20240505 + gOemPkgTokenSpaceGuid.PcdUefiVersionNumber|0x0000027 + gOemPkgTokenSpaceGuid.PcdUefiBuildDate|0x20240622 gOemPkgTokenSpaceGuid.PcdPostBackgroundColor|0x0 diff --git a/Silicon/Silicium/SiliciumPkg/Library/DeviceBootManagerLib/DeviceBootManagerLib.c b/Silicon/Silicium/SiliciumPkg/Library/DeviceBootManagerLib/DeviceBootManagerLib.c index 66e78db27..c5fe14aad 100644 --- a/Silicon/Silicium/SiliciumPkg/Library/DeviceBootManagerLib/DeviceBootManagerLib.c +++ b/Silicon/Silicium/SiliciumPkg/Library/DeviceBootManagerLib/DeviceBootManagerLib.c @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -306,13 +305,6 @@ EnableOSK () } } -/** - Pre Ready to Boot Callback to Lock BDS Variables. - - @param Event - Event whose Notification Function is being Invoked. - @param Context - The Pointer to the Notification Function's Context, - which is Implementation-dependent. -**/ STATIC VOID EFIAPI @@ -326,13 +318,6 @@ PreReadyToBoot ( gBS->CloseEvent (Event); } -/** - Post Ready to Boot Callback to Update FACS Hardware Signature. - - @param Event - Event whose Notification Function is being Invoked. - @param Context - The Pointer to the Notification Function's Context, - which is Implementation-dependent. -**/ STATIC VOID EFIAPI @@ -343,11 +328,6 @@ PostReadyToBoot ( // Do Nothing } -/** - This runs when BdsDxe is Loaded, Before BdsArch Protocol is Published. - - @return - EFI_SUCCESS -**/ EFI_STATUS EFIAPI DeviceBootManagerConstructor ( @@ -405,7 +385,8 @@ EFI_DEVICE_PATH_PROTOCOL** EFIAPI DeviceBootManagerAfterConsole () { - EFI_STATUS Status; + EFI_STATUS Status; + EFI_GRAPHICS_OUTPUT_PROTOCOL *mConsoleOutHandle; // Check if System is Good to Go MsPreBootChecks (); @@ -419,8 +400,41 @@ DeviceBootManagerAfterConsole () DEBUG ((EFI_D_ERROR, "%a: Failed to Display Boot Logo! Status = %r\n", __FUNCTION__, Status)); } - // Run SoC Specific After Console Function - BdsExtensionAfterConsole (); + // Locate Console Out Handle + Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID *)&mConsoleOutHandle); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "%a: Failed to Locate Console Out Protocol! Status %r\n", __FUNCTION__, Status)); + } else { + EFI_GRAPHICS_OUTPUT_BLT_PIXEL Black; + EFI_GRAPHICS_OUTPUT_BLT_PIXEL White; + CHAR16 *ComboMessage; + + // Combo Message + if (PcdGetPtr(PcdSpecificApp) == "NULL") { +#if HAS_BUILD_IN_KEYBOARD == 1 + ComboMessage = L"[Escape] UEFI Menu"; +#else + ComboMessage = L"[Volume Up] UEFI Menu"; +#endif + } else { +#if HAS_BUILD_IN_KEYBOARD == 1 + ComboMessage = L"[Escape] UEFI Menu - [Delete] SoC Specific App"; +#else + ComboMessage = L"[Volume Up] UEFI Menu - [Volume Down] SoC Specific App"; +#endif + } + + // Set Pos for Combo Message + UINTN XPos = (mConsoleOutHandle->Mode->Info->HorizontalResolution - StrLen(ComboMessage) * EFI_GLYPH_WIDTH) / 2; + UINTN YPos = (mConsoleOutHandle->Mode->Info->VerticalResolution - EFI_GLYPH_HEIGHT) * 48 / 50; + + // Set Color for the Message + Black.Blue = Black.Green = Black.Red = Black.Reserved = 0; + White.Blue = White.Green = White.Red = White.Reserved = 0xFF; + + // Display Combo Message + PrintXY (XPos, YPos, &White, &Black, ComboMessage); + } return GetPlatformConnectList (); } @@ -462,18 +476,33 @@ DeviceBootManagerProcessBootCompletion (IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOpt } } -/** - Check for Pressed Keys during Boot. - - @param BootOption - Boot Option Filled in, Based on which Key is Pressed. - - @return Status - The EFI_STATUS returned by this Function. -**/ EFI_STATUS EFIAPI DeviceBootManagerPriorityBoot (EFI_BOOT_MANAGER_LOAD_OPTION *BootOption) { - return BdsExtensionPriorityBoot (BootOption); + EFI_STATUS Status = EFI_SUCCESS; + BOOLEAN FrontPageBoot = MsBootPolicyLibIsSettingsBoot (); + BOOLEAN SpecificApp = MsBootPolicyLibIsAltBoot (); + + MsBootPolicyLibClearBootRequests (); + + // + // There are four cases: + // 1. Nothing pressed. - Return EFI_NOT_FOUND. + // 2. FrontPageBoot - Load FrontPage. + // 3. SpecificApp - Load SoC Specific App. + // + + if (SpecificApp) { + Status = MsBootOptionsLibGetDefaultBootApp (BootOption, "VOL-"); + } else if (FrontPageBoot) { + Status = MsBootOptionsLibGetBootManagerMenu (BootOption, "VOL+"); + SetRebootReason (OEM_REBOOT_TO_SETUP_KEY); + } else { + Status = EFI_NOT_FOUND; + } + + return Status; } VOID diff --git a/Silicon/Silicium/SiliciumPkg/Library/DeviceBootManagerLib/DeviceBootManagerLib.inf b/Silicon/Silicium/SiliciumPkg/Library/DeviceBootManagerLib/DeviceBootManagerLib.inf index 92ea444f1..cbbdc4159 100644 --- a/Silicon/Silicium/SiliciumPkg/Library/DeviceBootManagerLib/DeviceBootManagerLib.inf +++ b/Silicon/Silicium/SiliciumPkg/Library/DeviceBootManagerLib/DeviceBootManagerLib.inf @@ -43,7 +43,6 @@ MsNVBootReasonLib BootGraphicsLib GraphicsConsoleHelperLib - BdsExtensionLib [Guids] gMsStartOfBdsNotifyGuid @@ -60,6 +59,7 @@ gPcBdsPkgTokenSpaceGuid.PcdPowerAndThermalRetries gPcBdsPkgTokenSpaceGuid.PcdShutdownGraphicDisplayTime gPcBdsPkgTokenSpaceGuid.PcdThermalControlRetryWait + gSiliciumPkgTokenSpaceGuid.PcdSpecificApp [Depex] TRUE diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.c b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.c similarity index 96% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.c rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.c index 428ca6e4c..61becc52f 100644 --- a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.c +++ b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.c @@ -17,10 +17,10 @@ STATIC EFI_EXIT_BOOT_SERVICES mOriginalEfiExitBootServices = NULL; EFI_EVENT mReadyToBootEvent; -#if PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA == 0 -#if PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA == 0 -#if PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA == 0 -#if PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA == 0 +#if HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA == 0 +#if HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA == 0 +#if HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA == 0 +#if HAS_PSCI_MEMPROTECT_FAILING_ERRATA == 0 #error "No errata to patch" #endif #endif @@ -29,7 +29,7 @@ EFI_EVENT mReadyToBootEvent; // Please see ./ShellCode/Reference/ShellCode.c for what this does UINT8 OslArm64TransferToKernelShellCode[] = { - #if PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA == 1 + #if HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA == 1 // ACTLR_EL1 0xEB, 0x03, 0x00, 0xAA, 0x68, 0x0D, 0x41, 0xF8, 0x1F, 0x01, 0x0B, 0xEB, 0x20, 0x04, 0x00, 0x54, 0x06, 0x05, 0x82, 0x52, 0x06, 0xA7, 0xBA, 0x72, @@ -45,7 +45,7 @@ UINT8 OslArm64TransferToKernelShellCode[] = { 0xF8, 0xFF, 0xFF, 0x17, 0x00, 0x00, 0x00, 0x14, 0x1F, 0x20, 0x03, 0xD5, #endif -#if PLATFORM_HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA == 1 +#if HAS_AMCNTENSET0_EL0_UNIMPLEMENTED_ERRATA == 1 // AMCNTENSET0_EL0 0xE8, 0x03, 0x00, 0xAA, 0x06, 0x0D, 0x41, 0xF8, 0xDF, 0x00, 0x08, 0xEB, 0x20, 0x03, 0x00, 0x54, 0x05, 0x55, 0x9A, 0x52, 0x65, 0xA7, 0xBA, 0x72, @@ -59,7 +59,7 @@ UINT8 OslArm64TransferToKernelShellCode[] = { 0x1F, 0x20, 0x03, 0xD5, #endif -#if PLATFORM_HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA == 1 +#if HAS_GIC_V3_WITHOUT_IRM_FLAG_SUPPORT_ERRATA == 1 // IRM 0xEA, 0x03, 0x00, 0xAA, 0x49, 0x0D, 0x41, 0xF8, 0x3F, 0x01, 0x0A, 0xEB, 0xA0, 0x0C, 0x00, 0x54, 0x03, 0x00, 0x80, 0xD2, 0x04, 0x00, 0x80, 0xD2, @@ -135,7 +135,7 @@ UINT8 OslArm64TransferToKernelShellCode[] = { 0x1F, 0x20, 0x03, 0xD5, 0x1F, 0x20, 0x03, 0xD5, #endif -#if PLATFORM_HAS_PSCI_MEMPROTECT_FAILING_ERRATA == 1 +#if HAS_PSCI_MEMPROTECT_FAILING_ERRATA == 1 // PSCI_MEMPROTECT 0xEC, 0x03, 0x00, 0xAA, 0x88, 0x0D, 0x41, 0xF8, 0x1F, 0x01, 0x0C, 0xEB, 0x20, 0x06, 0x00, 0x54, 0xA6, 0x5A, 0x80, 0xD2, 0x06, 0x00, 0xA3, 0xF2, @@ -158,7 +158,7 @@ UINT8 OslArm64TransferToKernelShellCode[] = { #endif }; -#if PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA == 1 +#if HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA == 1 VOID KernelErrataPatcherApplyReadACTLREL1Patches( EFI_PHYSICAL_ADDRESS Base, @@ -203,7 +203,7 @@ KernelErrataPatcherExitBootServices( // This fixes Boot Debugger FirmwarePrint("Patching OsLoader -> (phys) 0x%p (size) 0x%p\n", fwpKernelSetupPhase1, SCAN_MAX); -#if PLATFORM_HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA == 1 +#if HAS_ACTLR_EL1_UNIMPLEMENTED_ERRATA == 1 KernelErrataPatcherApplyReadACTLREL1Patches(fwpKernelSetupPhase1, SCAN_MAX); #endif diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.h b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.h similarity index 97% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.h rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.h index c5c6165e7..a8cef3714 100644 --- a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.h +++ b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.h @@ -19,9 +19,6 @@ #include #include -#include -#include -#include #include #include #include diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.inf b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.inf similarity index 96% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.inf rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.inf index de19bc993..17d10d399 100644 --- a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.inf +++ b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.inf @@ -25,14 +25,11 @@ OsLoaderHelper.S | GCC [Packages] - ArmPkg/ArmPkg.dec EmbeddedPkg/EmbeddedPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] - ArmLib - ArmMmuLib BaseMemoryLib DebugLib DxeServicesTableLib diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/Mmu.c b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/Mmu.c similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/Mmu.c rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/Mmu.c diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/OsLoaderHelper.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/OsLoaderHelper.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/OsLoaderHelper.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/OsLoaderHelper.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/.gitignore b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/.gitignore similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/.gitignore rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/.gitignore diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Makefile b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Makefile similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Makefile rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Makefile diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Reference/.gitignore b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Reference/.gitignore similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Reference/.gitignore rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Reference/.gitignore diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Reference/Makefile b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Reference/Makefile similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Reference/Makefile rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Reference/Makefile diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Reference/ShellCode.c b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Reference/ShellCode.c similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Reference/ShellCode.c rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/Reference/ShellCode.c diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/ShellCode.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/ShellCode.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/ShellCode.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/ShellCode.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/ShellCode.WithoutLoop.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/ShellCode.WithoutLoop.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/ShellCode.WithoutLoop.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/ACTLR_EL1/ShellCode.WithoutLoop.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/.gitignore b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/.gitignore similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/.gitignore rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/.gitignore diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Makefile b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Makefile similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Makefile rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Makefile diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Reference/.gitignore b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Reference/.gitignore similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Reference/.gitignore rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Reference/.gitignore diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Reference/Makefile b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Reference/Makefile similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Reference/Makefile rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Reference/Makefile diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Reference/ShellCode.c b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Reference/ShellCode.c similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Reference/ShellCode.c rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/Reference/ShellCode.c diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/ShellCode.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/ShellCode.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/ShellCode.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/ShellCode.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/ShellCode.WithoutLoop.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/ShellCode.WithoutLoop.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/ShellCode.WithoutLoop.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/AMCNTENSET0_EL0/ShellCode.WithoutLoop.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/.gitignore b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/.gitignore similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/.gitignore rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/.gitignore diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Makefile b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Makefile similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Makefile rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Makefile diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC/.gitignore b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC/.gitignore similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC/.gitignore rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC/.gitignore diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC/Makefile b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC/Makefile similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC/Makefile rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC/Makefile diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC/PoC.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC/PoC.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC/PoC.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC/PoC.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test.sln b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test.sln similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test.sln rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test.sln diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test/test.cpp b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test/test.cpp similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test/test.cpp rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test/test.cpp diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test/test.vcxproj b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test/test.vcxproj similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test/test.vcxproj rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test/test.vcxproj diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test/test.vcxproj.filters b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test/test.vcxproj.filters similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test/test.vcxproj.filters rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/PoC2/test/test.vcxproj.filters diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Reference/.gitignore b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Reference/.gitignore similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Reference/.gitignore rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Reference/.gitignore diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Reference/Makefile b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Reference/Makefile similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Reference/Makefile rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Reference/Makefile diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Reference/ShellCode.c b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Reference/ShellCode.c similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Reference/ShellCode.c rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/Reference/ShellCode.c diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/ShellCode.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/ShellCode.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/ShellCode.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/ShellCode.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/ShellCode.WithoutLoop.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/ShellCode.WithoutLoop.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/ShellCode.WithoutLoop.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM/ShellCode.WithoutLoop.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/.gitignore b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/.gitignore similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/.gitignore rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/.gitignore diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Makefile b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Makefile similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Makefile rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Makefile diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC/.gitignore b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC/.gitignore similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC/.gitignore rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC/.gitignore diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC/Makefile b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC/Makefile similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC/Makefile rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC/Makefile diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC/PoC.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC/PoC.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC/PoC.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC/PoC.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test.sln b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test.sln similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test.sln rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test.sln diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test/test.cpp b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test/test.cpp similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test/test.cpp rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test/test.cpp diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test/test.vcxproj b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test/test.vcxproj similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test/test.vcxproj rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test/test.vcxproj diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test/test.vcxproj.filters b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test/test.vcxproj.filters similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test/test.vcxproj.filters rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/PoC2/test/test.vcxproj.filters diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Reference/.gitignore b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Reference/.gitignore similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Reference/.gitignore rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Reference/.gitignore diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Reference/Makefile b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Reference/Makefile similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Reference/Makefile rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Reference/Makefile diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Reference/ShellCode.c b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Reference/ShellCode.c similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Reference/ShellCode.c rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/Reference/ShellCode.c diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/ShellCode.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/ShellCode.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/ShellCode.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/ShellCode.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/ShellCode.WithoutLoop.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/ShellCode.WithoutLoop.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/ShellCode.WithoutLoop.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/IRM_X8/ShellCode.WithoutLoop.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/.gitignore b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/.gitignore similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/.gitignore rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/.gitignore diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Makefile b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Makefile similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Makefile rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Makefile diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Reference/.gitignore b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Reference/.gitignore similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Reference/.gitignore rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Reference/.gitignore diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Reference/Makefile b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Reference/Makefile similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Reference/Makefile rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Reference/Makefile diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Reference/ShellCode.c b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Reference/ShellCode.c similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Reference/ShellCode.c rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/Reference/ShellCode.c diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/ShellCode.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/ShellCode.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/ShellCode.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/ShellCode.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/ShellCode.WithoutLoop.S b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/ShellCode.WithoutLoop.S similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/ShellCode.WithoutLoop.S rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/ShellCode/PSCI_MEMPROTECT/ShellCode.WithoutLoop.S diff --git a/Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/Utilities.c b/Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/Utilities.c similarity index 100% rename from Silicon/Qualcomm/QcomPkg/Library/KernelErrataPatcherLib/Utilities.c rename to Silicon/Silicium/SiliciumPkg/Library/KernelErrataPatcherLib/Utilities.c diff --git a/Silicon/Silicium/SiliciumPkg/Library/MsBootOptionsLib/MsBootOptionsLib.c b/Silicon/Silicium/SiliciumPkg/Library/MsBootOptionsLib/MsBootOptionsLib.c index 96476ead6..3015b8c36 100644 --- a/Silicon/Silicium/SiliciumPkg/Library/MsBootOptionsLib/MsBootOptionsLib.c +++ b/Silicon/Silicium/SiliciumPkg/Library/MsBootOptionsLib/MsBootOptionsLib.c @@ -102,7 +102,7 @@ MsBootOptionsLibGetDefaultBootApp ( IN OUT EFI_BOOT_MANAGER_LOAD_OPTION *BootOption, IN CHAR8 *Parameter) { - return BuildFwLoadOption (BootOption, &gMsBootPolicyFileGuid, Parameter); + return BuildFwLoadOption (BootOption, PcdGetPtr (PcdSpecificApp), Parameter); } /** diff --git a/Silicon/Silicium/SiliciumPkg/Library/MsBootOptionsLib/MsBootOptionsLib.inf b/Silicon/Silicium/SiliciumPkg/Library/MsBootOptionsLib/MsBootOptionsLib.inf index 8b3f0de05..4ed38fb2b 100644 --- a/Silicon/Silicium/SiliciumPkg/Library/MsBootOptionsLib/MsBootOptionsLib.inf +++ b/Silicon/Silicium/SiliciumPkg/Library/MsBootOptionsLib/MsBootOptionsLib.inf @@ -42,6 +42,7 @@ [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile + gSiliciumPkgTokenSpaceGuid.PcdSpecificApp [Depex] TRUE diff --git a/Silicon/Silicium/SiliciumPkg/Library/MsBootPolicyLib/MsBootPolicyLib.c b/Silicon/Silicium/SiliciumPkg/Library/MsBootPolicyLib/MsBootPolicyLib.c index 5576d8e87..4720713f3 100644 --- a/Silicon/Silicium/SiliciumPkg/Library/MsBootPolicyLib/MsBootPolicyLib.c +++ b/Silicon/Silicium/SiliciumPkg/Library/MsBootPolicyLib/MsBootPolicyLib.c @@ -65,7 +65,7 @@ LocalLoadImage ( **/ BOOLEAN EFIAPI -MsBootPolicyLibIsVolumeUp () +MsBootPolicyLibIsSettingsBoot () { EFI_STATUS Status = EFI_SUCCESS; BOOLEAN VolumeUpApplication = FALSE; @@ -98,7 +98,7 @@ MsBootPolicyLibIsVolumeUp () **/ BOOLEAN EFIAPI -MsBootPolicyLibIsVolumeDown () +MsBootPolicyLibIsAltBoot () { EFI_STATUS Status = EFI_SUCCESS; BOOLEAN VolumeDownApplication = FALSE; diff --git a/Silicon/Silicium/SiliciumPkg/Library/MsPlatformDevicesLib/MsPlatformDevicesLib.c b/Silicon/Silicium/SiliciumPkg/Library/MsPlatformDevicesLib/MsPlatformDevicesLib.c index 121469943..2f2a37ac6 100644 --- a/Silicon/Silicium/SiliciumPkg/Library/MsPlatformDevicesLib/MsPlatformDevicesLib.c +++ b/Silicon/Silicium/SiliciumPkg/Library/MsPlatformDevicesLib/MsPlatformDevicesLib.c @@ -63,8 +63,6 @@ EFI_DEVICE_PATH_PROTOCOL** EFIAPI GetPlatformConnectList () { - BdsExtensionPlatformConnectList (); - return NULL; } diff --git a/Silicon/Silicium/SiliciumPkg/PrePi/AArch64/ModuleEntryPoint.S b/Silicon/Silicium/SiliciumPkg/PrePi/AArch64/ModuleEntryPoint.S index 8c6d82ace..6a9c2707b 100644 --- a/Silicon/Silicium/SiliciumPkg/PrePi/AArch64/ModuleEntryPoint.S +++ b/Silicon/Silicium/SiliciumPkg/PrePi/AArch64/ModuleEntryPoint.S @@ -12,15 +12,6 @@ .set CTRL_SPAN_BIT, (1 << 23) -.global _StackBase -.global _StackSize - -_StackBase: - .quad FixedPcdGet32(PcdPrePiStackBase) - -_StackSize: - .quad FixedPcdGet32(PcdPrePiStackSize) - ASM_FUNC(_ModuleEntryPoint) // Do early platform specific actions bl ASM_PFX(ArmPlatformPeiBootAction) @@ -71,8 +62,8 @@ _DonNotTrap_VFP_SIMD: isb sy _SetupPrimaryCoreStack: - ldr x0, _StackBase /* Stack base arg0 */ - ldr x1, _StackSize /* Stack size arg1 */ + ldr x0, =FixedPcdGet32(PcdPrePiStackBase) /* Stack base arg0 */ + ldr x1, =FixedPcdGet32(PcdPrePiStackSize) /* Stack size arg1 */ /* Zero Init stack */ add x2, x0, x1 /* End of Stack */ diff --git a/Silicon/Silicium/SiliciumPkg/PrePi/Arm/ModuleEntryPoint.S b/Silicon/Silicium/SiliciumPkg/PrePi/Arm/ModuleEntryPoint.S index 117a4af2f..25159cf6c 100644 --- a/Silicon/Silicium/SiliciumPkg/PrePi/Arm/ModuleEntryPoint.S +++ b/Silicon/Silicium/SiliciumPkg/PrePi/Arm/ModuleEntryPoint.S @@ -19,15 +19,6 @@ #define LoadConstantToReg(Data, Reg) \ ldr Reg, =Data -.global _StackBase -.global _StackSize - -_StackBase: - .quad FixedPcdGet32(PcdPrePiStackBase) - -_StackSize: - .quad FixedPcdGet32(PcdPrePiStackSize) - ASM_FUNC(_ModuleEntryPoint) mov r0, #0 bl ASM_PFX(ArmReadMpidr) @@ -57,8 +48,8 @@ _FillVectors: bne _FillVectors _SetupPrimaryCoreStack: - ldr r0, _StackBase /* Stack base arg0 */ - ldr r1, _StackSize /* Stack size arg1 */ + ldr r0, =FixedPcdGet32(PcdPrePiStackBase) /* Stack base arg0 */ + ldr r1, =FixedPcdGet32(PcdPrePiStackSize) /* Stack size arg1 */ add r4, r0, r1 add sp, r4, #0 diff --git a/Silicon/Silicium/SiliciumPkg/SiliciumPkg.dec b/Silicon/Silicium/SiliciumPkg/SiliciumPkg.dec index d258b2f48..fde0c7aa5 100644 --- a/Silicon/Silicium/SiliciumPkg/SiliciumPkg.dec +++ b/Silicon/Silicium/SiliciumPkg/SiliciumPkg.dec @@ -29,23 +29,29 @@ gSiliciumPkgTokenSpaceGuid.PcdSmbiosSystemRetailSku|""|VOID*|0x0000A105 gSiliciumPkgTokenSpaceGuid.PcdSmbiosBoardModel|""|VOID*|0x0000A106 + # Device Maintainer PCD + gSiliciumPkgTokenSpaceGuid.PcdDeviceMaintainer|"Unknown Maintainer"|VOID*|0x0000A200 + # BMP File GUIDs ## Boot Logo Picture Sizes PCDs - gSiliciumPkgTokenSpaceGuid.PcdLogoFile_Small |{ 0x1E, 0x25, 0x92, 0x7F, 0x1B, 0x73, 0x40, 0x6D, 0xBA, 0xEA, 0x82, 0x52, 0x25, 0x2B, 0x73, 0xB9 }|VOID*|0x0000A200 - gSiliciumPkgTokenSpaceGuid.PcdLogoFile_Medium |{ 0xC9, 0x82, 0x5D, 0x32, 0x4B, 0xFE, 0x40, 0x44, 0x81, 0x44, 0x36, 0xD8, 0xD5, 0x9D, 0xB8, 0xE1 }|VOID*|0x0000A201 - gSiliciumPkgTokenSpaceGuid.PcdLogoFile_Big |{ 0xD3, 0xEB, 0xC3, 0xCE, 0x2D, 0x62, 0x40, 0x2E, 0x9D, 0x24, 0xD4, 0x88, 0xE6, 0x99, 0x04, 0x85 }|VOID*|0x0000A202 + gSiliciumPkgTokenSpaceGuid.PcdLogoFile_Small |{ 0x1E, 0x25, 0x92, 0x7F, 0x1B, 0x73, 0x40, 0x6D, 0xBA, 0xEA, 0x82, 0x52, 0x25, 0x2B, 0x73, 0xB9 }|VOID*|0x0000A300 + gSiliciumPkgTokenSpaceGuid.PcdLogoFile_Medium |{ 0xC9, 0x82, 0x5D, 0x32, 0x4B, 0xFE, 0x40, 0x44, 0x81, 0x44, 0x36, 0xD8, 0xD5, 0x9D, 0xB8, 0xE1 }|VOID*|0x0000A301 + gSiliciumPkgTokenSpaceGuid.PcdLogoFile_Big |{ 0xD3, 0xEB, 0xC3, 0xCE, 0x2D, 0x62, 0x40, 0x2E, 0x9D, 0x24, 0xD4, 0x88, 0xE6, 0x99, 0x04, 0x85 }|VOID*|0x0000A302 ## Low Battery Picture Sizes PCDs - gSiliciumPkgTokenSpaceGuid.PcdLowBatteryFile_Small |{ 0x19, 0x38, 0x1E, 0x66, 0x38, 0xCD, 0x48, 0xC3, 0xBC, 0x72, 0xC7, 0x4C, 0x0F, 0xF2, 0xB6, 0xD7 }|VOID*|0x0000A203 - gSiliciumPkgTokenSpaceGuid.PcdLowBatteryFile_Medium|{ 0x07, 0x8E, 0x16, 0xFB, 0xE2, 0xFA, 0x44, 0xDE, 0x8D, 0xD7, 0xBE, 0xA2, 0x60, 0x8A, 0x01, 0xDD }|VOID*|0x0000A204 - gSiliciumPkgTokenSpaceGuid.PcdLowBatteryFile_Big |{ 0xE8, 0x9E, 0x46, 0x49, 0xD1, 0x30, 0x41, 0x69, 0x97, 0x80, 0x9F, 0xFE, 0x72, 0x7C, 0x1C, 0xAA }|VOID*|0x0000A205 + gSiliciumPkgTokenSpaceGuid.PcdLowBatteryFile_Small |{ 0x19, 0x38, 0x1E, 0x66, 0x38, 0xCD, 0x48, 0xC3, 0xBC, 0x72, 0xC7, 0x4C, 0x0F, 0xF2, 0xB6, 0xD7 }|VOID*|0x0000A303 + gSiliciumPkgTokenSpaceGuid.PcdLowBatteryFile_Medium|{ 0x07, 0x8E, 0x16, 0xFB, 0xE2, 0xFA, 0x44, 0xDE, 0x8D, 0xD7, 0xBE, 0xA2, 0x60, 0x8A, 0x01, 0xDD }|VOID*|0x0000A304 + gSiliciumPkgTokenSpaceGuid.PcdLowBatteryFile_Big |{ 0xE8, 0x9E, 0x46, 0x49, 0xD1, 0x30, 0x41, 0x69, 0x97, 0x80, 0x9F, 0xFE, 0x72, 0x7C, 0x1C, 0xAA }|VOID*|0x0000A305 ## Too Hot Picture Sizes PCDs - gSiliciumPkgTokenSpaceGuid.PcdThermalFile_Small |{ 0x53, 0x49, 0x9E, 0x24, 0xA2, 0x09, 0x41, 0xDE, 0xBB, 0x54, 0x2D, 0xA9, 0x36, 0x6D, 0x35, 0xEC }|VOID*|0x0000A206 - gSiliciumPkgTokenSpaceGuid.PcdThermalFile_Medium |{ 0x2C, 0xE2, 0xBC, 0x3C, 0xDF, 0xF1, 0x42, 0xCC, 0x90, 0x3D, 0xF2, 0x12, 0x26, 0x2B, 0x02, 0xD3 }|VOID*|0x0000A207 - gSiliciumPkgTokenSpaceGuid.PcdThermalFile_Big |{ 0xA6, 0xD1, 0x3F, 0x24, 0x6F, 0x1A, 0x43, 0x31, 0xBD, 0xB4, 0x36, 0xA9, 0x1C, 0x9D, 0x84, 0x72 }|VOID*|0x0000A208 + gSiliciumPkgTokenSpaceGuid.PcdThermalFile_Small |{ 0x53, 0x49, 0x9E, 0x24, 0xA2, 0x09, 0x41, 0xDE, 0xBB, 0x54, 0x2D, 0xA9, 0x36, 0x6D, 0x35, 0xEC }|VOID*|0x0000A306 + gSiliciumPkgTokenSpaceGuid.PcdThermalFile_Medium |{ 0x2C, 0xE2, 0xBC, 0x3C, 0xDF, 0xF1, 0x42, 0xCC, 0x90, 0x3D, 0xF2, 0x12, 0x26, 0x2B, 0x02, 0xD3 }|VOID*|0x0000A307 + gSiliciumPkgTokenSpaceGuid.PcdThermalFile_Big |{ 0xA6, 0xD1, 0x3F, 0x24, 0x6F, 0x1A, 0x43, 0x31, 0xBD, 0xB4, 0x36, 0xA9, 0x1C, 0x9D, 0x84, 0x72 }|VOID*|0x0000A308 ## No Boot OS Picture Sizes PCDs - gSiliciumPkgTokenSpaceGuid.PcdNoBootOSFile_Small |{ 0xBE, 0xFB, 0x54, 0x15, 0xE6, 0xA3, 0x40, 0x7C, 0x97, 0xB3, 0x9D, 0xAF, 0x60, 0x3A, 0x02, 0x50 }|VOID*|0x0000A209 - gSiliciumPkgTokenSpaceGuid.PcdNoBootOSFile_Medium |{ 0x71, 0xCC, 0xF0, 0x48, 0x02, 0x5E, 0x4F, 0xD4, 0x97, 0xDB, 0xA6, 0x73, 0x24, 0xE7, 0x1F, 0x99 }|VOID*|0x0000A20A - gSiliciumPkgTokenSpaceGuid.PcdNoBootOSFile_Big |{ 0xE5, 0x63, 0x88, 0xD4, 0x83, 0x6C, 0x41, 0x4F, 0x81, 0x42, 0xCD, 0xF0, 0xD4, 0x24, 0x64, 0x65 }|VOID*|0x0000A20B + gSiliciumPkgTokenSpaceGuid.PcdNoBootOSFile_Small |{ 0xBE, 0xFB, 0x54, 0x15, 0xE6, 0xA3, 0x40, 0x7C, 0x97, 0xB3, 0x9D, 0xAF, 0x60, 0x3A, 0x02, 0x50 }|VOID*|0x0000A309 + gSiliciumPkgTokenSpaceGuid.PcdNoBootOSFile_Medium |{ 0x71, 0xCC, 0xF0, 0x48, 0x02, 0x5E, 0x4F, 0xD4, 0x97, 0xDB, 0xA6, 0x73, 0x24, 0xE7, 0x1F, 0x99 }|VOID*|0x0000A30A + gSiliciumPkgTokenSpaceGuid.PcdNoBootOSFile_Big |{ 0xE5, 0x63, 0x88, 0xD4, 0x83, 0x6C, 0x41, 0x4F, 0x81, 0x42, 0xCD, 0xF0, 0xD4, 0x24, 0x64, 0x65 }|VOID*|0x0000A30B + + # Specific App PCD + gSiliciumPkgTokenSpaceGuid.PcdSpecificApp|{ NULL }|VOID*|0x0000A400 diff --git a/Silicon/Silicium/SiliciumPkg/SiliciumPkg.dsc.inc b/Silicon/Silicium/SiliciumPkg/SiliciumPkg.dsc.inc index 3920e232e..e3e6d7f01 100644 --- a/Silicon/Silicium/SiliciumPkg/SiliciumPkg.dsc.inc +++ b/Silicon/Silicium/SiliciumPkg/SiliciumPkg.dsc.inc @@ -8,20 +8,28 @@ ## [BuildOptions] - *_CLANGDWARF_*_CC_FLAGS = -Wno-unused-const-variable -Wno-sometimes-uninitialized -Wno-unaligned-access -Wno-deprecated-non-prototype -D CLANG -D __DEPRECATED_AARCH64_4K_RUNTIME_GRANULARITY + *_*_*_CC_FLAGS = -Wno-unused-const-variable -Wno-sometimes-uninitialized -Wno-unaligned-access -Wno-deprecated-non-prototype -D CLANG -D __DEPRECATED_AARCH64_4K_RUNTIME_GRANULARITY !if $(TARGET) == DEBUG - *_CLANGDWARF_*_CC_FLAGS = -D EFI_DEBUG + *_*_*_CC_FLAGS = -D EFI_DEBUG !endif - *_CLANGDWARF_ARM_CC_FLAGS = -fno-asynchronous-unwind-tables + *_*_ARM_CC_FLAGS = -fno-asynchronous-unwind-tables -[BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION] - *_*_*_DLINK_FLAGS = -z common-page-size=0x1000 +[BuildOptions.common.EDKII.SEC,BuildOptions.common.EDKII.MM_CORE_STANDALONE] + GCC:*_CLANGDWARF_*_DLINK_FLAGS = -z common-page-size=0x1000 + GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:0x1000 /FILEALIGN:0x1000 + +[BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION,BuildOptions.common.EDKII.MM_CORE_STANDALONE,BuildOptions.common.EDKII.MM_STANDALONE] + GCC:*_CLANGDWARF_*_DLINK_FLAGS = -z common-page-size=0x1000 + GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:0x1000 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] - *_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000 + GCC:*_CLANGDWARF_ARM_DLINK_FLAGS = -z common-page-size=0x1000 + GCC:*_CLANGDWARF_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000 + GCC:*_CLANGPDB_AARCH64_DLINK_FLAGS = /ALIGN:0x10000 + RVCT:*_*_ARM_DLINK_FLAGS = --scatter $(EDK_TOOLS_PATH)/Scripts/Rvct-Align4K.sct [BuildOptions.common.EDKII.MM_CORE_STANDALONE,BuildOptions.common.EDKII.MM_STANDALONE] - *_*_AARCH64_CC_FLAGS = -mstrict-align -march=armv8-a + GCC:*_*_AARCH64_CC_FLAGS = -mstrict-align -march=armv8-a [PcdsFixedAtBuild.AArch64] gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|44 @@ -42,7 +50,8 @@ gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob|TRUE [PcdsFixedAtBuild] - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"2.6" + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"2.7" + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|L"Project Silicium" gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision|0x01231229 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId|"SILICI" gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId|0x324B44454D4F4351 @@ -293,10 +302,6 @@ ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf -[Components.AArch64] - # Processor Core Services - ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf - [Components] # PrePI SiliciumPkg/PrePi/PrePi.inf { @@ -324,15 +329,6 @@ ArmPkg/Drivers/TimerDxe/TimerDxe.inf !endif - EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf - EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboardDxe.inf - EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf - EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf - EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf { - - RealTimeClockLib|EmbeddedPkg/Library/TemplateRealTimeClockLib/TemplateRealTimeClockLib.inf - } - # Pci MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf # USB 3.* MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf # USB 2.* @@ -345,6 +341,14 @@ # Runtime Services MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf + EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf + EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboardDxe.inf + EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf + EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf + EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf { + + RealTimeClockLib|EmbeddedPkg/Library/TemplateRealTimeClockLib/TemplateRealTimeClockLib.inf + } # ACPI MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -358,6 +362,12 @@ FatPkg/EnhancedFatDxe/Fat.inf # BDS + MdeModulePkg/Universal/BdsDxe/BdsDxe.inf { + +!if ($(ARCH) == AARCH64) && ($(ENABLE_KEP) == 1) + NULL|SiliciumPkg/Library/KernelErrataPatcherLib/KernelErrataPatcherLib.inf +!endif + } MdeModulePkg/Universal/PrintDxe/PrintDxe.inf MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf diff --git a/setup_env.sh b/setup_env.sh index e806d522b..e73d297c7 100755 --- a/setup_env.sh +++ b/setup_env.sh @@ -41,14 +41,14 @@ if [ ${PAK} = apt ]; then sudo apt update sudo apt -y upgrade fi - sudo apt install -y pip git mono-devel build-essential lld nuget uuid-dev iasl nasm gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf python3 python3-distutils python3-git python3-pip gettext locales gnupg ca-certificates python3-venv git git-core clang llvm curl||_error "\nFailed to install Packages!\n" + sudo apt install -y pip git mono-devel build-essential lld nuget uuid-dev iasl nasm gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf python3 python3-distutils python3-git python3-pip gettext locales gnupg ca-certificates python3-venv git git-core clang llvm curl lld||_error "\nFailed to install Packages!\n" elif [ ${PAK} = dnf ]; then - sudo dnf install -y git mono-devel nuget iasl nasm make lld gcc automake gcc-aarch64-linux-gnu arm-linux-gnueabihf-gcc python3 python3-pip gettext gnupg ca-certificates git git-core clang llvm curl||_error "\nFailed to install Packages!\n" + sudo dnf install -y git mono-devel nuget iasl nasm make lld gcc automake gcc-aarch64-linux-gnu arm-linux-gnueabihf-gcc python3 python3-pip gettext gnupg ca-certificates git git-core clang llvm curl lld||_error "\nFailed to install Packages!\n" elif [ ${PAK} = pacman ] || [ ${PAK} = yay ]; then if [ ${PAK} = pacman ]; then sudo pacman -Syu --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si fi - yay -Sy git mono base-devel nuget uuid iasl lld nasm aarch64-linux-gnu-gcc arm-linux-gnueabihf-gcc python3 python python-distutils-extra python-git python-pip gettext gnupg ca-certificates python-virtualenv python-pipenv core-git clang llvm curl||_error "\nFailed to install Packages!\n" + yay -Sy git mono base-devel nuget uuid iasl lld nasm aarch64-linux-gnu-gcc arm-linux-gnueabihf-gcc python3 python python-distutils-extra python-git python-pip gettext gnupg ca-certificates python-virtualenv python-pipenv core-git clang llvm curl lld||_error "\nFailed to install Packages!\n" else _error "\nInvaild Package Manager!\nAvailbe Package Managers: apt, dnf, pacman and yay\n" fi @@ -56,6 +56,5 @@ fi # Install Needed Python Packages python3 -m pip install -r pip-requirements.txt ||python3 -m pip install -r pip-requirements.txt --break-system-packages||_error "\nFailed to install Pip Packages!\n" -export CLANGDWARF_BIN=/usr/lib/llvm-38/bin/ -export CLANGDWARF_AARCH64_PREFIX=aarch64-linux-gnu- +export CLANGPDB_AARCH64_PREFIX=aarch64-linux-gnu- export CLANGDWARF_ARM_PREFIX=arm-linux-gnueabihf-