I'm working on vt8237 smbus in v3, and I had a quick question, mostly for Rudolf Marek and Bari, but feel free to jump in with your 2 cents:
u8 smbus_read_byte(u16 dimm, u8 offset, u16 smbus_io_base) { u8 val;
printk(BIOS_SPEW, "SMBus Read from DIMM %1x at address 0x%4x\n", dimm, offset);
smbus_reset(smbus_io_base);
/* Clear host data port. */ outb(0x00, smbus_io_base + SMBHSTDAT0); //SMBUS_DELAY(); smbus_wait_until_ready(smbus_io_base);
dimm = (dimm << 1) | 1;
outb(dimm, smbus_io_base + SMBXMITADD);
The dimm = (dimm << 1) | 1 is something that came from a via southbridge porting guide (NOT the one for the vt8237r, I don't have that one). With it, my spd addresses are 0x50, 0x51, etc, without it, they'd be 0xa1, 0xa3, etc. Which would be preferred? Do you think we'd ever need a 0xa0 or 0xa2 address?
Thanks, Corey
On Mon, Oct 13, 2008 at 11:36 AM, Corey Osgood corey.osgood@gmail.com wrote:
I'm working on vt8237 smbus in v3, and I had a quick question, mostly for Rudolf Marek and Bari, but feel free to jump in with your 2 cents:
u8 smbus_read_byte(u16 dimm, u8 offset, u16 smbus_io_base) { u8 val;
printk(BIOS_SPEW, "SMBus Read from DIMM %1x at address 0x%4x\n", dimm, offset); smbus_reset(smbus_io_base); /* Clear host data port. */ outb(0x00, smbus_io_base + SMBHSTDAT0); //SMBUS_DELAY(); smbus_wait_until_ready(smbus_io_base); dimm = (dimm << 1) | 1; outb(dimm, smbus_io_base + SMBXMITADD);
The dimm = (dimm << 1) | 1 is something that came from a via southbridge porting guide (NOT the one for the vt8237r, I don't have that one). With it, my spd addresses are 0x50, 0x51, etc, without it, they'd be 0xa1, 0xa3, etc. Which would be preferred? Do you think we'd ever need a 0xa0 or 0xa2 address?
stick with 0x50 etc. The SMBUS address is the high 7 bits with opcode in the lowest bit. So a1, a3, etc. are not real addresses. 50 and 51 are.
ron
Corey Osgood wrote:
I'm working on vt8237 smbus in v3, and I had a quick question, mostly for Rudolf Marek and Bari, but feel free to jump in with your 2 cents:
u8 smbus_read_byte(u16 dimm, u8 offset, u16 smbus_io_base) { u8 val; printk(BIOS_SPEW, "SMBus Read from DIMM %1x at address 0x%4x\n", dimm, offset); smbus_reset(smbus_io_base); /* Clear host data port. */ outb(0x00, smbus_io_base + SMBHSTDAT0); //SMBUS_DELAY(); smbus_wait_until_ready(smbus_io_base); dimm = (dimm << 1) | 1; outb(dimm, smbus_io_base + SMBXMITADD);
The dimm = (dimm << 1) | 1 is something that came from a via southbridge porting guide (NOT the one for the vt8237r, I don't have that one). With it, my spd addresses are 0x50, 0x51, etc, without it, they'd be 0xa1, 0xa3, etc. Which would be preferred? Do you think we'd ever need a 0xa0 or 0xa2 address?
My 2cents. I have never really cared for the <<1. I prefer the more normal IO address. Most platform specs I have seen indicate the spd device at 0xA0, 0xA2, etc.
Marc
Hi,
0x50 is the actual address. 0xA0 is actual encoded address which starts from bit1. bit0 indicates if it is R/W operation.
I would prefer to stick with 0x50.
Rudolf
Corey Osgood wrote:
u8 smbus_read_byte(u16 dimm, u8 offset, u16 smbus_io_base)
..
dimm = (dimm << 1) | 1;
..
With it, my spd addresses are 0x50, 0x51, etc, without it, they'd be 0xa1, 0xa3, etc. Which would be preferred?
As others have said, the input to this function should be 0x50.
Do you think we'd ever need a 0xa0 or 0xa2 address?
The bus just has 7 bits for address so no problem.
//Peter
On Mon, Oct 13, 2008 at 3:26 PM, Peter Stuge peter@stuge.se wrote:
Corey Osgood wrote:
u8 smbus_read_byte(u16 dimm, u8 offset, u16 smbus_io_base)
..
dimm = (dimm << 1) | 1;
..
With it, my spd addresses are 0x50, 0x51, etc, without it, they'd be 0xa1, 0xa3, etc. Which would be preferred?
As others have said, the input to this function should be 0x50.
Alright, that was what I was thinking too. Thanks for the quick responses!
-Corey