Joseph Smith wrote:
Quoting Marc Jones marc.jones@amd.com:
Joseph Smith wrote:
Joe, There is an example of an spd array in mainboard/artecgroup/dbe61/cache_as_ram_auto.c spd_read_byte(). You will have to generate the correct SPD values for your memory.
Marc
Cool!! So let me get this straight. The function spd_read_byte() in cache_as_ram_auto.c is re-defining the spd_read_byte() function from src/southbridge/amd/cs5536/cs5536_early_smbus.c correct? And it is saying that if the device is DIMM0 (0xA0) to read from the array? So what if it is DIMM1 (0xA2)? Does it use the normal spd_read_byte() from cs5536_early_smbus.c?
Thanks - Joe
No, If it is 0xA2 it returns 0xFF as if the spd is not there. Marc
Oh, then I would have to switch it up a bit. This should work ok right?
static int spd_read_byte(unsigned device, unsigned address) { int i;
if (device == 0x50){ return do_smbus_read_byte(device, address); } else if (device == 0x51){ for (i=0; i < (sizeof spd_table/sizeof spd_table[0]); i++){ if (spd_table[i].address == address){ return spd_table[i].data; } } } else { return 0xFF; /* returns 0xFF on any failures */ }
}
Thanks - Joe
That looks like it should do what you want. Marc