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