make a bridge to new quirks

Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
SergeySlice 2021-10-30 11:21:39 +03:00
parent e036b3d54b
commit 05615c24f4
9 changed files with 92 additions and 6 deletions

View File

@ -1140,6 +1140,8 @@
<integer>0</integer>
<key>RebuildAppleMemoryMap</key>
<false/>
<key>ResizeAppleGpuBars</key>
<integer>-1</integer>
<key>SetupVirtualMap</key>
<true/>
<key>SignalAppleOS</key>

View File

@ -186,10 +186,10 @@ if [[ -x "${DIR_TOOLS}"/Scripts/build.sh ]]; then
else
local parameter=${1:-none}
if [[ "${parameter}" == HFSPlus ]]; then
#./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -D USE_APPLE_HFSPLUS_DRIVER -t $MYTOOLCHAIN
./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -D USE_APPLE_HFSPLUS_DRIVER -t $MYTOOLCHAIN
./ebuild.sh -fr -D NO_GRUB_DRIVERS_EMBEDDED -D USE_APPLE_HFSPLUS_DRIVER -t $MYTOOLCHAIN
else
#./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -t $MYTOOLCHAIN
./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -t $MYTOOLCHAIN
./ebuild.sh -fr -D NO_GRUB_DRIVERS_EMBEDDED -D LESS_DEBUG -t $MYTOOLCHAIN
fi
fi

View File

@ -2097,8 +2097,9 @@ printf("%s", "");
XBool ProtectSecureBoot = false;
XBool ProtectUefiServices = false;
XBool ProvideCustomSlide = false;
uint8_t ProvideMaxSlide = false;
uint8_t ProvideMaxSlide = 0;
XBool RebuildAppleMemoryMap = false;
int8_t ResizeAppleGpuBars = -1;
XBool SetupVirtualMap = false;
XBool SignalAppleOS = false;
XBool SyncRuntimePermissions = false;
@ -2122,6 +2123,7 @@ printf("%s", "");
if ( !(ProvideCustomSlide == other.ProvideCustomSlide) ) return false;
if ( !(ProvideMaxSlide == other.ProvideMaxSlide) ) return false;
if ( !(RebuildAppleMemoryMap == other.RebuildAppleMemoryMap) ) return false;
if ( !(ResizeAppleGpuBars == other.ResizeAppleGpuBars) ) return false;
if ( !(SetupVirtualMap == other.SetupVirtualMap) ) return false;
if ( !(SignalAppleOS == other.SignalAppleOS) ) return false;
if ( !(SyncRuntimePermissions == other.SyncRuntimePermissions) ) return false;
@ -2143,6 +2145,7 @@ printf("%s", "");
ProvideCustomSlide = other.dgetProvideCustomSlide();
ProvideMaxSlide = other.dgetProvideMaxSlide();
RebuildAppleMemoryMap = other.dgetRebuildAppleMemoryMap();
ResizeAppleGpuBars = other.dgetResizeAppleGpuBars();
SetupVirtualMap = other.dgetSetupVirtualMap();
SignalAppleOS = other.dgetSignalAppleOS();
SyncRuntimePermissions = other.dgetSyncRuntimePermissions();

View File

@ -497,7 +497,7 @@ const radeon_card_info_t radeon_cards[] = {
{ 0x6981, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x6985, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x6986, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x6987, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x6987, CHIP_FAMILY_GREENLAND, "AMD Radeon RX640", kNull },
{ 0x6995, CHIP_FAMILY_GREENLAND, "AMD Radeon Polaris 12", kNull },
{ 0x699F, CHIP_FAMILY_GREENLAND, "AMD Radeon RX550", kNull },
@ -1094,6 +1094,65 @@ Catalina
0x731F1002
*/
//
/*
* Native ID for Monterey 12.0.1
AMD7000
0x67901002 0x67981002 0x679A1002 0x679E1002 0x67801002 0x68201002 0x68211002 0x68231002 0x68251002 0x68271002 0x682B1002 0x682D1002 0x682F1002 0x68351002 0x68391002 0x683B1002 0x683D1002 0x683F1002 0x68001002 0x68011002 0x68061002 0x68081002 0x68101002 0x68181002 0x68191002
AMD8000
0x66401002 0x66411002 0x66461002 0x66471002 0x66501002 0x66511002 0x665C1002 0x665D1002 0x67B01002
AMD9000
0x69201002 0x69211002 0x69301002 0x69381002 0x69391002 0x73001002 0x730F1002
AMD9500
0x67E01002 0x67E31002 0x67E81002 0x67EB1002 0x67EF1002 0x67FF1002 0x67E11002 0x67E71002 0x67E91002 0x67C01002 0x67C11002 0x67C21002 0x67C41002 0x67C71002 0x67DF1002 0x67D01002 0x67C81002 0x67C91002 0x67CA1002 0x67CC1002 0x67CF1002
AMD10000
0x68601002 0x68611002 0x68621002 0x68631002 0x68641002 0x68671002 0x68681002 0x68691002 0x686A1002 0x686B1002 0x686C1002 0x686D1002 0x686E1002 0x687F1002 0x69A01002 0x69A11002 0x69A21002 0x69A31002 0x69AF1002 0x66A01002 0x66A11002 0x66A21002 0x66A31002 0x66A71002 0x66AF1002
X4000
Buffin
0x67E01002 0x67E31002 0x67E81002 0x67EB1002 0x67EF1002 0x67FF1002 0x67E11002 0x67E71002 0x67E91002
Bonair
0x66401002 0x66411002 0x66461002 0x66471002 0x66501002 0x66511002 0x665C1002 0x665D1002
Ellesmere
0x67C01002 0x67C11002 0x67C21002 0x67C41002 0x67C71002 0x67DF1002 0x67D01002 0x67C81002 0x67C91002 0x67CA1002 0x67CC1002 0x67CF1002
Fiji
0x73001002 0x730F1002
Hawaii
0x67B01002
Pitcairn
0x68001002 0x68011002 0x68061002 0x68081002 0x68101002 0x68181002 0x68191002
Tahiti
0x67901002 0x67981002 0x679A1002 0x679E1002 0x67801002
Tonga
0x69201002 0x69211002 0x69301002 0x69381002 0x69391002
Verde
0x68201002 0x68211002 0x68231002 0x68251002 0x68271002 0x682B1002 0x682D1002 0x682F1002 0x68351002 0x68391002 0x683B1002 0x683D1002 0x683F1002
X5000
Vega10
0x68601002 0x68611002 0x68621002 0x68631002 0x68641002 0x68671002 0x68681002 0x68691002 0x686A1002 0x686B1002 0x686C1002 0x686D1002 0x686E1002 0x686F1002 0x687F1002
Vega12
0x69A01002 0x69A11002 0x69A21002 0x69A31002 0x69AF1002
Vega20
0x66A01002 0x66A11002 0x66A21002 0x66A31002 0x66A71002 0x66AF1002
X6000
Navi10
0x73101002 0x73121002 0x73181002 0x73191002 0x731A1002 0x731B1002 0x731F1002
Navi12
0x73601002
Navi14
0x73401002 0x73411002 0x73431002 0x73471002 0x734F1002
Navi21
0x73A21002 0x73AB1002 0x73BF1002 0x73A31002
*/
const CHAR8 *chip_family_name[] = {
"UNKNOW",

View File

@ -189,6 +189,7 @@ void GetCPUProperties (void)
gCPUStructure.ExtFeatures = quad(gCPUStructure.CPUID[CPUID_81][ECX], gCPUStructure.CPUID[CPUID_81][EDX]);
DBG(" The CPU%s supported SSE4.1\n", (gCPUStructure.Features & CPUID_FEATURE_SSE4_1)?"":" not");
DBG(" The CPU%s supported RDRAND\n", (gCPUStructure.Features & CPUID_FEATURE_RDRAND)?"":" not");
/* Pack CPU Family and Model */
if (gCPUStructure.Family == 0x0f) {
gCPUStructure.Family += gCPUStructure.Extfamily;

View File

@ -98,6 +98,7 @@ public:
XmlBool ProvideCustomSlide = XmlBool();
XmlUInt8 ProvideMaxSlide = XmlUInt8();
XmlBool RebuildAppleMemoryMap = XmlBool();
XmlInt8 ResizeAppleGpuBars = XmlInt8();
XmlBool SetupVirtualMap = XmlBool();
XmlBool SignalAppleOS = XmlBool();
XmlBool SyncRuntimePermissions = XmlBool();
@ -116,6 +117,7 @@ public:
XBool dgetProvideCustomSlide() const { return ProvideCustomSlide.isDefined() ? ProvideCustomSlide.value() : ProvideCustomSlide.nullValue; };
uint8_t dgetProvideMaxSlide() const { return ProvideMaxSlide.isDefined() ? ProvideMaxSlide.value() : ProvideMaxSlide.nullValue; };
XBool dgetRebuildAppleMemoryMap() const { return RebuildAppleMemoryMap.isDefined() ? RebuildAppleMemoryMap.value() : RebuildAppleMemoryMap.nullValue; };
int8_t dgetResizeAppleGpuBars() const { return ResizeAppleGpuBars.isDefined() ? ResizeAppleGpuBars.value() : (-1); };
XBool dgetSetupVirtualMap() const { return parent.isDefined() ? SetupVirtualMap.isDefined() ? SetupVirtualMap.value() : XBool(true) : SetupVirtualMap.nullValue; }; // TODO: different default value if section is not defined
XBool dgetSignalAppleOS() const { return SignalAppleOS.isDefined() ? SignalAppleOS.value() : SignalAppleOS.nullValue; };
XBool dgetSyncRuntimePermissions() const { return parent.isDefined() ? SyncRuntimePermissions.isDefined() ? SyncRuntimePermissions.value() : XBool(true) : XBool(false); }; // TODO: different default value if section is not defined
@ -131,7 +133,7 @@ public:
OcKernelQuirks_Class OcKernelQuirks;
OcBooterQuirks_Class OcBooterQuirks;
XmlDictField m_fields[31] = {
XmlDictField m_fields[32] = {
{"AvoidRuntimeDefrag", OcBooterQuirks.AvoidRuntimeDefrag},
{"DevirtualiseMmio", OcBooterQuirks.DevirtualiseMmio},
{"DisableSingleUser", OcBooterQuirks.DisableSingleUser},
@ -146,6 +148,7 @@ public:
{"ProvideCustomSlide", OcBooterQuirks.ProvideCustomSlide},
{"ProvideMaxSlide", OcBooterQuirks.ProvideMaxSlide},
{"RebuildAppleMemoryMap", OcBooterQuirks.RebuildAppleMemoryMap},
{"ResizeAppleGpuBars", OcBooterQuirks.ResizeAppleGpuBars},
{"SetupVirtualMap", OcBooterQuirks.SetupVirtualMap},
{"SignalAppleOS", OcBooterQuirks.SignalAppleOS},
{"SyncRuntimePermissions", OcBooterQuirks.SyncRuntimePermissions},

View File

@ -26,6 +26,7 @@
#define QUIRK_VIRT bit(13)
#define QUIRK_OS bit(14)
#define QUIRK_PERM bit(15)
#define QUIRK_GPUBAR bit(16)

View File

@ -1016,6 +1016,7 @@ void LOADER_ENTRY::StartLoader()
mOpenCoreConfiguration.Booter.Quirks.ProvideCustomSlide = gSettings.Quirks.OcBooterQuirks.ProvideCustomSlide;
mOpenCoreConfiguration.Booter.Quirks.ProvideMaxSlide = gSettings.Quirks.OcBooterQuirks.ProvideMaxSlide;
mOpenCoreConfiguration.Booter.Quirks.RebuildAppleMemoryMap = gSettings.Quirks.OcBooterQuirks.RebuildAppleMemoryMap;
mOpenCoreConfiguration.Booter.Quirks.ResizeAppleGpuBars = gSettings.Quirks.OcBooterQuirks.ResizeAppleGpuBars;
mOpenCoreConfiguration.Booter.Quirks.SetupVirtualMap = gSettings.Quirks.OcBooterQuirks.SetupVirtualMap;
mOpenCoreConfiguration.Booter.Quirks.SignalAppleOS = gSettings.Quirks.OcBooterQuirks.SignalAppleOS;
mOpenCoreConfiguration.Booter.Quirks.SyncRuntimePermissions = gSettings.Quirks.OcBooterQuirks.SyncRuntimePermissions;

View File

@ -455,6 +455,8 @@ void FillInputs(XBool New)
InputItems[InputItemsCount++].SValue.SWPrintf("0x%016llX", gSettings.Smbios.ExtendedFirmwareFeatures);
InputItems[InputItemsCount].ItemType = Hex; //126
InputItems[InputItemsCount++].SValue.SWPrintf("0x%016llX", gSettings.Smbios.ExtendedFirmwareFeaturesMask);
InputItems[InputItemsCount].ItemType = Decimal; //127
InputItems[InputItemsCount++].SValue.SWPrintf("%04d", gSettings.Quirks.OcBooterQuirks.ResizeAppleGpuBars);
@ -1089,6 +1091,19 @@ void ApplyInputs(void)
gSettings.Smbios.ExtendedFirmwareFeaturesMask = StrHexToUint64(InputItems[i].SValue.wc_str());
DBG("applied ExtendedFirmwareFeaturesMask=0x%llX\n", gSettings.Smbios.ExtendedFirmwareFeaturesMask);
}
i++; //127
if (InputItems[i].Valid) {
INTN Minus = 0;
if (InputItems[i].SValue[0] == '-') {
Minus = 1;
}
gSettings.Quirks.OcBooterQuirks.ResizeAppleGpuBars = StrDecimalToUintn(InputItems[i].SValue.data(Minus));
if (Minus) {
gSettings.Quirks.OcBooterQuirks.ResizeAppleGpuBars = -gSettings.Quirks.OcBooterQuirks.ResizeAppleGpuBars;
}
DBG(" set GpuBar = %d\n", gSettings.Quirks.OcBooterQuirks.ResizeAppleGpuBars);
}
if (NeedSave) {
ApplySettings();
@ -2581,11 +2596,12 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuQuirks()
SubScreen->AddMenuCheck("ProtectMemoryRegions", QUIRK_REGION, 101);
SubScreen->AddMenuCheck("ProtectSecureBoot", QUIRK_SECURE, 101);
SubScreen->AddMenuCheck("ProtectUefiServices", QUIRK_UEFI, 101);
SubScreen->AddMenuItemInput(123, "ProvideConsoleGopEnable", false);
// SubScreen->AddMenuItemInput(123, "ProvideConsoleGopEnable", false);
SubScreen->AddMenuCheck("ProvideCustomSlide", QUIRK_CUSTOM, 101);
//decimal
SubScreen->AddMenuItemInput(122, "ProvideMaxSlide:", true);
SubScreen->AddMenuCheck("RebuildAppleMemoryMap", QUIRK_MAP, 101);
SubScreen->AddMenuItemInput(127, "ResizeAppleGpuBars:", true);
SubScreen->AddMenuCheck("SetupVirtualMap", QUIRK_VIRT, 101);
SubScreen->AddMenuCheck("SignalAppleOS", QUIRK_OS, 101);
SubScreen->AddMenuCheck("SyncRuntimePermissions", QUIRK_PERM, 101);