Skip to content

Commit ba183b7

Browse files
committed
Add Support for onyx
1 parent 54bc6be commit ba183b7

23 files changed

Lines changed: 25131 additions & 2 deletions

File tree

Binaries

Submodule Binaries updated 376 files
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
##
2+
# Copyright (c) Microsoft Corporation.
3+
# SPDX-License-Identifier: BSD-2-Clause-Patent
4+
##
5+
6+
import datetime
7+
import logging
8+
import os
9+
import uuid
10+
11+
from io import StringIO
12+
from pathlib import Path
13+
14+
from edk2toolext.environment import shell_environment
15+
from edk2toolext.environment.uefi_build import UefiBuilder
16+
from edk2toolext.invocables.edk2_platform_build import BuildSettingsManager
17+
from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager
18+
from edk2toolext.invocables.edk2_setup import (RequiredSubmodule, SetupSettingsManager)
19+
from edk2toolext.invocables.edk2_update import UpdateSettingsManager
20+
from edk2toolext.invocables.edk2_parse import ParseSettingsManager
21+
from edk2toollib.utility_functions import RunCmd
22+
23+
# ####################################################################################### #
24+
# Common Configuration #
25+
# ####################################################################################### #
26+
class CommonPlatform ():
27+
PackagesSupported = ("onyxPkg")
28+
ArchSupported = ("AARCH64")
29+
TargetsSupported = ("DEBUG", "RELEASE")
30+
Scopes = ('onyx', 'gcc_aarch64_linux', 'edk2-build')
31+
WorkspaceRoot = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
32+
PackagesPath = (
33+
"Platforms/Xiaomi",
34+
"Common/Mu",
35+
"Common/Mu_OEM_Sample",
36+
"Mu_Basecore",
37+
"Silicon/Qualcomm",
38+
"Silicon/Silicium",
39+
"Silicium-ACPI",
40+
"Silicium-ACPI/Platforms/Xiaomi",
41+
"Silicium-ACPI/SoCs/Qualcomm"
42+
)
43+
44+
# ####################################################################################### #
45+
# Configuration for Update & Setup #
46+
# ####################################################################################### #
47+
class SettingsManager (UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager, ParseSettingsManager):
48+
49+
def GetPackagesSupported (self):
50+
return CommonPlatform.PackagesSupported
51+
52+
def GetArchitecturesSupported (self):
53+
return CommonPlatform.ArchSupported
54+
55+
def GetTargetsSupported (self):
56+
return CommonPlatform.TargetsSupported
57+
58+
def GetRequiredSubmodules (self):
59+
return [
60+
RequiredSubmodule ("Binaries", True),
61+
RequiredSubmodule ("Common/Mu", True),
62+
RequiredSubmodule ("Common/Mu_OEM_Sample", True),
63+
RequiredSubmodule ("Mu_Basecore", True),
64+
RequiredSubmodule ("Silicium-ACPI", True),
65+
RequiredSubmodule ("Silicon/Silicium/OpensslPkg/Library/OpensslLib/openssl", True)
66+
]
67+
68+
def SetArchitectures (self, list_of_requested_architectures):
69+
unsupported = set(list_of_requested_architectures) - set(self.GetArchitecturesSupported())
70+
71+
if (len(unsupported) > 0):
72+
errorString = ("Unsupported Architecture Requested: " + " ".join(unsupported))
73+
logging.critical (errorString)
74+
raise Exception (errorString)
75+
76+
self.ActualArchitectures = list_of_requested_architectures
77+
78+
def GetWorkspaceRoot (self):
79+
return CommonPlatform.WorkspaceRoot
80+
81+
def GetActiveScopes (self):
82+
return CommonPlatform.Scopes
83+
84+
def FilterPackagesToTest (self, changedFilesList: list, potentialPackagesList: list) -> list:
85+
build_these_packages = []
86+
possible_packages = potentialPackagesList.copy ()
87+
88+
for f in changedFilesList:
89+
if "BaseTools" in f:
90+
if os.path.splitext(f) not in [".txt", ".md"]:
91+
build_these_packages = possible_packages
92+
break
93+
94+
if "platform-build-run-steps.yml" in f:
95+
build_these_packages = possible_packages
96+
break
97+
98+
return build_these_packages
99+
100+
def GetPlatformDscAndConfig (self) -> tuple:
101+
return ("onyxPkg/onyx.dsc", {})
102+
103+
def GetName (self):
104+
return "onyx"
105+
106+
def GetPackagesPath (self):
107+
return CommonPlatform.PackagesPath
108+
109+
# ####################################################################################### #
110+
# Actual Configuration for Platform Build #
111+
# ####################################################################################### #
112+
class PlatformBuilder (UefiBuilder, BuildSettingsManager):
113+
def __init__ (self):
114+
UefiBuilder.__init__ (self)
115+
116+
def AddCommandLineOptions (self, parserObj):
117+
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.")
118+
119+
def RetrieveCommandLineOptions (self, args):
120+
if args.build_arch.upper() != "AARCH64":
121+
raise Exception("Invalid Arch Specified. Please see comments in DeviceBuild.py::PlatformBuilder::AddCommandLineOptions")
122+
123+
def GetWorkspaceRoot (self):
124+
return CommonPlatform.WorkspaceRoot
125+
126+
def GetPackagesPath (self):
127+
result = [ shell_environment.GetBuildVars().GetValue("FEATURE_CONFIG_PATH", "") ]
128+
129+
for a in CommonPlatform.PackagesPath:
130+
result.append(a)
131+
132+
return result
133+
134+
def GetActiveScopes (self):
135+
return CommonPlatform.Scopes
136+
137+
def GetName (self):
138+
return "onyxPkg"
139+
140+
def GetLoggingLevel (self, loggerType):
141+
return logging.INFO
142+
return super().GetLoggingLevel(loggerType)
143+
144+
def SetPlatformEnv (self):
145+
logging.debug ("PlatformBuilder SetPlatformEnv")
146+
147+
self.env.SetValue ("PRODUCT_NAME", "onyx", "Platform Hardcoded")
148+
self.env.SetValue ("ACTIVE_PLATFORM", "onyxPkg/onyx.dsc", "Platform Hardcoded")
149+
self.env.SetValue ("TARGET_ARCH", "AARCH64", "Platform Hardcoded")
150+
self.env.SetValue ("TOOL_CHAIN_TAG", "CLANGPDB", "set default to clangpdb")
151+
self.env.SetValue ("EMPTY_DRIVE", "FALSE", "Default to false")
152+
self.env.SetValue ("RUN_TESTS", "FALSE", "Default to false")
153+
self.env.SetValue ("SHUTDOWN_AFTER_RUN", "FALSE", "Default to false")
154+
self.env.SetValue ("BLD_*_BUILDID_STRING", "Unknown", "Default")
155+
self.env.SetValue ("BUILDREPORTING", "TRUE", "Enabling build report")
156+
self.env.SetValue ("BUILDREPORT_TYPES", "PCD DEPEX FLASH BUILD_FLAGS LIBRARY FIXED_ADDRESS HASH", "Setting build report types")
157+
self.env.SetValue ("BLD_*_MEMORY_PROTECTION", "TRUE", "Default")
158+
self.env.SetValue ("BLD_*_SHIP_MODE", "FALSE", "Default")
159+
self.env.SetValue ("BLD_*_ENABLE_SECUREBOOT", self.env.GetValue("ENABLE_SECUREBOOT"), "Default")
160+
self.env.SetValue ("BLD_*_FD_BASE", self.env.GetValue("FD_BASE"), "Default")
161+
self.env.SetValue ("BLD_*_FD_SIZE", self.env.GetValue("FD_SIZE"), "Default")
162+
self.env.SetValue ("BLD_*_FD_BLOCKS", self.env.GetValue("FD_BLOCKS"), "Default")
163+
164+
return 0
165+
166+
def PlatformPreBuild (self):
167+
return 0
168+
169+
def PlatformPostBuild (self):
170+
return 0
171+
172+
def FlashRomImage (self):
173+
return 0
174+
175+
if __name__ == "__main__":
176+
import argparse
177+
import sys
178+
179+
from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild
180+
from edk2toolext.invocables.edk2_setup import Edk2PlatformSetup
181+
from edk2toolext.invocables.edk2_update import Edk2Update
182+
183+
SCRIPT_PATH = os.path.relpath (__file__)
184+
185+
parser = argparse.ArgumentParser (add_help=False)
186+
187+
parse_group = parser.add_mutually_exclusive_group()
188+
189+
parse_group.add_argument ("--update", "--UPDATE", action='store_true', help="Invokes stuart_update")
190+
parse_group.add_argument ("--setup", "--SETUP", action='store_true', help="Invokes stuart_setup")
191+
192+
args, remaining = parser.parse_known_args()
193+
194+
new_args = ["stuart", "-c", SCRIPT_PATH]
195+
new_args = new_args + remaining
196+
197+
sys.argv = new_args
198+
199+
if args.setup:
200+
Edk2PlatformSetup().Invoke()
201+
elif args.update:
202+
Edk2Update().Invoke()
203+
else:
204+
Edk2PlatformBuild().Invoke()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#FILE FREEFORM = 7E374E25-8E01-4FEE-87F2-390C23C606CD {
2+
# SECTION RAW = Bonito/APIC.aml
3+
# SECTION RAW = Bonito/BERT.aml
4+
# SECTION RAW = Bonito/CSRT.aml
5+
#!if $(ENABLE_SECUREBOOT) == 0
6+
# SECTION RAW = Bonito/DBG2.aml
7+
#!endif
8+
# SECTION RAW = Bonito/DSDT.aml
9+
# SECTION RAW = onyx/SSDT.aml
10+
# SECTION RAW = Bonito/FACP.aml
11+
# SECTION RAW = Bonito/FPDT.aml
12+
# SECTION RAW = Bonito/GTDT.aml
13+
# SECTION RAW = Bonito/IORT.aml
14+
# SECTION RAW = Bonito/MCFG.aml
15+
# SECTION RAW = Bonito/MSDM.aml
16+
# SECTION RAW = Bonito/PPTT.aml
17+
# SECTION RAW = Bonito/SPCR.aml
18+
# SECTION UI = "AcpiTables"
19+
#}
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
APRIORI DXE {
2+
INF MdeModulePkg/Core/Dxe/DxeMain.inf
3+
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
4+
INF QcomPkg/Drivers/IortDtDxe/IortDtDxe.inf
5+
6+
INF Binaries/onyx/QcomPkg/Drivers/EnvDxe/EnvDxeEnhanced.inf
7+
8+
INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf
9+
INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
10+
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
11+
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
12+
INF ArmPkg/Drivers/ArmGicDxe/ArmGicDxe.inf
13+
INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
14+
INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
15+
16+
INF Binaries/onyx/QcomPkg/Drivers/SmemDxe/SmemDxe.inf
17+
INF Binaries/onyx/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.inf
18+
INF Binaries/onyx/QcomPkg/Drivers/HWIODxe/HWIODxe.inf
19+
INF Binaries/onyx/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf
20+
INF Binaries/onyx/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf
21+
INF Binaries/onyx/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.inf
22+
INF Binaries/onyx/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.inf
23+
INF Binaries/onyx/QcomPkg/Drivers/ULogDxe/ULogDxe.inf
24+
INF Binaries/onyx/QcomPkg/Drivers/IPCCDxe/IPCCDxe.inf
25+
INF Binaries/onyx/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.inf
26+
INF Binaries/onyx/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.inf
27+
INF Binaries/onyx/QcomPkg/Drivers/NpaDxe/NpaDxe.inf
28+
INF Binaries/onyx/QcomPkg/Drivers/RpmhDxe/RpmhDxe.inf
29+
INF Binaries/onyx/QcomPkg/Drivers/VcsDxe/VcsDxe.inf
30+
INF Binaries/onyx/QcomPkg/Drivers/ClockDxe/ClockDxe.inf
31+
INF Binaries/onyx/QcomPkg/Drivers/ICBDxe/ICBDxe.inf
32+
INF Binaries/onyx/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.inf
33+
INF Binaries/onyx/QcomPkg/Drivers/TzDxe/ScmDxeCompat.inf
34+
INF Binaries/onyx/QcomPkg/Drivers/TLMMDxe/TLMMDxe.inf
35+
INF Binaries/onyx/QcomPkg/Drivers/QupDxe/QupDxe.inf
36+
INF Binaries/onyx/QcomPkg/Drivers/I2CDxe/I2CDxe.inf
37+
INF Binaries/onyx/QcomPkg/Drivers/ExFgDxe/ExFg.inf
38+
INF Binaries/onyx/QcomPkg/Drivers/ExCpDxe/ExCp.inf
39+
INF Binaries/onyx/QcomPkg/Drivers/SPMIDxe/SPMIDxe.inf
40+
41+
INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
42+
43+
INF Binaries/onyx/QcomPkg/Drivers/PmicDxe/PmicDxeLa.inf
44+
45+
INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
46+
INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
47+
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
48+
49+
INF Binaries/onyx/QcomPkg/Drivers/SdccDxe/SdccDxe.inf
50+
INF Binaries/onyx/QcomPkg/Drivers/UFSDxe/UFSDxe.inf
51+
52+
INF FatPkg/EnhancedFatDxe/Fat.inf
53+
54+
INF Binaries/onyx/QcomPkg/Drivers/TzDxe/TzDxeLA.inf
55+
56+
INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
57+
58+
INF Binaries/onyx/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.inf
59+
INF Binaries/onyx/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.inf
60+
61+
!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1
62+
INF Binaries/onyx/QcomPkg/Drivers/DisplayDxe/DisplayDxe.inf
63+
!else
64+
INF SiliciumPkg/Drivers/SimpleFbDxe/SimpleFbDxe.inf
65+
!endif
66+
67+
INF Binaries/onyx/QcomPkg/Drivers/FvUtilsDxe/FvUtilsEnhancedDxe.inf
68+
INF Binaries/onyx/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.inf
69+
INF Binaries/onyx/QcomPkg/Drivers/PILDxe/PILDxe.inf
70+
INF Binaries/onyx/QcomPkg/Drivers/SPSSDxe/SPSSDxe.inf
71+
INF Binaries/onyx/QcomPkg/Drivers/GLinkDxe/GLinkDxe.inf
72+
73+
INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
74+
INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
75+
INF EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf
76+
INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
77+
INF MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
78+
INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
79+
INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
80+
INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
81+
82+
INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
83+
84+
INF Binaries/onyx/QcomPkg/Drivers/SPIDxe/SPIDxe.inf
85+
INF Binaries/onyx/QcomPkg/Drivers/HSUartDxe/HSUartDxe.inf
86+
INF Binaries/onyx/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.inf
87+
INF Binaries/onyx/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.inf
88+
INF Binaries/onyx/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.inf
89+
INF Binaries/onyx/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.inf
90+
INF Binaries/onyx/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.inf
91+
INF Binaries/onyx/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.inf
92+
INF Binaries/onyx/QcomPkg/Drivers/XhciDxe/XhciDxe.inf
93+
94+
INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
95+
INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
96+
INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
97+
98+
INF Binaries/onyx/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.inf
99+
INF Binaries/onyx/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.inf
100+
INF Binaries/onyx/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.inf
101+
INF Binaries/onyx/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.inf
102+
INF Binaries/onyx/QcomPkg/Drivers/TsensDxe/TsensDxe.inf
103+
!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1
104+
INF Binaries/onyx/QcomPkg/Drivers/CPRDxe/CPRDxe.inf
105+
!endif
106+
INF Binaries/onyx/QcomPkg/Drivers/GpiDxe/GpiDxe.inf
107+
INF Binaries/onyx/QcomPkg/Drivers/UCDxe/UCDxe.inf
108+
INF Binaries/onyx/QcomPkg/Drivers/RNGDxe/RngDxe.inf
109+
110+
INF EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf
111+
INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
112+
INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
113+
INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
114+
115+
INF Binaries/onyx/QcomPkg/Drivers/RscDxe/RscDxe.inf
116+
}

0 commit comments

Comments
 (0)