Heres an update:
I used dosdude's microcode tool to replace the microcode, I have experimented with different changes to the microcode before. Updating, moving or replacing all cause the machine not to boot* (This is with the original cpu). Now heres the catch, it will boot every now and again if you unplug it/leave it for a bit, move the ram to different slots and persist with some varition of those things, it will at some point just randomly boot (chimes and boots into chosen os), I would then go into debian and flash the original efi back. And with the original efi it would be back to working normally as one would expect.
So I decided to try replacing the platform B1 microcode with the same version but with the platform 44 microcode (for xeons), so the location of the microcode in the efi is the same and same version, only now it says platform 44 instead of B1. I flashed it and it didn't boot (no surprise), so I tore it down and put in the x5270. Surely with just the platform change and a cpu and EFI that is the same in every other way it would boot? Well as you know it didnt, so I tried the "unplug it/leave it for a bit, move the ram to different slots and persist with some varition of those things, it will at some point just randomly boot" strategy, and sure enough eventually I got it to chime, but then it would get hung up on the white screen (same as Locla). The second time I got it to chime I was able to get to the boot select but as soon as I selected something it froze. So it obviously wasnt happy.
But then I made some progress thanks to
@m0bil , turns out the microcode tool doesnt recalculate the header checksum or the CRC32. So in accordance with
@m0bil's testing on the 2011 imac, I changed the crc32 value to 00 00 00 00 to get the bios to skip the CRC check of the microcode volume. Then simply recalculated the header checksum in UEFITool NE, then flashed the new image with a probe.......... and still it wouldnt boot. I think you know whats coming.... more unplugging/leaving it for a bit, moving the ram to different slots until it boots. And eventually I got it to chime and this time I got it to boot into debian WITHOUT IT GETTING HUNG UP! (HDD and screen are not plugged in so fans are loud). Progress??
So then I thought what if I just calculate the crc32 value instead of using the 00 00 00 00 skip thing, so I did the calculation, redid the header checksums, triple checked everything, got the imac to boot into debian again and flashed the image. It restarted fine but got hung up trying to boot debian, so I shut it of and same thing back to the full fan speed. So at this point im not sure what to think.
NOTE: Ive done many PRAM resets on the successful boot, and it will always chime again indicating that the pram has been reset and will continue to boot. Its just once you try restart it again it goes back to the full fan speed and no chime. Perhaps removing the PRAM battery would fix this but it doesnt really seem like a great solution, this shouldnt really be needed.
OTHER LESS IMPORTANT NOTE: When it doesnt chime, it either goes full fan speed no beeping or it gives the ram beep for no ram detected (even though there is RAM in it) not sure what causes it to do one or the other.
So I am at a loss as to why it behaves like this.
View attachment 2035458