Chameleon

Chameleon Commit Details

Date:2010-02-19 19:08:27 (14 years 1 month ago)
Author:Rekursor
Commit:92
Parents: 91
Message:removed dbug spd mode, added more comments to spd.c
Changes:
M/trunk/i386/libsaio/spd.c

File differences

trunk/i386/libsaio/spd.c
6969
7070
7171
72
72
73
74
7375
7476
7577
......
8284
8385
8486
85
87
8688
8789
88
90
8991
9092
9193
9294
95
9396
9497
9598
......
102105
103106
104107
105
108
106109
107110
111
108112
109113
110114
......
137141
138142
139143
144
145
140146
141147
142148
......
149155
150156
151157
152
158
159
153160
154161
155162
156163
157164
158
165
159166
167
168
160169
161170
162171
......
185194
186195
187196
197
188198
189199
190200
{0xBA01, "PNY Electronics"}, // id=BA Bank=2
{0x4F01, "Transcend Information"}, // id=4F Bank=2
{0x1903, "Centon Electronics"}, // id=19 Bank=4
{0x4001, "Viking Components"} // id=40 Bank=2
{0x4001, "Viking Components"}, // id=40 Bank=2
{0xAD00, "Hynix Semiconductors"}, // id 0xAD Bank 1
{0x4304, "Ramaxel Technologies"} // id 0x43 Bank 5
};
#define VEN_MAP_SIZE (sizeof(vendorMap)/sizeof(VenIdName))
#define SMBHSTADD 4
#define SMBHSTDAT 5
/** Get Vendor Name from spd, 2 cases handled DDR3 and DDR2, have different formats.*/
const char * getVendorName(const char * spd)
{
uint16_t code = *((uint16_t*) &spd[0x75]);
uint16_t code;
int i;
uint16_t bank=0;
if (spd[2]==0x0b) { // DDR3
code = *((uint16_t*) &spd[0x75]);
for (i=0; i < VEN_MAP_SIZE; i++)
if (code==vendorMap[i].code)
return vendorMap[i].name;
return vendorMap[i].name;
}
return "No Name";
return "NoName";
}
/** Get Default Memory Module Speed (no overclocking handled) */
int getDDRspeedMhz(const char * spd)
{
if (spd[2]==0x0b) { // DDR3
}
#define UIS(a) ((uint32_t)spd[a])
/** Get DDR3 or DDR2 serial number, 0 most of the times */
uint32_t getDDRSerial(const char* spd)
{
uint32_t ret=0;
return ret;
}
char * getDDRPartNum(const char* spd)
/** Get DDR3 or DDR2 Part Number */
const char * getDDRPartNum(const char* spd)
{
if (spd[2]==0x0b) // DDR3
return &spd[128];
else if (spd[2]==0x08 || spd[2]==0x07) // DDR2 or DDR
return &spd[73];
return "";
return "N/A";
}
/** Read one byte from the intel i2c, used for reading SPD on intel chipsets only. */
unsigned char smb_read_byte_intel(uint32_t base, uint8_t adr, uint8_t cmd)
{
int l1, h1, l2, h2;
int mapping []={0,1,2,3,4,5}; // linear mapping for now, check me
/** Read from smbus the SPD content and interpret it for detecting memory attributes */
static void read_smb_intel(pci_dt_t *smbus_dev)
{
static int serialnum=0;

Archive Download the corresponding diff file

Revision: 92