您能拼凑以下线索来帮助我读取 Winbond W83793 芯片的温度吗?
我正在尝试让 OpenHardwareMonitor 从 我的 Supermicro X7DWA 上的 Winbond W83793 芯片 母板。问题是我没有任何低级编程经验,并且在线可用文档似乎不足以解释如何访问温度。
然而,在我研究这个问题的一个月里,我发现了一些价值观和低级方法,它们可能是解决我的问题的关键。我只需要弄清楚如何使用它们来获得我想要的东西。这就是我向你求助的地方,因为你可能会理解这些信息的含义以及如何应用它,这与我不同。我已经进行了相当多的探索,导致许多蓝屏和计算机重新启动。猜测够了,我需要将这些线索拼凑起来。以下是我到目前为止所知道的:
要从芯片中读取数据,我需要以某种方式访问 SMBus,因为这是监控程序(例如 CPUID HWMonitor)获取信息的方式。据我所知,OpenHardwareMonitor 中没有任何代码来访问 SMBus,这就是它可能无法从芯片读取数据的原因。但是,OpenHardwareMonitor 在其 Ring0 类,用于访问其他芯片的信息。我也许可以利用这些方法来发挥我的优势:
void Ring0.WriteIOPort(uint 端口,字节值); 字节 Ring0.ReadIOPort(uint 端口);
除了其他信息之外,当我保存报告时,HWMonitor 还会向我报告有关 Winbond W83793 芯片的以下信息:
<块引用>寄存器空间:SMBus,基址 = 0x01100
SMBus 请求:通道 0x0,地址 0x2F
看起来这些都是重要的值,但我不知道它们到底意味着什么,以及如何将它们与上面的 Ring0 方法结合使用。嗯……线索太多了。 HWMonitor 向我显示的其他值是实际电压、温度和风扇速度,以及代表芯片上某处数据的十六进制值数组,如果您想查看的话,我将在此处重现这些值。
最后,在 W83793 数据表第 53 页(如果您已打开该文档),以下是我想读取的温度的十六进制地址(我相信):
<块引用>TD1 读数 - Bank 0 地址 1C
TD2 读数 - Bank 0 地址 1D
TD3 读数 - Bank 0 地址 1E
TD4 读数 - Bank 0 地址 1F
低位读出 - Bank 0 地址 22
TR1 读数 - Bank 0 地址 20
TR2 读数 - Bank 0 地址 21
:
到目前为止我所知道的就是这些。 OpenHardwareMonitor、W83793 芯片和 Ring0 代码可通过上面提供的链接获取。正如我之前所说,我已经研究了一个月了,但我仍然无法解开这个谜团。我希望你能帮助我。所有这些信息可能看起来有点令人生畏,但我确信对于具有一些低级编程经验的人来说是有意义的。
总结我的问题,使用上面提供的线索来弄清楚如何让 OpenHardwareMonitor 读取 W83793 芯片的温度。我不需要有关在 OpenHardwareMonitor 中创建芯片的详细信息。我已经准备好课程了。我只需要写入 Ring0 命令的序列和格式(如果这是我需要做的)。
编辑:我找到了更多信息。我从 HWMonitor 打印了一份 SMBus 设备报告,除其他外,我得到了这一行,包含在这里,因为它显示 0x2F:
SMB 设备:I/O = 0x1100,地址 0x2F,通道 = 0
这一定意味着我需要以某种方式将 I/O 地址与芯片地址(似乎是 0x2F)组合起来。我尝试将它们加在一起,但随后我得到的所有温度读数均为 255,所以这不是正确的猜测。
I am trying to get OpenHardwareMonitor to read temperature data out of the Winbond W83793 chip on my Supermicro X7DWA motherboard. The problem is that I don't have any low-level programming experience, and the available docs online do not seem to be sufficient in explaining how to access the temperatures.
However, over the month that I've been working on this problem, I have discovered a few values and low-level methods that may be the key to solving my problem. I just need to figure out how to use them to get what I want. That's where I turn to you, because you might understand what this information means, and how to apply it, unlike me. I've already done my fair share of poking around, resulting in many blue screens and computer restarts. Enough guessing, I need to piece these clues together. Here is what I know so far:
To read from the chip, I will somehow need to access the SMBus, because that is the way monitoring programs, such as CPUID HWMonitor, are getting the information. OpenHardwareMonitor, as far as I know, does not have any code in it to access the SMBus, which is why it may not be reading from the chip. However, OpenHardwareMonitor has the following methods included in its Ring0 class, which it uses to access information from other chips. I may be able to use these methods to my advantage:
void Ring0.WriteIOPort(uint port, byte value); byte Ring0.ReadIOPort(uint port);
Among other information, HWMonitor reports the following information about the Winbond W83793 chip to me when I save a report:
Register Space: SMBus, base address = 0x01100
SMBus request: channel 0x0, address 0x2F
It looks like these are important values, but I don't know exactly what they mean, and how I can use them in conjunction with the Ring0 methods above. Hmm... so many clues. The other values HWMonitor shows me are the actual voltages, temperatures, and fan speeds, and an array of hexadecimal values that represents data from somewhere on the chip, which I will reproduce here if you want to look at it.
Finally, in the W83793 data sheet, on page 53 (if you have the document open), here are the addresses in hex of the temperatures I would like to read (I believe):
TD1 Readout - Bank 0 Address 1C
TD2 Readout - Bank 0 Address 1D
TD3 Readout - Bank 0 Address 1E
TD4 Readout - Bank 0 Address 1F
Low bit Readout - Bank 0 Address 22
TR1 Readout - Bank 0 Address 20
TR2 Readout - Bank 0 Address 21
That is all I know so far. The OpenHardwareMonitor, W83793 chip, and Ring0 code are available via the links provided above. As I said earlier, I've been at it for a month, and I just haven't been able to solve this mystery yet. I hope you can help me. All this information may seem a bit intimidating, but I'm sure it will make sense to someone with some low-level programming experience.
To summarize my question, use the clues provided above to figure out how to get OpenHardwareMonitor to read temperatures out of the W83793 chip. I don't need details on creating a chip in OpenHardwareMonitor. I already have a class ready. I just need the sequence and format to write Ring0 commands in, if that's what I need to do.
EDIT: I found some more information. I printed an SMBus device report from HWMonitor, and among other things, I got this line, included here because it says 0x2F:
SMB device: I/O = 0x1100, address 0x2F, channel = 0
This must mean I need to somehow combine the addresses of the I/O with the address of the chip, which seems to be 0x2F. I tried adding them together but then I get all temperature readings to be 255, so that wasn't the right guess.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
IO 方法正是您所需要的。在 x86 硬件上实际上有两个地址池,而不是一个。一种用于存储器,在读取指令时由芯片引用,并具有数千种有用且方便的访问方法。另一种用于寻址外部芯片,并且具有非常有限且相对较慢的读写操作集。您所确定的方法使您可以访问第二个区域。
由于您要读取的寄存器位于存储体 0 中,因此首先您需要选择芯片上的存储体 0,如第 12 页所示。根据第 8.1.2.1 节中的图表,您需要将 0x80 写入地址 00。根据您的报告,芯片的基地址是 0x01100,这意味着通过 WriteIOPort 将 0x80 写入 0x01100。
那么您很可能应该能够通过 ReadIOPort 从 0x01100+0x1c、0x01100+0x1d 等读取您想要的值。
我还没有时间完全消化您链接到的文档,但是这些都是合理的猜测。有些芯片的程序稍微复杂一些,您必须写入一个值然后确认结果,但我在文档中没有看到类似的内容。您还需要警惕多任务处理 - 如果您的代码在设置组 0 和读取相关寄存器之间被中断,那么中间的某些进程可能会设置其他组,导致您读取的值是任意其他值。我假设 OpenHardwareMonitor 有某种机制来处理这个问题,但如果您尝试快速的纯用户空间实现并偶尔得到奇怪的结果,那么值得记住。
The IO methods are what you need. On x86 hardware there are actually two address pools, not one. One is meant for memory, is referenced by the chip when reading instructions and has thousands of useful and convenient access methods. The other is meant for addressing external chips and has a very limited and relatively slow set of read and write operations. The methods you've identified give you access to the second area.
As the registers you want to read are in bank 0 then first you need to select bank 0 on the chip, as per page 12. Per the diagram in section 8.1.2.1 you need to write 0x80 to address 00. Based on your report that the base address for the chip is 0x01100, that should mean writing 0x80 to 0x01100 via
WriteIOPort
.It's then likely that you should be able to read the values you want via
ReadIOPort
from 0x01100+0x1c, 0x01100+0x1d, etc.I haven't had time fully to digest the document you link to, but those are reasonable guesses. Some chips have a slightly more complicated procedure where you have to write a value then acknowledge the result, but I don't see anything like that in the documentation. You also need to be wary of multitasking — if your code is interrupted between setting bank 0 and reading relevant registers then some process in between may set some other bank, causing the values you read to be arbitrary other values. I assume OpenHardwareMonitor has some sort of mechanism to deal with that, but it's worth keeping in mind if you try a quick purely userspace implementation and occasionally get weird results.
最后,OpenHardwareMonitor 的作者好心地帮助了我,现在我能够从我的芯片中读取温度了。虽然这个问题的整个解决方案有点复杂,而且仍然超出了我的范围,但这里是使用 Ring0 类的基本读写,供任何感兴趣的人使用。请注意,这是特定于我的机器和芯片的。对于您来说,基地址和从机地址可能不同,但您可以使用 CPUID HWMonitor 通过打印报告找到它们。
首先,这里是使用的常量:
接下来,这里是从芯片上的寄存器读取特定字节的基本代码:
虽然我不太理解它,但这可以作为具有更多知识的人的粗略指南比我遇到类似问题的经验水平低。
In the end, the author of OpenHardwareMonitor kindly helped me out, and now I'm able to read temperatures out of my chip. While the entire solution to this problem is a little more complex and is still beyond me, here is the basic reading and writing using the Ring0 class, for anyone interested. Note that this is specific to my machine and chip. For you, the base address and slave address may be different, but you can find them using CPUID HWMonitor, by printing a report.
First, here are the constants that were used:
Next, here is the basic code to read a particular byte from a register on the chip:
While I don't understand it that well, this could serve as a rough guide to someone with more low-level experience than me who is having a similar problem.