Chameleon

Chameleon Commit Details

Date:2010-12-16 09:35:04 (13 years 3 months ago)
Author:Kabyl
Commit:673
Parents: 672
Message:removed commented code
Changes:
M/branches/Kabyl/i386/libsaio/spd.c

File differences

branches/Kabyl/i386/libsaio/spd.c
6868
6969
7070
71
72
73
74
75
76
77
78
79
80
8171
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
10472
10573
10674
......
12795
12896
12997
130
13198
13299
133100
#define SMBHSTADD 4
#define SMBHSTDAT 5
#define SBMBLKDAT 7
#if 0
/** 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;
unsigned long long t;
#define Reg32(reg)(*(volatile uint32_t *)(base + reg))
#define RegRead32(reg)(Reg32(reg))
#define RegWrite32(reg, value)(Reg32(reg) = value)
RegWrite32(SMBHSTSTS, 0x1f);// reset SMBus Controller
RegWrite32(SMBHSTDAT, 0xff);
while(RegRead32(SMBHSTSTS) & 0x01);// wait until ready
RegWrite32(SMBHSTCMD, cmd);
RegWrite32(SMBHSTADD, (adr << 1) | 0x01 );
RegWrite32(SMBHSTCNT, 0x48 );
rdtsc(l1, h1);
while (!( RegRead32(SMBHSTSTS) & 0x02))// wait til command finished
{
rdtsc(l2, h2);
t = ((h2 - h1) * 0xffffffff + (l2 - l1)) / (Platform.CPU.TSCFrequency / 100);
if (t > 5)
break;// break after 5ms
}
return RegRead32(SMBHSTDAT);
}
#endif
//#if 0
/** 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)
{
}
return inb(base + SMBHSTDAT);
}
//#endif
/* SPD i2c read optimization: prefetch only what we need, read non prefetcheable bytes on the fly */
#define READ_SPD(spd, base, slot, x) spd[x] = smb_read_byte_intel(base, 0x50 + slot, x)

Archive Download the corresponding diff file

Revision: 673