Mike Banon has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40291 )
Change subject: vc/amd/agesa/f.../Proc/Mem/Tech/DDR3: Support XMP memory profiles ......................................................................
Patch Set 13:
Patch Set 11:
Cause of my earlier problem: although the SPD Buffer is 256 bytes in AGESA's vendorcode, the smbus_readSpd function only read the first 128 bytes: so at SPD Buffer's XMP profile offset there was a bunch of 00 instead of real values. I didn't notice it at first, but this instantly became clear after a full print of read SPD Buffer. After I changed that to 256, now the XMP 1 "1866MHz" profile is giving me 1600MHz speed - which of course is better than turtle 1333MHz, but now I need to figure out: what else is blocking a 1866MHz? Maybe a northbridge frequency? Also, started working on a custom SPD values set up as you see, although it's a lower priority.
It seems that f16kb Athlon 5370 's Kabini memory controller supports up to 1600MHz max unless you would overclock the northbridge (see the MEMCLK / NCLK / NBCOF comments). For that, it seems that you need to disable a check for northbridge read-only bit fields stating that 1600MHz is max freq supported and raise the base clock from 100MHz to 120MHz (120*8 = 960 > 933). Also may need to overclock the graphics memory controller as well (./src/vendorcode/amd/agesa/f16kb/Proc/GNB) to keep up with the RAM speeds.
All this is tricky to do: although there are defines like EXTERNAL_CLOCK_100MHZ and GFX_REFCLK, it seems that in many places which are supposed to use this CLK value, it is simply hardcoded as "100 *" or "* 100" - and sometimes hard to figure out, which 100 should be changed to 120 and which shouldn't. So for this moment I'm fine with 1600MHz at f16kb AM1I-A, considering the timings also got lower: 1600MHz 8-8-9-23 instead of 1866MHz 9-9-9-27 (or 9-9-10-27: for some reason tRP is always trained one point higher while the rest of tCL-tRCD-tRP-tRAS are the same as RAM specification. May have to do with SlowMode? see SpdIndexes at mtspd3.c to find out)
For those who would like to continue overclocking AM1I-A, take a look at f16kb-only feature AMP (AMD Memory Profiles) which may affect the northbridge performance / voltages, maybe enabling it will assist in overclocking. Meanwhile I'll try to get ASUS A88XM-E with A10-6700 working: yesterday when I tried to enable "XMP 1" 1866MHz profile on it, maybe it trained to 1866MHz as requested (since f15tn A10-6700 's memory controller really supports 1866MHz without overclocking) but I got a weird exception which prevented the successful booting:
... PCI: 00:18.5 Done allocating resources. BS: BS_DEV_RESOURCES run times (exec / console): 1 / 1417 ms
APIC 00: ** Enter AmdInitMid [00020005] Timestamp - calling AmdInitMid: 24619341360 CPU Index 0 - APIC 16 Unexpected Exception:0 @ 10:1febbe1d - Halting Code: 0 eflags: 00010046 cr2: 00000000 eax: 00017318 ebx: 10000660 ecx: 00000004 edx: 00000000 edi: 00000000 esi: 0000014d ebp: 00000016 esp: 1fedec70
0x1febbdd8: c7 5e ff 33 8a 44 24 4b 0x1febbde0: 83 e0 1f 50 e8 b0 13 00 0x1febbde8: 00 83 c4 10 89 c6 83 ec 0x1febbdf0: 0c ff 33 6a 00 8d 44 24 0x1febbdf8: 38 50 68 70 01 00 00 6a 0x1febbe00: 0f e8 b3 26 00 00 83 c4 0x1febbe08: 14 80 7c 24 33 00 ff 33 0x1febbe10: 0f 48 f7 e8 c3 13 00 00 0x1febbe18: 6b c0 64 31 d2 f7 f7 89 0x1febbe20: 44 24 14 5f ff 33 e8 b0 0x1febbe28: 13 00 00 6b c0 64 31 d2 0x1febbe30: f7 f6 89 c5 58 ff 33 6a 0x1febbe38: 00 8d 44 24 24 50 68 74 0x1febbe40: 27 00 00 6a 12 e8 6f 26 0x1febbe48: 00 00 83 c4 14 ff 33 6a 0x1febbe50: 00 8d 44 24 28 50 68 78