SmbusIntelSkylakeIMC: Support all addresses, remove special case hand…#62
Conversation
|
It also seems slot and opcode are really just the address and handling of them can be combined. |
|
Removed opcode and slot because this is just taking the address, splitting it into two fields, and recombining those fields when generating the command word. The command word looks like 0x2008AACC where AA is address and CC is command. |
0bcb729 to
13a8537
Compare
|
I think SMB_PNTR_SEL (bit 18) is how we achieve byte/word access instead of byte data/word data access. It selects between "pointer based access" and "random access". Apparently pointer based access is where you write the register address with a write and then perform separate reads which auto-increment the pointer and random access is where you send the address with each operation, corresponding to the behavior of the BYTE/WORD/BYTE_DATA/WORD_DATA operations. |
|
There is also SMB_DIS_WRT (bit 28) that disables writes if set. I think we need to clear this during write operations as the default command word (0x20080000) has this bit set. I have some spare dummy modules around here somewhere and one of them that I ripped the casing off of. I had plans at one point to probe out the I2C pins on it and solder wires so that I could use it as a debug probe. I will try to get that working soon so I can see if we're actually performing write operations on the bus as intended. |
|
I have tried your version 0bcb729, with a few further adjustments, for my WinRing0/Linux implementation for that SMBus and QUICK seems to work for me so far. |
Could you please add quick ? Detection: Quick write for thermal sensors is helpful for me (18, 1A). |
|
Doesn't that just treat quick as a read byte operation? IIRC I thought quick was only supposed to send the Address+RW byte and then check if it was ACKed or not. Looking at the registers in the document you sent me there does not seem to be a way to instruct it to not send any following data. |
|
Oh, the write value is initialized to zero in the top level function. That's why none of my writes were working probably. It was always writing zero for the value. I confirmed the waveform sequences look right but the data itself wasn't working. I thought it might have been something on OpenRGB's side but looks like not. I will look into this more tonight. |
|
This was the problem, fixing the value = 0 to value = in[4] for the data input now OpenRGB can successfully detect my ENE DRAM modules, read the version string, and control the built-in effects. However, direct mode (software control of the individual LEDs) uses SMBus block writes. I see you tried to implement block accesses but you're doing them as a series of individual read/write operations rather than as a proper block operation. I don't think this works. I don't see a way to do proper block operations in the datasheet, so maybe it's best to just return a not supported error on these (along with quick) and have the application revert to a non-block operation if possible. |
|
Was able to control direct mode by replacing block operations with a loop of byte operations. I'm going to try to add a block workaround in my generic PawnIO SMBus module so that block operations get converted into repeated byte operations. I think it is best for the PawnIO module itself to only expose what the hardware is properly capable of and return NOT_SUPPORTED for anything it doesn't actually support. |
|
Yes I think block operations are not supported by default. I've re-checked the document now. |
|
More confirmation that block operations are not supported. I installed Corsair iCue because the Corsair RGB RAM modules typically use a single block operation to send an LED frame in direct mode so I wanted to see if they were doing something we're not. I used my debug probe to get bus captures and iCue is using a different access protocol than it normally does. It seems to be doing a series of word writes to a different address range, so it seems Corsair implemented a workaround for doing these block transfers without actual block operations. |
3c3e7a2 to
345dac0
Compare
…ling for SPD, TSOD, and Bank Switching
|
@namazso Do you have any review comments on this? I would be very grateful if this made it into a signed release within the next week or so, as I want to do an OpenRGB 1.0rc3 release candidate build and get this work into it. |







Edit: The scope of this PR changed as I worked it, so here's a full summary of what is changed. This PR is ready to merge.
Original description:
Based on the investigations I am working on in the comments of #60, I have removed a lot of the SPD special-case handling in this SMBus driver and instead opened up the range of allowed addresses to cover the full I2C address range. This has been successful in my testing with OpenRGB, though still limited by the limited supported operations. Namely, I can still bank switch the SPD by peforming a read operation on either 0x36 or 0x37 before dumping the SPD address. There seems to be some extra addresses being picked up by my I2C detection probes still and I'm not sure why, so consider this still WIP until I unmark Draft.