[lm-sensors] Support for W83627DHG

fabio.antonini at kaskonetworks.it fabio.antonini at kaskonetworks.it
Wed Mar 31 10:07:56 CEST 2010


Hi Jean
I have realized that the BIOS doesn't set the SIO_REG_ADDR as it should. 
So I have added a new parameter (force_addr) to let the user to write 
the LPC base address to the register.
Now the modified section is

    /* initialize SIO_REG_ADDR if BIOS doesn't set it */
    if (force_addr) {
        printk(KERN_WARNING DRVNAME ": Writing SIO_REG_ADDR 0x%x.\n", 
force_addr);
        superio_outb(sioaddr, SIO_REG_ADDR, force_addr >> 8);
        superio_outb(sioaddr, SIO_REG_ADDR + 1, force_addr & 0x00FF);
        /* Activate logical device if needed */
        val = superio_inb(sioaddr, SIO_REG_ENABLE);
        if (!(val & 0x01)) {
            printk(KERN_WARNING DRVNAME ": Enabling Super-I/O.\n");
            superio_outb(sioaddr, SIO_REG_ENABLE, val | 0x01);
        }
    }
   
    /* We have a known chip, find the HWM I/O address */
    superio_select(sioaddr, W83627EHF_LD_HWM);
    val = (superio_inb(sioaddr, SIO_REG_ADDR) << 8)
        | superio_inb(sioaddr, SIO_REG_ADDR + 1);
    printk(KERN_ERR DRVNAME ": val = 0x%x\n", val);
    *addr = val & IOREGION_ALIGNMENT;
    if (*addr == 0) {
        printk(KERN_ERR DRVNAME ": Refusing to enable a Super-I/O "
               "device with a base I/O port 0.\n");
        superio_exit(sioaddr);
        return -ENODEV;
    }

I'm not sure that this approach is correct. In your opinion is this 
reasonable or not?

Now i can load the driver by the following command:

# modprobe w83627ehf force_addr=0x290

I have attached a text file with the sensors-detect and sensors output 
message.
Now the driver is properly loaded. The tempeature and voltage detected 
are meaningless because the board I'm working on doesn't use the 
W83627EHF for temperature and voltage monitoring.
I need to use it for its GPIOs and parallel port. Do you know if anyone 
else has already worked on the GPIO or parallel section of the 
W83627ehf. At the moment my feeling is that both are not supported in 
the current driver.

Thanks a lot
with regards
fabio
Jean Delvare ha scritto:
> Hi Fabio,
>
> On Mon, 29 Mar 2010 16:50:32 +0200, fabio.antonini at kaskonetworks.it wrote:
>   
>> Dear all
>> I'm working on a board based on a ATOM Z530. The CPU module is called 
>> MSC_Q7 US15W and the mother board is named Q7-MB-RP.
>> At the moment I have succesfully booted a Ubuntu 9.10 distribution. All 
>> drivers seem to be
>> working except the SuperIO W83627. The chip is rightly detected but it's 
>> not loaded because the
>> driver (w83627ehf) claims that (from dmesg)
>>
>> "Refusing to enable a Super-I/O device with a base I/O port 0"
>>
>> The section of the driver involved on this step is
>>
>>      /* We have a known chip, find the HWM I/O address */
>>      superio_select(sioaddr, W83627EHF_LD_HWM);
>>      val = (superio_inb(sioaddr, SIO_REG_ADDR) << 8)
>>          | superio_inb(sioaddr, SIO_REG_ADDR + 1);
>>      *addr = val & IOREGION_ALIGNMENT;
>>      if (*addr == 0) {
>>          printk(KERN_ERR DRVNAME ": Refusing to enable a Super-I/O "
>>                 "device with a base I/O port 0.\n");
>>          superio_exit(sioaddr);
>>          return -ENODEV;
>>      }
>>
>> My feeling is that the SIO_REG_ADDR contains a 0x0 instead of a real
>> address. Who should set this address? Do I need another kernel module
>> that sets this address?
>>     
>
> It is the BIOS' job. Check in the BIOS is there is any option to enable
> hardware monitoring.
>
> Also check the documentation. The W83627DHG is a Super I/O chip with
> many functions, hardware monitoring is only one of them, and it is
> possible that hardware monitoring pins are simply not wired and that's
> the reason why the address isn't set.
>
>   
>> The output of sensors-detect is
>> (...)
>> As you can see the chip has been detected but no address has been 
>> specified:
>>
>> Found `Winbond W83627DHG Super IO Sensors'
>>      (but no address specified)
>>
>> Where can I set this address?
>>     
>
> There's no easy, standard way (because it is not normally needed.)
>
>   
>> What's missing?
>>     
>
> BIOS initialization, if anything.
>
>   
>> Has this driver been tested before on this board on Ubuntu 9.10?
>>     
>
> There are so many boards and so many Linux distributions out there that
> the probability that someone on this list can answer this question is
> next to zero.
>
>   
>> Do I need to enable anything in the BIOS?
>>     
>
> This is one possibility, yes.
>
>   
>> Do I need load the driver passing any parameter?
>>     
>
> No.
>
>   
>> Any help will appreciated.
>>     
>
> If you really want to, you can set the I/O base to an arbitrary port
> (e.g. 0x290, check in /proc/ioports that 0x290-0x297 is free first) and
> see if it helps. You can do this using the "isaset" command (be careful
> with that command, don't go writing to random I/O ports, it would hurt.)
>
>   


-- 
Fabio Antonini PhD
SW Designer
Kasko Networks srl
Loc.Boschetto, zona ind.le di Pile
67100 L'Aquila

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sensors.txt
URL: <http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20100331/638cbcf3/attachment-0001.txt>


More information about the lm-sensors mailing list