xref: /OK3568_Linux_fs/kernel/Documentation/i2c/busses/i2c-piix4.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun=======================
2*4882a593SmuzhiyunKernel driver i2c-piix4
3*4882a593Smuzhiyun=======================
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunSupported adapters:
6*4882a593Smuzhiyun  * Intel 82371AB PIIX4 and PIIX4E
7*4882a593Smuzhiyun  * Intel 82443MX (440MX)
8*4882a593Smuzhiyun    Datasheet: Publicly available at the Intel website
9*4882a593Smuzhiyun  * ServerWorks OSB4, CSB5, CSB6, HT-1000 and HT-1100 southbridges
10*4882a593Smuzhiyun    Datasheet: Only available via NDA from ServerWorks
11*4882a593Smuzhiyun  * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges
12*4882a593Smuzhiyun    Datasheet: Not publicly available
13*4882a593Smuzhiyun    SB700 register reference available at:
14*4882a593Smuzhiyun    http://support.amd.com/us/Embedded_TechDocs/43009_sb7xx_rrg_pub_1.00.pdf
15*4882a593Smuzhiyun  * AMD SP5100 (SB700 derivative found on some server mainboards)
16*4882a593Smuzhiyun    Datasheet: Publicly available at the AMD website
17*4882a593Smuzhiyun    http://support.amd.com/us/Embedded_TechDocs/44413.pdf
18*4882a593Smuzhiyun  * AMD Hudson-2, ML, CZ
19*4882a593Smuzhiyun    Datasheet: Not publicly available
20*4882a593Smuzhiyun  * Hygon CZ
21*4882a593Smuzhiyun    Datasheet: Not publicly available
22*4882a593Smuzhiyun  * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
23*4882a593Smuzhiyun    Datasheet: Publicly available at the SMSC website http://www.smsc.com
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunAuthors:
26*4882a593Smuzhiyun	- Frodo Looijaard <frodol@dds.nl>
27*4882a593Smuzhiyun	- Philip Edelbrock <phil@netroedge.com>
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunModule Parameters
31*4882a593Smuzhiyun-----------------
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun* force: int
34*4882a593Smuzhiyun  Forcibly enable the PIIX4. DANGEROUS!
35*4882a593Smuzhiyun* force_addr: int
36*4882a593Smuzhiyun  Forcibly enable the PIIX4 at the given address. EXTREMELY DANGEROUS!
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunDescription
40*4882a593Smuzhiyun-----------
41*4882a593Smuzhiyun
42*4882a593SmuzhiyunThe PIIX4 (properly known as the 82371AB) is an Intel chip with a lot of
43*4882a593Smuzhiyunfunctionality. Among other things, it implements the PCI bus. One of its
44*4882a593Smuzhiyunminor functions is implementing a System Management Bus. This is a true
45*4882a593SmuzhiyunSMBus - you can not access it on I2C levels. The good news is that it
46*4882a593Smuzhiyunnatively understands SMBus commands and you do not have to worry about
47*4882a593Smuzhiyuntiming problems. The bad news is that non-SMBus devices connected to it can
48*4882a593Smuzhiyunconfuse it mightily. Yes, this is known to happen...
49*4882a593Smuzhiyun
50*4882a593SmuzhiyunDo ``lspci -v`` and see whether it contains an entry like this::
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun  0000:00:02.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02)
53*4882a593Smuzhiyun	       Flags: medium devsel, IRQ 9
54*4882a593Smuzhiyun
55*4882a593SmuzhiyunBus and device numbers may differ, but the function number must be
56*4882a593Smuzhiyunidentical (like many PCI devices, the PIIX4 incorporates a number of
57*4882a593Smuzhiyundifferent 'functions', which can be considered as separate devices). If you
58*4882a593Smuzhiyunfind such an entry, you have a PIIX4 SMBus controller.
59*4882a593Smuzhiyun
60*4882a593SmuzhiyunOn some computers (most notably, some Dells), the SMBus is disabled by
61*4882a593Smuzhiyundefault. If you use the insmod parameter 'force=1', the kernel module will
62*4882a593Smuzhiyuntry to enable it. THIS IS VERY DANGEROUS! If the BIOS did not set up a
63*4882a593Smuzhiyuncorrect address for this module, you could get in big trouble (read:
64*4882a593Smuzhiyuncrashes, data corruption, etc.). Try this only as a last resort (try BIOS
65*4882a593Smuzhiyunupdates first, for example), and backup first! An even more dangerous
66*4882a593Smuzhiyunoption is 'force_addr=<IOPORT>'. This will not only enable the PIIX4 like
67*4882a593Smuzhiyun'force' foes, but it will also set a new base I/O port address. The SMBus
68*4882a593Smuzhiyunparts of the PIIX4 needs a range of 8 of these addresses to function
69*4882a593Smuzhiyuncorrectly. If these addresses are already reserved by some other device,
70*4882a593Smuzhiyunyou will get into big trouble! DON'T USE THIS IF YOU ARE NOT VERY SURE
71*4882a593SmuzhiyunABOUT WHAT YOU ARE DOING!
72*4882a593Smuzhiyun
73*4882a593SmuzhiyunThe PIIX4E is just an new version of the PIIX4; it is supported as well.
74*4882a593SmuzhiyunThe PIIX/PIIX3 does not implement an SMBus or I2C bus, so you can't use
75*4882a593Smuzhiyunthis driver on those mainboards.
76*4882a593Smuzhiyun
77*4882a593SmuzhiyunThe ServerWorks Southbridges, the Intel 440MX, and the Victory66 are
78*4882a593Smuzhiyunidentical to the PIIX4 in I2C/SMBus support.
79*4882a593Smuzhiyun
80*4882a593SmuzhiyunThe AMD SB700, SB800, SP5100 and Hudson-2 chipsets implement two
81*4882a593SmuzhiyunPIIX4-compatible SMBus controllers. If your BIOS initializes the
82*4882a593Smuzhiyunsecondary controller, it will be detected by this driver as
83*4882a593Smuzhiyunan "Auxiliary SMBus Host Controller".
84*4882a593Smuzhiyun
85*4882a593SmuzhiyunIf you own Force CPCI735 motherboard or other OSB4 based systems you may need
86*4882a593Smuzhiyunto change the SMBus Interrupt Select register so the SMBus controller uses
87*4882a593Smuzhiyunthe SMI mode.
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun1) Use lspci command and locate the PCI device with the SMBus controller:
90*4882a593Smuzhiyun   00:0f.0 ISA bridge: ServerWorks OSB4 South Bridge (rev 4f)
91*4882a593Smuzhiyun   The line may vary for different chipsets. Please consult the driver source
92*4882a593Smuzhiyun   for all possible PCI ids (and lspci -n to match them). Lets assume the
93*4882a593Smuzhiyun   device is located at 00:0f.0.
94*4882a593Smuzhiyun2) Now you just need to change the value in 0xD2 register. Get it first with
95*4882a593Smuzhiyun   command: lspci -xxx -s 00:0f.0
96*4882a593Smuzhiyun   If the value is 0x3 then you need to change it to 0x1:
97*4882a593Smuzhiyun   setpci  -s 00:0f.0 d2.b=1
98*4882a593Smuzhiyun
99*4882a593SmuzhiyunPlease note that you don't need to do that in all cases, just when the SMBus is
100*4882a593Smuzhiyunnot working properly.
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun
103*4882a593SmuzhiyunHardware-specific issues
104*4882a593Smuzhiyun------------------------
105*4882a593Smuzhiyun
106*4882a593SmuzhiyunThis driver will refuse to load on IBM systems with an Intel PIIX4 SMBus.
107*4882a593SmuzhiyunSome of these machines have an RFID EEPROM (24RF08) connected to the SMBus,
108*4882a593Smuzhiyunwhich can easily get corrupted due to a state machine bug. These are mostly
109*4882a593SmuzhiyunThinkpad laptops, but desktop systems may also be affected. We have no list
110*4882a593Smuzhiyunof all affected systems, so the only safe solution was to prevent access to
111*4882a593Smuzhiyunthe SMBus on all IBM systems (detected using DMI data.)
112*4882a593Smuzhiyun
113*4882a593SmuzhiyunFor additional information, read:
114*4882a593Smuzhiyunhttp://www.lm-sensors.org/browser/lm-sensors/trunk/README
115