162306a36Sopenharmony_ci=======================
262306a36Sopenharmony_ciKernel driver i2c-piix4
362306a36Sopenharmony_ci=======================
462306a36Sopenharmony_ci
562306a36Sopenharmony_ciSupported adapters:
662306a36Sopenharmony_ci  * Intel 82371AB PIIX4 and PIIX4E
762306a36Sopenharmony_ci  * Intel 82443MX (440MX)
862306a36Sopenharmony_ci    Datasheet: Publicly available at the Intel website
962306a36Sopenharmony_ci  * ServerWorks OSB4, CSB5, CSB6, HT-1000 and HT-1100 southbridges
1062306a36Sopenharmony_ci    Datasheet: Only available via NDA from ServerWorks
1162306a36Sopenharmony_ci  * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges
1262306a36Sopenharmony_ci    Datasheet: Not publicly available
1362306a36Sopenharmony_ci    SB700 register reference available at:
1462306a36Sopenharmony_ci    http://support.amd.com/us/Embedded_TechDocs/43009_sb7xx_rrg_pub_1.00.pdf
1562306a36Sopenharmony_ci  * AMD SP5100 (SB700 derivative found on some server mainboards)
1662306a36Sopenharmony_ci    Datasheet: Publicly available at the AMD website
1762306a36Sopenharmony_ci    http://support.amd.com/us/Embedded_TechDocs/44413.pdf
1862306a36Sopenharmony_ci  * AMD Hudson-2, ML, CZ
1962306a36Sopenharmony_ci    Datasheet: Not publicly available
2062306a36Sopenharmony_ci  * Hygon CZ
2162306a36Sopenharmony_ci    Datasheet: Not publicly available
2262306a36Sopenharmony_ci  * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
2362306a36Sopenharmony_ci    Datasheet: Publicly available at the SMSC website http://www.smsc.com
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ciAuthors:
2662306a36Sopenharmony_ci	- Frodo Looijaard <frodol@dds.nl>
2762306a36Sopenharmony_ci	- Philip Edelbrock <phil@netroedge.com>
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ciModule Parameters
3162306a36Sopenharmony_ci-----------------
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci* force: int
3462306a36Sopenharmony_ci  Forcibly enable the PIIX4. DANGEROUS!
3562306a36Sopenharmony_ci* force_addr: int
3662306a36Sopenharmony_ci  Forcibly enable the PIIX4 at the given address. EXTREMELY DANGEROUS!
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ciDescription
4062306a36Sopenharmony_ci-----------
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ciThe PIIX4 (properly known as the 82371AB) is an Intel chip with a lot of
4362306a36Sopenharmony_cifunctionality. Among other things, it implements the PCI bus. One of its
4462306a36Sopenharmony_ciminor functions is implementing a System Management Bus. This is a true
4562306a36Sopenharmony_ciSMBus - you can not access it on I2C levels. The good news is that it
4662306a36Sopenharmony_cinatively understands SMBus commands and you do not have to worry about
4762306a36Sopenharmony_citiming problems. The bad news is that non-SMBus devices connected to it can
4862306a36Sopenharmony_ciconfuse it mightily. Yes, this is known to happen...
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ciDo ``lspci -v`` and see whether it contains an entry like this::
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci  0000:00:02.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02)
5362306a36Sopenharmony_ci	       Flags: medium devsel, IRQ 9
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ciBus and device numbers may differ, but the function number must be
5662306a36Sopenharmony_ciidentical (like many PCI devices, the PIIX4 incorporates a number of
5762306a36Sopenharmony_cidifferent 'functions', which can be considered as separate devices). If you
5862306a36Sopenharmony_cifind such an entry, you have a PIIX4 SMBus controller.
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ciOn some computers (most notably, some Dells), the SMBus is disabled by
6162306a36Sopenharmony_cidefault. If you use the insmod parameter 'force=1', the kernel module will
6262306a36Sopenharmony_citry to enable it. THIS IS VERY DANGEROUS! If the BIOS did not set up a
6362306a36Sopenharmony_cicorrect address for this module, you could get in big trouble (read:
6462306a36Sopenharmony_cicrashes, data corruption, etc.). Try this only as a last resort (try BIOS
6562306a36Sopenharmony_ciupdates first, for example), and backup first! An even more dangerous
6662306a36Sopenharmony_cioption is 'force_addr=<IOPORT>'. This will not only enable the PIIX4 like
6762306a36Sopenharmony_ci'force' does, but it will also set a new base I/O port address. The SMBus
6862306a36Sopenharmony_ciparts of the PIIX4 needs a range of 8 of these addresses to function
6962306a36Sopenharmony_cicorrectly. If these addresses are already reserved by some other device,
7062306a36Sopenharmony_ciyou will get into big trouble! DON'T USE THIS IF YOU ARE NOT VERY SURE
7162306a36Sopenharmony_ciABOUT WHAT YOU ARE DOING!
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ciThe PIIX4E is just an new version of the PIIX4; it is supported as well.
7462306a36Sopenharmony_ciThe PIIX/PIIX3 does not implement an SMBus or I2C bus, so you can't use
7562306a36Sopenharmony_cithis driver on those mainboards.
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ciThe ServerWorks Southbridges, the Intel 440MX, and the Victory66 are
7862306a36Sopenharmony_ciidentical to the PIIX4 in I2C/SMBus support.
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ciThe AMD SB700, SB800, SP5100 and Hudson-2 chipsets implement two
8162306a36Sopenharmony_ciPIIX4-compatible SMBus controllers. If your BIOS initializes the
8262306a36Sopenharmony_cisecondary controller, it will be detected by this driver as
8362306a36Sopenharmony_cian "Auxiliary SMBus Host Controller".
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ciIf you own Force CPCI735 motherboard or other OSB4 based systems you may need
8662306a36Sopenharmony_cito change the SMBus Interrupt Select register so the SMBus controller uses
8762306a36Sopenharmony_cithe SMI mode.
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci1) Use ``lspci`` command and locate the PCI device with the SMBus controller:
9062306a36Sopenharmony_ci   00:0f.0 ISA bridge: ServerWorks OSB4 South Bridge (rev 4f)
9162306a36Sopenharmony_ci   The line may vary for different chipsets. Please consult the driver source
9262306a36Sopenharmony_ci   for all possible PCI ids (and ``lspci -n`` to match them). Let's assume the
9362306a36Sopenharmony_ci   device is located at 00:0f.0.
9462306a36Sopenharmony_ci2) Now you just need to change the value in 0xD2 register. Get it first with
9562306a36Sopenharmony_ci   command: ``lspci -xxx -s 00:0f.0``
9662306a36Sopenharmony_ci   If the value is 0x3 then you need to change it to 0x1:
9762306a36Sopenharmony_ci   ``setpci  -s 00:0f.0 d2.b=1``
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ciPlease note that you don't need to do that in all cases, just when the SMBus is
10062306a36Sopenharmony_cinot working properly.
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ciHardware-specific issues
10462306a36Sopenharmony_ci------------------------
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ciThis driver will refuse to load on IBM systems with an Intel PIIX4 SMBus.
10762306a36Sopenharmony_ciSome of these machines have an RFID EEPROM (24RF08) connected to the SMBus,
10862306a36Sopenharmony_ciwhich can easily get corrupted due to a state machine bug. These are mostly
10962306a36Sopenharmony_ciThinkpad laptops, but desktop systems may also be affected. We have no list
11062306a36Sopenharmony_ciof all affected systems, so the only safe solution was to prevent access to
11162306a36Sopenharmony_cithe SMBus on all IBM systems (detected using DMI data.)
112