it is funny that the solution of this zen4 problem is inside not loved boot loader, and that that boot loader doesn't workIf it performs better with correct values reported as it should then you could try merging into OC and building to test,
Check here, https://github.com/CloverHackyColor/CloverBootloader/blob/master/rEFIt_UEFI/Platform/cpu.cpp#L960
For now there is no proper guide for AM5, but let us know when you get the parts.Holy Cow what incredible timing my parts arrive tomorrow. Thank you all so much for your work. Is there a default EFI folder with all the goodness inside or do we need to hold off a bit until the kinks are worked out?
That which shall not be named can now be named.it is funny that the solution of this zen4 problem is inside not loved boot loader, and that that boot loader doesn't work
That which shall not be named can now be named.
And yes, in a twist of irony the solution was derived from Clover and yet Clover does not implement that in a manner suitable for AM5.
if (Cpu->Vendor[0] == CPUID_VENDOR_INTEL) {
busFreqValue = CpuInfo->FSBFrequency;
busFCvtt2nValue = DivU64x64Remainder ((1000000000ULL << 32), busFreqValue, NULL);
busFCvtn2tValue = DivU64x64Remainder (0xFFFFFFFFFFFFFFFFULL, busFCvtt2nValue, NULL);
tscFreqValue = CpuInfo->CPUFrequency;
tscFCvtt2nValue = DivU64x64Remainder ((1000000000ULL << 32), tscFreqValue, NULL);
tscFCvtn2tValue = DivU64x64Remainder (0xFFFFFFFFFFFFFFFFULL, tscFCvtt2nValue, NULL);
} else if (Cpu->Vendor[0] == CPUID_VENDOR_AMD) {
busFreqValue = CpuInfo->FSBFrequency;
busFCvtt2nValue = DivU64x64Remainder ((1000000000ULL << 32), busFreqValue, NULL);
busFCvtn2tValue = DivU64x64Remainder(((1 * Giga) << 32), busFCvtt2nValue, NULL);
tscFreqValue = CpuInfo->CPUFrequency;
tscFCvtt2nValue = DivU64x64Remainder ((1000000000ULL << 32), tscFreqValue, NULL);
tscFCvtn2tValue = DivU64x64Remainder(((1 * Giga) << 32), tscFCvtt2nValue, NULL);
}
I can test that on both AM5 and AM4. @ExtremeXT has a different AM4, so we need it tested there as well. @mariettosun has ThreadRipper.Clovers AMD source is basically from the old XNU kernels from Bronya
As this modification doesn't seem to affect non APU AMD models I'm thinking of just splitting it between Intel and AMD to make it easier.
…
Yes, I promised to do that and I will hold myself to that pledge. The weekend is here so you can expect an update soon. It is, however, 1:50am in Silicon Valley, which means I woke up about 40 minutes early. Which also means I’m sitting by the fireplace sipping a nice hot cup of pour-over coffee while enjoying this Zen moment…oh oh I mean this Zen 4 moment.
There is someone with an AM4 APU on the AMD OS X Discord server who tested the other OpenCore build last time, I'll ask them to test this one as well.I can test that on both AM5 and AM4. @ExtremeXT has a different AM4, so we need it tested there as well. @mariettosun has ThreadRipper.
Anyone have a Zen 2 or Zen 3 APU?
@Shaneee Can you fork OpenCorePkg and commit the changes? Will make it easier to PR later.
The new calculation is inspired by Clover, but not identical to it. We also see in the table posted by CaseySJ that some TSC-related values, which I suppose derive from secondary calculations, have values which match neither those derived from Clover nor those derived from regular OpenCore.it is funny that the solution of this zen4 problem is inside not loved boot loader, and that that boot loader doesn't work
What is this system which "does not need it"? Zen2/3 without iGPU (as in your Threadripper)? Intel?by the way, tested @Shaneee modified Opencore on a system does not need of it, it works well and it seems does not produces any side and wrong beahviour
testing a bit more on Heavy audio and CPU task!
Interim Update #16:
Golden Build Status Means:
- I have the distinct pleasure of penning this 16th update...
- This thread began on September 30 with @PoMpIs who took a bold step in purchasing the new unproven AM5 platform
- Today, about six and a half weeks later, we arrived at Golden Build status
- The challenges with AM5 were significant and perplexing, but with great teamwork and perseverance we managed to find a way
- We should all raise a toast to teamwork
- All on-board devices work
- All cores are properly time-stamp synchronized
- Sleep, Wake, Reboot and Shutdown work properly
- Big Sur, Monterey and Ventura are fully operational
- System is stable, lightning fast in response, and eminently usable as a primary system
Is audio also working perfectly? And I thought you sold your AM5 machine, did you get it back? Is there anything else not working properly? Are you on the beta BIOS?I'm testing all the new features on an Asus x670e Hero, and everything works.
You are geniuses... thank you very much for the hard work..
@Shaneee if you want you can modify my initial post and replace it with CaseySJ's where he was putting all the updates... it would be more accessible in post number 1
Is audio also working perfectly? And I thought you sold your AM5 machine, did you get it back? Is there anything else not working properly? Are you on the beta BIOS?
Thanks! That pseudo-code makes the change easier to understand.As this modification doesn't seem to affect non APU AMD models I'm thinking of just splitting it between Intel and AMD to make it easier.
Code:if (Cpu->Vendor[0] == CPUID_VENDOR_INTEL) { busFreqValue = CpuInfo->FSBFrequency; busFCvtt2nValue = DivU64x64Remainder ((1000000000ULL << 32), busFreqValue, NULL); busFCvtn2tValue = DivU64x64Remainder (0xFFFFFFFFFFFFFFFFULL, busFCvtt2nValue, NULL); tscFreqValue = CpuInfo->CPUFrequency; tscFCvtt2nValue = DivU64x64Remainder ((1000000000ULL << 32), tscFreqValue, NULL); tscFCvtn2tValue = DivU64x64Remainder (0xFFFFFFFFFFFFFFFFULL, tscFCvtt2nValue, NULL); } else if (Cpu->Vendor[0] == CPUID_VENDOR_AMD) { busFreqValue = CpuInfo->FSBFrequency; busFCvtt2nValue = DivU64x64Remainder ((1000000000ULL << 32), busFreqValue, NULL); busFCvtn2tValue = DivU64x64Remainder(((1 * Giga) << 32), busFCvtt2nValue, NULL); tscFreqValue = CpuInfo->CPUFrequency; tscFCvtt2nValue = DivU64x64Remainder ((1000000000ULL << 32), tscFreqValue, NULL); tscFCvtn2tValue = DivU64x64Remainder(((1 * Giga) << 32), tscFCvtt2nValue, NULL); }
// Perform TSC and FSB calculations. This is traditionally done in tsc.c in XNU.
//
busFreqValue = CpuInfo->FSBFrequency;
busFCvtt2nValue = DivU64x64Remainder ((1000000000ULL << 32), busFreqValue, NULL);
busFCvtn2tValue = DivU64x64Remainder (0xFFFFFFFFFFFFFFFFULL, busFCvtt2nValue, NULL);
tscFreqValue = CpuInfo->CPUFrequency;
tscFCvtt2nValue = DivU64x64Remainder ((1000000000ULL << 32), tscFreqValue, NULL);
tscFCvtn2tValue = DivU64x64Remainder (0xFFFFFFFFFFFFFFFFULL, tscFCvtt2nValue, NULL);
busFrequency = DivU64(gCPUStructure.TSCFrequency, currcoef);
busFCvtt2n = DivU64(((1 * Giga) << 32), busFrequency);
// busFCvtn2t = DivU64(0xFFFFFFFFFFFFFFFFULL, busFCvtt2n);
tscFCvtt2n = DivU64(busFCvtt2n, currcoef);
cpuFrequency = DivU64(((1 * Giga) << 32), tscFCvtt2n);