Adding SPD data to the BIOS image

Hi,

I’m currently digging some more in BIOS modding. For Coreboot you can add an spd.bin file during the build process to set custom values for more or less everything RAM related. This can be useful if the chip is broken, missing, write protected …
Also for some systems which usually lack an external eeprom to store the SPD data you can directly add those to the BIOS. Apples soldered RAM might be such a case. For single board computers u-boot also contains the data for RAM configuration.
But i could not find anything for adding the SPD data to a normal vendor BIOS.
Is this possible?
This thread https://forum.up-community.org/discussio…ot-on-upsquared
shows that at least some vendors also put the data into the UEFI BIOS.


bios memory support on PC platform is designed as plug&play, so vendors dont need hardcode spd data in bioses.
but in bios modules exists some strings, representing memory modules names like "g.skill pc3-1600-bla-bla", this maybe patches or something hardcoded to this modules



Sure, but it at least seems to be possible in some cases according to the link. Since the UP board also uses UEFI and you can also change RAM settings in the BIOS in general there must be some way to do this.
In which BIOS did you find these strings?


in gigabyte, "Setup" module, also in "SiInitPreMem" exist strings like "SPD Micron Hynix Elpida Samsung"
you can explore stolen ami uefi source code for memory controlling/spd reading (for old platfrom ivy/sandy)

@skrellioge - You can set “Defaults” for speed and timings usually, if something as easy as that would work for you. If you want to try, upload or link me to a BIOS in question and I’ll see what I can do for you.
Also, please include a list of settings you want to be set as the default for your test.

@Lost_N_BIOS

I’m not sure which parts of the SPD data are required to run a stable system. Speed and timings are certainly amongst them, probably memory/module type, voltages, anything else?
Easiest would be to use an spd.bin like coreboot. I don’t know how it is done in case of the linked udoo board. They seem to have everything in the UEFI image so there must be some way to incorporate this kind of data. But it might be not that straightforward since even the people trying to make a coreboot port had some issues and it is still not finished.
Thanks for the offer btw. If you have some links how I can do this myself it would be great. I think I have to try a lot of stuff at first and pinging you every few minute for a minor BIOS change would maybe be a bit too much :slight_smile: How long does it in general take to rebuild a BIOS. Or is it just editing the BIOS at the right spots?
I also found this for an open source implementation of UEFI https://code.bluestop.org/edk2/docs/mast…pd_ddr4_8h.html
which has the code for parsing the spd data.
Is there maybe leaked source code for some vendor UEFI BIOS somewhere?

I think closes to “leaked” UEFI BIOS for Apollo Lake would be firmware for MinnowBoard 3. When presenting Slimbootloader Intel mentioned that UP boards are very close to Minnowboard 3 and in general firmware should be compatible. So you can look deeper at: https://firmware.intel.com/projects/IntelAtomProcessorE3900 and https://github.com/tianocore/edk2-platfo…mProcessorE3900

More to that I see couple Apollo Lake based platforms in coreboot:
- Google Reef
- Intel Apollo Lake RVP
- Intel Leafhill
- Intel Minnowboard 3
- Siemens MC_APL1

It looks like in most cases default values from FSP-M phase are used. It is possible to add predefined structure in case of Siemens unfortunately it is not in tree.

@skrellioge - speed / timings, maybe voltage should be all that’s really necessary, if you are wanting to change from what auto/SPD applies.
I don’t know of any direct guides on this, but what you need to learn about is changing BIOS settings using AMIBCP, if this BIOS is compatible with AMIBCP, otherwise some other tool would be needed. I can’t say for sure without a copy of the BIOS to look at myself, then I could tell you exactly what tools work with it.