All of lore.kernel.org
 help / color / mirror / Atom feed
From: bjorn@mork.no (Bjørn Mork)
To: lm-sensors@vger.kernel.org
Subject: SOLVED: Ticket #1409
Date: Thu, 19 May 2005 06:24:20 +0000	[thread overview]
Message-ID: <hvd6dewr71.fsf@rasputin.ws.nextra.no> (raw)
In-Reply-To: <hvvfr8digc.fsf@rasputin.ws.nextra.no>

Jean Delvare <khali@linux-fr.org> writes:

>> I wonder however, would it be possible to include a refined version of
>> the address detection code in the module?  I am willing to try to
>> write it myself, but I won't do it unless I know it has some remote
>> possibility of being included.
>
> Thanks a lot for reporting your findings. It will hopefully help some
> other folks someday.
>
> Here are the possibilities:
>
> 1* Add address 0x0d00 to sensors-detect.
> 2* Add address 0x0d00 to it87.
> 3* Add your code to it87.
> 4* Add what you found to the it87 doc.
> 5* Distribute your program into lm_sensors.

Maybe 4 or 1 is a good start?  I don't think 3 and 5 makes much sense
unless Asus or some other manufacturer really use other addresses than
0x290 and 0xd00. But that's of course difficult to detect without
providing 3 or 5...

> I'm not easy with ISA chips, since I only wrote I2C chip drivers so far.
> I know that ISA is typically a little bit more dangerous, but I don't
> know to which extent. I'd like to hear other people about that. 

I know linux-irda does similar things, but they kind of have to
because they must enable the irda function on the Super IO chips.
This doesn't seem to be necessary for enviroment control, probably
because it's enabled by the BIOS.

> I don't
> even understand what you code does (or, more precisely, how it does it)
> but it looks interesting. 

A Super IO chip typically uses two ports for configuration.  These
ports provide access to the internal registers on the chip.  On an
IT8712, these ports are fixed at 0x2e (address) and 0x2f (data) or
0x4e and 0x4f according to the data sheet.  The 0x2e address is
special since the magic key is always written to this port.

What the program does is
1) writes a magic key (0x87,0x01,0x55,0x55) to the IT8712 address port
   (0x2e).  This puts the chip in config mode (aka "MB PnP mode")
2) reads the chip id (0x8712) from registers 0x20 and 0x21.  This
   could be used to bail out if there isn't an IT8712F there, but then
   we've already written 0x87,0x01,0x55,0x55,0x20,0x21 to 0x2e, which
   I assume might be dangerous anyway...
3) changes to the "Environment Controller" Logical Device by writing 4
   to register 7.  This switches register bank for the next steps.
4) reads registers 0x60, 0x61 and 0x30, which contain i2c port address
   MSB and LSB, and Environment Controller Activate respectively
   (didn't really need the last one, but I wanted to make sure it was
   enabled).
5) sets bit 1 in register 2 to exit cleanly from config mode

> Is there a chance we could use it for
> something less specific than your own case? (in other words, how
> A7N8X-VM specific is it? how it8712F-specific?)

It is very IT8712F-specific.  I assume the other IT87-chips can be
handled by the same code, just with different chip ids in step 2, but
I would have to read the data sheets to be sure.

I also expect other Super IO chipsets to have the same detection
possibilities.  This is basically how they are detected by some (all?)
of the linux-irda drivers.  Take a look at the probe function in e.g.
linux/drivers/net/irda/smc-ircc.c.

> I really don't know wether it's better to just add the new address to
> the list, or include your detection code in some way.

I don't know either.  Maybe add a comment to the it87 docs first and
see if this is a common problem?  Something you could keep in mind if
users keep complaining that sensors-detect can't find the enviroment
controller and nothing shows up in the i2c scans.


Bj?rn

  reply	other threads:[~2005-05-19  6:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-19  6:24 SOLVED: Ticket #1409 Bjørn Mork
2005-05-19  6:24 ` Bjørn Mork [this message]
2005-05-19  6:24 ` Mark Studebaker
2005-05-19  6:24 ` Bjørn Mork
2005-05-19  6:24 ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=hvd6dewr71.fsf@rasputin.ws.nextra.no \
    --to=bjorn@mork.no \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.