Keywest detection
Hello,
I would like to add support for the Keywest to our sensors-detect script. I wonder if I should add it to the detectable adapters list or to the undetectable adapters list. Is there any way to detect it? Usually, we detect the adapters by matching a given PCI manufacturer:device ID and function.
Also, since you seem to have much knowledge about Linux PPC, maybe you could help us on another problem. We have some dump tools that come with the lm_sensors package, and one of them, isadump, doesn't seem to compile on PPC. Could you take a look and tell us if you know how to fix it? Or maybe this tool is of no use on PPC systems?
Thanks.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoted 8 lines · Jean Delvare
Hello,
I would like to add support for the Keywest to our sensors-detect script. I wonder if I should add it to the detectable adapters list or to the undetectable adapters list. Is there any way to detect it? Usually, we detect the adapters by matching a given PCI manufacturer:device ID and function.
Quoted 5 lines
Also, since you seem to have much knowledge about Linux PPC, maybe you could help us on another problem. We have some dump tools that come with the
lm_sensorspackage, and one of them, isadump, doesn't seem to compile on PPC. Could you take a look and tell us if you know how to fix it? Or maybe this tool is of no use on PPC systems?
Hrm... On 2.4, it's not that simple, there can be 2 keywest controllers, one on the northbridge, one on the southbridge, driving various parts.
With 2.6, these will be visible in sysfs once i'm done with the porting of pmac drivers to the new model.
I'm not sure I like the idea of having drivers tapping things on those i2c busses if those drivers aren't specially designed for the pmacs. I hate the idea of something preventing proper cooling of the machine and thus causing HW damage, or around those lines...
Ben.
Quoted 8 lines · Jean Delvare
Hi Benjamin, thanks for the fast reply.
Quoted 6 lines
Quoted 5 lines
I would like to add support for the Keywest to our sensors-detect script. I wonder if I should add it to the detectable adapters list or to the undetectable adapters list. Is there any way to detect it? Usually, we detect the adapters by matching a given PCI manufacturer:device ID and function.
Quoted 5 lines
Quoted 3 lines
Hrm... On 2.4, it's not that simple, there can be 2 keywest controllers, one on the northbridge, one on the southbridge, driving various parts.
You don't really help me ;) Does it show in lspci or somewhere else?
No. They don't, they show up in /proc/device-tree (one at the root of the tree, the one in the northbridge, and one lower below, within the macio PCI asic)
Quoted 6 lines
Quoted 2 lines
With 2.6, these will be visible in sysfs once i'm done with the porting of pmac drivers to the new model.
We don't really care for 2.6 for now. However, I think you tell me the *driver* will be visible in /sys. What we are after is a way to know when that driver is useful, before it is loaded.
The devices will be visible too, not only the driver
Quoted 5 lines
Our scripts tries to identifiy what is present on i2c busses, so we have to load i2c bus drivers, such as i2c-keywest, at first. But we don't want to load all of them "just in case". We prefer being able to detect them, and load only these drivers.
Quoted 8 lines
Quoted 4 lines
I'm not sure I like the idea of having drivers tapping things on those i2c busses if those drivers aren't specially designed for the pmacs. I hate the idea of something preventing proper cooling of the machine and thus causing HW damage, or around those lines...
I'm not sure I understand you at all there. What's the problem? (Please note that I don't know anything about PPC, I'm just trying to solve some problem our package has on Linux PPC.)
Well... those chips on the i2c bus, like thermal sensors, thermostats, fan controllers, clock generators, etc... are configured precisely by the firmware for a given motherboard, especially the thermal thresholds, for example, or the fan configuration & speed which may depend on the type of fans attached and the way the air flows in the enclosure, is something that I'd rather not touch without proper knowledge of the per-machine model details, which we don't have.
THe firmware is setting that up in some "sane" way, what else would you want to do ? For a couple of machines, I do have some experimental drivers that will do "smoother" fan management (avoiding them to be always full speed on some G4 towers), but those were done after reverse engineering the precise thresholds & values used by MacOS on these models.
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Also, since you seem to have much knowledge about Linux PPC, maybe you could help us on another problem. We have some dump tools that come with the
lm_sensorspackage, and one of them, isadump, doesn't seem to compile on PPC. Could you take a look and tell us if you know how to fix it? Or maybe this tool is of no use on PPC systems?So, do you have some time for that? It may be easy for you since you know the PPC world well. Feel free to refuse if you are busy though.
Not much time lately... isadump will not work, I suppose, because it does ioperm and in/out accesses from userland right ? You don't want to do that on most PPCs, beleive me ;) What kind of stuffs do you want that for anyway ?
Ben.
Quoted 8 lines · Jean Delvare
Quoted 3 lines
No. They don't, they show up in
/proc/device-tree(one at the root of the tree, the one in the northbridge, and one lower below, within the macio PCI asic)Interesting. I would need a concrete example to figure that out properly. When you say "device-tree", is it the real directory name (never seen that in i386) or is it to be replaced by something else, depending on the machine?
There's a /proc/device-tree directory on PPCs that have Open Firmware (that is not all PPCs, but all supported PowerMacs) that contains the Open Firmware device-tree.
Quoted 2 lines
It's usable by us then. If I understand you correctly, it already shows in 2.4, but will be different (and better) in 2.6?
Yes.
Quoted 1 line
Our script only read values, so we are unlikely to break anything.
Hrm... ok.
Quoted 9 lines
Quoted 2 lines
The firmware is setting that up in some "sane" way, what else would you want to do?
I don't know about PPC, but in the i386 world, we want to set our own temperatures and fan limits. I guess it's a bit different because all the hardware for a given PPC system is known, so the fan speeds, normal temperature etc. are known and not subject to change. Anyway, drivers are still welcome so that you can at least read the temperatures values, etc...
Well... depends on what PPC, PPC arch covers a wide range of very different kinds of machines... Anyway, regarding PowerMacs, I'd rather avoid touching those sensors settings from code that isn't specifically written for those machines.
Quoted 9 lines
Yes, I think it does. What made me wonder is that some comments in the code reveal that the code is meant to be run on PPCs. For example,
__powerpc__is checked twice. There also is a log entry that mentions PPC support support.On the other hand, I don't know if PPC even have an I2C bus. A PPC user reported today that our sensors-detect script locks when it comes to ISA chipsets detection. So, what should I know about PPC and the ISA bus?
Quoted 5 lines
My primary goal here is to allow PPC users to compile
lm_sensors. For now, they can't because at some point isadump fails to compile because of a header issue (I think PPC hasasm/io.hinstead ofsys/io.h, is that it?) so I was wondering if we should simply disable the compilation of this tool on PPC, or try to fix it.
Ok, so PPCs means a lot of things ;)
The PPC arch cover a wide range of different machines, like the PowerMacs, the PReP and CHRP machines (IBM RS6k among others), a lot of embedded boards, the "Amigas" (APUS and Pegasos boards), etc...
Some of them are rather PC-like (that is with some similar chipsets to what is found on x86), some aren't (PowerMacs).
The CPU itself doesn't have the inX/outX instructions, like most non x86 CPUs, but there is till the possiblility of having an ISA bus on some machines, in which case it's available on a southbridge on the PCI bus. The PowerMacs don't have one though.
There are some techniques to issue IOs from userland, but those involve using some syscalls to find the IO base address of a given PCI bus, then mmap'ing /dev/mem to get access to this IO range, then re-implementing the kernel IO accessors based on this. This isn't something I recommend to do unless it cannot be avoided. (XFree is an example of a userland app that do need that).
Ben.
Hi Benjamin, thanks for the fast reply.
Quoted 9 lines
Quoted 5 lines
I would like to add support for the Keywest to our sensors-detect script. I wonder if I should add it to the detectable adapters list or to the undetectable adapters list. Is there any way to detect it? Usually, we detect the adapters by matching a given PCI manufacturer:device ID and function.
Hrm... On 2.4, it's not that simple, there can be 2 keywest controllers, one on the northbridge, one on the southbridge, driving various parts.
You don't really help me ;) Does it show in lspci or somewhere else?
Quoted 2 lines
With 2.6, these will be visible in sysfs once i'm done with the porting of pmac drivers to the new model.
We don't really care for 2.6 for now. However, I think you tell me the *driver* will be visible in /sys. What we are after is a way to know when that driver is useful, before it is loaded.
Our scripts tries to identifiy what is present on i2c busses, so we have to load i2c bus drivers, such as i2c-keywest, at first. But we don't want to load all of them "just in case". We prefer being able to detect them, and load only these drivers.
Quoted 4 lines
I'm not sure I like the idea of having drivers tapping things on those i2c busses if those drivers aren't specially designed for the pmacs. I hate the idea of something preventing proper cooling of the machine and thus causing HW damage, or around those lines...
I'm not sure I understand you at all there. What's the problem? (Please note that I don't know anything about PPC, I'm just trying to solve some problem our package has on Linux PPC.)
Quoted 5 lines
Quoted 5 lines
Also, since you seem to have much knowledge about Linux PPC, maybe you could help us on another problem. We have some dump tools that come with the
lm_sensorspackage, and one of them, isadump, doesn't seem to compile on PPC. Could you take a look and tell us if you know how to fix it? Or maybe this tool is of no use on PPC systems?
So, do you have some time for that? It may be easy for you since you know the PPC world well. Feel free to refuse if you are busy though.
Thanks!
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoted 4 lines
No. They don't, they show up in
/proc/device-tree(one at the root of the tree, the one in the northbridge, and one lower below, within the macio PCI asic)
Interesting. I would need a concrete example to figure that out properly. When you say "device-tree", is it the real directory name (never seen that in i386) or is it to be replaced by something else, depending on the machine?
Quoted 5 lines
Quoted 3 lines
We don't really care for 2.6 for now. However, I think you tell me the*driver* will be visible in /sys. What we are after is a way to know when that driver is useful, before it is loaded.
The devices will be visible too, not only the driver
It's usable by us then. If I understand you correctly, it already shows in 2.4, but will be different (and better) in 2.6?
Quoted 11 lines
Quoted 3 lines
I'm not sure I understand you at all there. What's the problem? (Please note that I don't know anything about PPC, I'm just trying to solve some problem our package has on Linux PPC.)
Well... those chips on the i2c bus, like thermal sensors, thermostats, fan controllers, clock generators, etc... are configured precisely by the firmware for a given motherboard, especially the thermal thresholds, for example, or the fan configuration & speed which may depend on the type of fans attached and the way the air flows in the enclosure, is something that I'd rather not touch without proper knowledge of the per-machine model details, which we don't have.
Our script only read values, so we are unlikely to break anything.
Quoted 2 lines
The firmware is setting that up in some "sane" way, what else would you want to do?
I don't know about PPC, but in the i386 world, we want to set our own temperatures and fan limits. I guess it's a bit different because all the hardware for a given PPC system is known, so the fan speeds, normal temperature etc. are known and not subject to change. Anyway, drivers are still welcome so that you can at least read the temperatures values, etc...
Quoted 7 lines
Quoted 2 lines
So, do you have some time for that? It may be easy for you since you know the PPC world well. Feel free to refuse if you are busy though.
Not much time lately... isadump will not work, I suppose, because it does ioperm and in/out accesses from userland right ? You don't want to do that on most PPCs, beleive me ;) What kind of stuffs do you want that for anyway ?
Yes, I think it does. What made me wonder is that some comments in the code reveal that the code is meant to be run on PPCs. For example, __powerpc__ is checked twice. There also is a log entry that mentions PPC support support.
On the other hand, I don't know if PPC even have an I2C bus. A PPC user reported today that our sensors-detect script locks when it comes to ISA chipsets detection. So, what should I know about PPC and the ISA bus?
My primary goal here is to allow PPC users to compile lm_sensors. For now, they can't because at some point isadump fails to compile because of a header issue (I think PPC has asm/io.h instead of sys/io.h, is that it?) so I was wondering if we should simply disable the compilation of this tool on PPC, or try to fix it.
Thanks for your help and time.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoted 4 lines
There's a
/proc/device-treedirectory on PPCs that have Open Firmware (that is not all PPCs, but all supported PowerMacs) that contains the Open Firmware device-tree.
OK, I just took a look, and it seems to be a complete mess there (2.4). I think I will add the Keywest to the list of the _un_detectable adapters.
Quoted 11 lines
The CPU itself doesn't have the inX/outX instructions, like most non x86 CPUs, but there is till the possiblility of having an ISA bus on some machines, in which case it's available on a southbridge on the PCI bus. The PowerMacs don't have one though.
There are some techniques to issue IOs from userland, but those involve using some syscalls to find the IO base address of a given PCI bus, then mmap'ing
/dev/memto get access to this IO range, then re-implementing the kernel IO accessors based on this. This isn't something I recommend to do unless it cannot be avoided. (XFree is an example of a userland app that do need that).
Thanks for the information. I think I will fix isadump but won't compile it be default on linux-ppc.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoted 8 lines
The driver does it's internal device detection using Open Firmware. Take a look at this in the kernel source:
arch/ppc/kernel/prom.cIt's sort of like a PCI device table, except it includes all sorts of hardware interfaces besides just PCI devices.
I'm not used to PCI device tables either, so I'm rather confused.
Quoted 5 lines
If you have a newer Mac around (made within the last few years), you can hold down option-o-f while booting to get into the Open Firmware 'shell'. It's a Forth type interpreter which lets you do various things like browse the hardware of the computer or change some boot params.
Well, I don't have any Mac.
The real question was if there was a way to add Keywest detection to our sensors-detect script. As it turns out, I think there must be one, but it will be too complex for inclusion into sensors-detect (and for me too). That's why I plan to add it to our undetectable adapters list instead.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
The driver does it's internal device detection using Open Firmware. Take a look at this in the kernel source:
arch/ppc/kernel/prom.c
It's sort of like a PCI device table, except it includes all sorts of hardware interfaces besides just PCI devices. If you have a newer Mac around (made within the last few years), you can hold down option-o-f while booting to get into the Open Firmware 'shell'. It's a Forth type interpreter which lets you do various things like browse the hardware of the computer or change some boot params.
Links of interest:
http://playground.sun.com/1275/home.html
Here's a great tutorial from Apple:
http://developer.apple.com/technotes/tn/tn1061.html
Phil
Quoted 20 lines · Jean Delvare
Hi Benjamin, thanks for the fast reply.
Quoted 7 lines
Quoted 7 lines
I would like to add support for the Keywest to our sensors-detect script. I wonder if I should add it to the detectable adapters list or to the undetectable adapters list. Is there any way to detect it? Usually, we detect the adapters by matching a given PCI manufacturer:device ID and function.
Quoted 5 lines
Hrm... On 2.4, it's not that simple, there can be 2 keywest controllers, one on the northbridge, one on the southbridge, driving various parts.
You don't really help me ;) Does it show in lspci or somewhere else?