LongSoft / UEFITool

UEFI firmware image viewer and editor
BSD 2-Clause "Simplified" License
4.39k stars 628 forks source link

Support for Broadwell E #60

Closed Piker-Alpha closed 8 years ago

Piker-Alpha commented 8 years ago

Hi,

I ran:

./UEFIPatch X99-E-ASUS-0601.CAP

And got this output:

parseImageFile: Aptio capsule signature may become invalid after image modifications parseSection: section with unknown type 52h parseFile: non-empty pad-file contents will be destroyed after volume modifications parseSection: section with unknown type 52h parseFile: non-empty pad-file contents will be destroyed after volume modifications No patches can be applied to input file

Can this be fixed?

NikolajSchlej commented 8 years ago

Hi Pike,

please try this patch:

# PpmInitialize | Broadwell-E
3FFCAE95-23CF-4967-94F5-16352F68E43B 10 P:0FBA6C24400F:0FBA7424400F 
Piker-Alpha commented 8 years ago

Done. Got this output:

parseImageFile: Aptio capsule signature may become invalid after image modifications parseSection: section with unknown type 52h parseFile: non-empty pad-file contents will be destroyed after volume modifications parseSection: section with unknown type 52h parseFile: non-empty pad-file contents will be destroyed after volume modifications patch: replaced 6 bytes at offset F69h 0FBA6C24400F -> 0FBA7424400F Image patched

One thing that I noticed is that the patched file is 2 bytes shorter. Will that be a problem?

NikolajSchlej commented 8 years ago

2 bytes difference could be a problem, yes. Dunno where it comes from. Can you attach or link the file?

Piker-Alpha commented 8 years ago

Sure. Two files attached. Thank you for looking into this!

X99-E-ASUS-0601.CAP.zip X99-E-ASUS-0601.CAP.patched.zip

giacomoleopardo commented 8 years ago

Pike, I see equal size from the info window of your files. Do you have some other way to check it?

Piker-Alpha commented 8 years ago

I feel stupid. You are right. I apologise for the error. I have no idea what I did. Time to check out the patched BIOS.

Thank you for letting me know!

Piker-Alpha commented 8 years ago

Ok I went for it and tried to flash the patched BIOS with the Asus EZ Flash 3 Utility v03.00 (from the BIOS) and got this error: "Selected file is not a proper BIOS".

Edit: Here are the MD5 checksums of the files that I have here:

MD5 (X99-E-ASUS-0601.CAP) = 04eb31b2d15a5bcf026329d6c45e0faf MD5 (X99-E-ASUS-0601.CAP.patched) = 24b91c0e4e87225e8a9df5531ce6104a

NikolajSchlej commented 8 years ago

Have you tried USB BIOS Flashback? Newer ASUS boards refuse to flash modified BIOS files with standard tools, and old AFU /GAN method doesn't work either. There is a workaround for it, but it's had to perform a generic way, and UBF flashes everything, so if it's an option for that board - I would try it first.

Piker-Alpha commented 8 years ago

I have not, but I will do that today (have five new BIOS chips handy). Thanks.

Edit: Correction. There is no USB BIOS Flashback on this motherboard, only Asus CrashFree BIOS 3 plus a DOS utility on a CD-ROM.

NikolajSchlej commented 8 years ago

Then I would buy some cheap CH341A-based SPI programmer like this and forget about software tools and protections.

Piker-Alpha commented 8 years ago

Ok thanks. This is for The big Asus X99-E plus i7-6850K give away so I'll add it to the list.

What software do I need for this?

NikolajSchlej commented 8 years ago

Latest flashrom builds are supporting this programmer, AFAIK.

giacomoleopardo commented 8 years ago

I’ve just flashed Asus X99-A II bios with an old version of Afudos (download here) with

I can’t check if it works because I don’t even get the OSX El Capitan 10.11.6 installer. With the intel i7 6900k cpu. Windows works good. I need some help to know how to patch the kernel, I guess. Pike’s thread is too much for my knowledge

NikolajSchlej commented 8 years ago

/GAN method isn't reliable anymore and can lead to bricked system or just refuse to apply the modified data, so I stopped recommending it. On the other hand, HW SPI flashers are cheap and reliable. But, if it worked - good to know. Can you open RW Everything and show the state of 15th (0xF) bit of MSR 0xE2 register?

giacomoleopardo commented 8 years ago

Right. As a matter of fact /gan method bricked my Asrock Z10 fatal1ty ITX. I did flashed via SPI, but it allowed me to flash just the original bios from downloaded Asrock. Not the patched one

Piker-Alpha commented 8 years ago

@NikolajSchlej,

Ok thanks.

@giacomoleopardo,

You only need to patch the kernel the way I do if you want XCPM instead of AppleIntelCPUPowerManagement. And like Nikolaj said. Please check the lock bit with RW Everything. Thanks!

giacomoleopardo commented 8 years ago

msr rw everything @NikolajSchlej I'm here with RW Everything opened on CPU MSR Registers. Can't recognize MSR 0xE2!

NikolajSchlej commented 8 years ago

Press USER button and add it manually.

giacomoleopardo commented 8 years ago

You mean like this? What am I looking at, then? msr 0xe2

NikolajSchlej commented 8 years ago

Yep, bit 15 is zero, it means your 0xE2 register is unlocked now. Seems the patch works after all.

giacomoleopardo commented 8 years ago

That's good to hear. What about this one? It's ASRock Fatal1ty Z170 ITX. I know for sure it's locked (even with SPI I couldn't flash with the unlocked one), but the bit 15 seems to be "0" either. I don't quite understand... msr 0xe2 asrock fatal1ty itx

NikolajSchlej commented 8 years ago

We are talking about different kind of locks here. If bit 15 in 0xE2 is 1, AppleIntelCPUPowerManagement.kext will crash, if it's 0 - it could work or not depending on the CPU microarchitecture. BIOS Lock (the ability to modify the image) is a different and unrelated story.

giacomoleopardo commented 8 years ago

Once again thanks for clarifying. As a matter of fact in ASRock's clover config.plist file, changing from

<key>KernelPm</key>
<true/>

to

<key>KernelPm</key>
<false/>

didn't compromise the boot process. Very valuable info!

Piker-Alpha commented 8 years ago

I can confirm that the Broadwell E patch works, but the Mac address was lost (due to a user error).

Edit: Problem solved. Thank you for the patch!