Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sagit: initial support #1542

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Platforms/Xiaomi/sagitPkg/Include/ACPI.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#FILE FREEFORM = 7E374E25-8E01-4FEE-87F2-390C23C606CD {
# SECTION RAW = MSM8998/APIC.aml
# SECTION RAW = MSM8998/BERT.aml
# SECTION RAW = MSM8998/BGRT.aml
# SECTION RAW = MSM8998/CSRT.aml
# SECTION RAW = MSM8998/DBG2.aml
# SECTION RAW = MSM8998/DSDT.aml
# SECTION RAW = MSM8998/FACP.aml
# SECTION RAW = MSM8998/FPDT.aml
# SECTION RAW = MSM8998/GTDT.aml
# SECTION RAW = MSM8998/IORT.aml
# SECTION RAW = MSM8998/MCFG.aml
# SECTION RAW = MSM8998/MSDM.aml
# SECTION RAW = MSM8998/PPTT.aml
# SECTION RAW = MSM8998/SPCR.aml
# SECTION RAW = MSM8998/TPM2.aml
# SECTION RAW = MSM8998/XSDT.aml
# SECTION UI = "AcpiTables"
#}
#
125 changes: 125 additions & 0 deletions Platforms/Xiaomi/sagitPkg/Include/APRIORI.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
APRIORI DXE {
# First, install the PCD driver and call DxeInit
INF MdeModulePkg/Core/Dxe/DxeMain.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf

INF Binaries/sagit/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

# Next, install cpu protocol and enable the interrupt controller
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf

# Core Drivers
INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf

INF Binaries/generic/CobaltWP/SmemDxe/SmemDxe.inf

INF QcomPkg/Drivers/DynamicRamDxe/DynamicRamDxe.inf

INF Binaries/generic/CobaltWP/DALSys/DALSys.inf
INF Binaries/generic/CobaltWP/HWIODxeDriver/HWIODxeDriver.inf
INF Binaries/generic/CobaltWP/ChipInfo/ChipInfo.inf
INF Binaries/generic/CobaltWP/PlatformInfoDxeDriver/PlatformInfoDxeDriver.inf

INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf

INF Binaries/generic/CobaltWP/GlinkDxe/GlinkDxe.inf
INF Binaries/generic/CobaltWP/ULogDxe/ULogDxe.inf
INF Binaries/generic/CobaltWP/NpaDxe/NpaDxe.inf
INF Binaries/generic/CobaltWP/ClockDxe/ClockDxe.inf

INF QcomPkg/Drivers/ClockSpeedUpDxe/ClockSpeedUpDxe.inf

INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf

INF Binaries/generic/CobaltWP/SdccDxe/SdccDxe.inf
INF Binaries/generic/CobaltWP/UFSDxe/UFSDxe.inf

INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
INF FatPkg/EnhancedFatDxe/Fat.inf

INF Binaries/sagit/QcomPkg/Drivers/QdssDxe/QdssDxe.inf

INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf

# DppDxe

INF EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf
INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
INF MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf

INF Binaries/poplar/QcomPkg/Drivers/FontDxe/FontDxe.inf

INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf

INF Binaries/generic/CobaltWP/DALTLMM/DALTLMM.inf
INF Binaries/generic/CobaltWP/I2C/I2C.inf
INF Binaries/generic/CobaltWP/SPMI/SPMI.inf
INF Binaries/generic/CobaltWP/SPI/SPI.inf
INF Binaries/generic/CobaltWP/PmicDxe/PmicDxe.inf
INF Binaries/generic/CobaltWP/AdcDxe/AdcDxe.inf
# INF Binaries/poplar/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.inf
INF Binaries/generic/CobaltWP/UsbfnDwc3Dxe/UsbfnDwc3Dxe.inf

INF Binaries/generic/CobaltWP/XhciPciEmulation/XhciPciEmulation.inf
INF Binaries/generic/CobaltWP/XhciDxe/XhciDxe.inf

INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
INF Binaries/generic/CobaltWP/UsbKbDxe/UsbKbDxe.inf
INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
INF Binaries/generic/CobaltWP/UsbTypeCDxe/UsbTypeCDxe.inf
INF Binaries/generic/CobaltWP/UsbInitDxe/UsbInitDxe.inf
INF Binaries/generic/CobaltWP/UsbfnChgDxe/UsbfnChgDxe.inf
INF Binaries/generic/CobaltWP/UsbMouseDxe/UsbMouseDxe.inf
INF Binaries/generic/CobaltWP/UsbMsdDxe/UsbMsdDxe.inf
INF Binaries/generic/CobaltWP/UsbDeviceDxe/UsbDeviceDxe.inf
INF Binaries/generic/CobaltWP/UsbConfigDxe/UsbConfigDxe.inf

# DebugPortDxe
# SerialDxe

INF EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf
INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf

INF Binaries/sagit/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.inf
# TsFwUpgradeDxe
# INF Binaries/sagit/QcomPkg/Drivers/TsensDxe/TsensDxe.inf

!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1
INF Binaries/sagit/QcomPkg/Drivers/DisplayDxe/DisplayDxe.inf
!else
INF SiliciumPkg/Drivers/SimpleFbDxe/SimpleFbDxe.inf
!endif

# INF Binaries/sagit/QcomPkg/Drivers/TzDxe/TzDxeLA.inf
# INF Binaries/sagit/QcomPkg/Drivers/LimitsDxe/LimitsDxe.inf
# INF Binaries/sagit/QcomPkg/Drivers/MdtpDxe/MdtpDxe.inf

INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf

# INF Binaries/sagit/QcomPkg/Drivers/HashDxe/HashDxe.inf
# INF Binaries/sagit/QcomPkg/Drivers/RNGDxe/RngDxe.inf
# OSConfigDxe
# MpParkDxe
INF Binaries/generic/CobaltWP/MpPowerDxe/MpPowerDxe.inf

INF MSM8998Pkg/Drivers/SmBiosTableDxe/SmBiosTableDxe.inf

# MemoryMapDxe
# AdapterInformationDxe
}
104 changes: 104 additions & 0 deletions Platforms/Xiaomi/sagitPkg/Include/DXE.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# First, install the PCD driver and call DxeInit
INF MdeModulePkg/Core/Dxe/DxeMain.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf

INF Binaries/sagit/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

# Next, install cpu protocol and enable the interrupt controller
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf

# Core Drivers
INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf

INF Binaries/generic/CobaltWP/SmemDxe/SmemDxe.inf

INF QcomPkg/Drivers/DynamicRamDxe/DynamicRamDxe.inf

INF Binaries/generic/CobaltWP/DALSys/DALSys.inf
INF Binaries/generic/CobaltWP/HWIODxeDriver/HWIODxeDriver.inf
INF Binaries/generic/CobaltWP/ChipInfo/ChipInfo.inf
INF Binaries/generic/CobaltWP/PlatformInfoDxeDriver/PlatformInfoDxeDriver.inf

INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf

INF Binaries/generic/CobaltWP/GlinkDxe/GlinkDxe.inf
INF Binaries/generic/CobaltWP/ULogDxe/ULogDxe.inf
INF Binaries/generic/CobaltWP/NpaDxe/NpaDxe.inf
INF Binaries/generic/CobaltWP/ClockDxe/ClockDxe.inf

INF QcomPkg/Drivers/ClockSpeedUpDxe/ClockSpeedUpDxe.inf

INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf

INF Binaries/generic/CobaltWP/SdccDxe/SdccDxe.inf
INF Binaries/generic/CobaltWP/UFSDxe/UFSDxe.inf

INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
INF FatPkg/EnhancedFatDxe/Fat.inf

INF Binaries/sagit/QcomPkg/Drivers/QdssDxe/QdssDxe.inf

INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf

# DppDxe

INF EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf
INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
INF MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf

INF Binaries/poplar/QcomPkg/Drivers/FontDxe/FontDxe.inf

INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf

INF Binaries/generic/CobaltWP/DALTLMM/DALTLMM.inf
INF Binaries/generic/CobaltWP/I2C/I2C.inf
INF Binaries/generic/CobaltWP/SPMI/SPMI.inf
INF Binaries/generic/CobaltWP/SPI/SPI.inf
INF Binaries/generic/CobaltWP/PmicDxe/PmicDxe.inf
INF Binaries/generic/CobaltWP/AdcDxe/AdcDxe.inf
# INF Binaries/poplar/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.inf
INF Binaries/generic/CobaltWP/UsbfnDwc3Dxe/UsbfnDwc3Dxe.inf

INF Binaries/generic/CobaltWP/XhciPciEmulation/XhciPciEmulation.inf
INF Binaries/generic/CobaltWP/XhciDxe/XhciDxe.inf

INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
INF Binaries/generic/CobaltWP/UsbKbDxe/UsbKbDxe.inf
INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
INF Binaries/generic/CobaltWP/UsbTypeCDxe/UsbTypeCDxe.inf
INF Binaries/generic/CobaltWP/UsbInitDxe/UsbInitDxe.inf
INF Binaries/generic/CobaltWP/UsbfnChgDxe/UsbfnChgDxe.inf
INF Binaries/generic/CobaltWP/UsbMouseDxe/UsbMouseDxe.inf
INF Binaries/generic/CobaltWP/UsbMsdDxe/UsbMsdDxe.inf
INF Binaries/generic/CobaltWP/UsbDeviceDxe/UsbDeviceDxe.inf
INF Binaries/generic/CobaltWP/UsbConfigDxe/UsbConfigDxe.inf

# DebugPortDxe
# SerialDxe

INF EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf
INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf

INF Binaries/sagit/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.inf
# TsFwUpgradeDxe
# INF Binaries/sagit/QcomPkg/Drivers/TsensDxe/TsensDxe.inf

!if $(USE_CUSTOM_DISPLAY_DRIVER) == 1
INF Binaries/sagit/QcomPkg/Drivers/DisplayDxe/DisplayDxe.inf
!else
INF SiliciumPkg/Drivers/SimpleFbDxe/SimpleFbDxe.inf
!endif
24 changes: 24 additions & 0 deletions Platforms/Xiaomi/sagitPkg/Include/RAW.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FILE FREEFORM = A91D838E-A5FA-4138-825D-455E2303079E {
SECTION UI = "BDS_Menu.cfg"
SECTION RAW = Binaries/poplar/RawFiles/BDS_Menu.cfg
}

FILE FREEFORM = A1E235DE-E825-4591-9623-C43175811826 {
SECTION UI = "SecParti.cfg"
SECTION RAW = Binaries/poplar/RawFiles/SecParti.cfg
}

FILE FREEFORM = F12A1F3D-4318-A006-5F7F-3FAAF6DBB4B5 {
SECTION UI = "tracer_event.cfg"
SECTION RAW = Binaries/poplar/RawFiles/tracer_event.cfg
}

FILE FREEFORM = 45FE4B7C-150C-45DA-A021-4BEB2048EC6F {
SECTION UI = "QcomChargerCfg.cfg"
SECTION RAW = Binaries/poplar/RawFiles/QcomChargerCfg.cfg
}

FILE FREEFORM = F780C779-DD7C-47CD-BD1A-5EB414C51704 {
SECTION UI = "BATTERY.PROVISION"
SECTION RAW = Binaries/poplar/RawFiles/BATTERY.PROVISION
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include <Library/DeviceConfigurationMapLib.h>

STATIC
CONFIGURATION_DESCRIPTOR_EX
gDeviceConfigurationDescriptorEx[] = {
// Configuration Map
{"NumCpusFuseAddr", 0x5C04C},
{"EnableShell", 0x1},
{"SharedIMEMBaseAddr", 0x146BF000},
{"DloadCookieAddr", 0x01FD3000},
{"DloadCookieValue", 0x10},
{"MemoryCaptureModeOffset", 0x1C},
{"AbnormalResetOccurredOffset", 0x24},
{"DBIDumpDDRBase", 0x9FFD0000},
{"NumCpus", 4},
{"NumActiveCores", 8},
{"MaxLogFileSize", 0x400000},
{"USBHS1_Config", 0x0},
{"UsbFnIoRevNum", 0x00010001},
{"PwrBtnShutdownFlag", 0x0},
{"Sdc1GpioConfigOn", 0x1E92},
{"Sdc2GpioConfigOn", 0x1E92},
{"Sdc1GpioConfigOff", 0xA00},
{"Sdc2GpioConfigOff", 0xA00},
{"EnableSDHCSwitch", 0x1},
{"PSHoldOffset", 0xC000},
{"PSHoldSHFT", 0x0},
{"GCCResetValueAddress", 0x146BF028},
{"SecurityFlag", 0xC4},
{"TzAppsRegnAddr", 0x86D00000},
{"TzAppsRegnSize", 0x02200000},
{"EnableLogFsSyncInRetail", 0x0},
{"EnableSecurityHoleForSplashPartition", 0x0},

// Terminator
{"Terminator", 0xFFFFFFFF}
};

CONFIGURATION_DESCRIPTOR_EX*
GetDeviceConfigurationMap ()
{
return gDeviceConfigurationDescriptorEx;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = DeviceConfigurationMapLib
FILE_GUID = D7DDE228-62E4-43E3-B5A1-AB29FB9B0A35
MODULE_TYPE = BASE
VERSION_STRING = 1.0
LIBRARY_CLASS = DeviceConfigurationMapLib

[Sources]
DeviceConfigurationMapLib.c

[Packages]
MdePkg/MdePkg.dec
QcomPkg/QcomPkg.dec
Loading