aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/i2c/busses/i2c-piix42
-rw-r--r--drivers/i2c/busses/Kconfig1
-rw-r--r--drivers/i2c/busses/i2c-piix4.c28
3 files changed, 25 insertions, 6 deletions
diff --git a/Documentation/i2c/busses/i2c-piix4 b/Documentation/i2c/busses/i2c-piix4
index c097e0f020fe..aa959fd22450 100644
--- a/Documentation/i2c/busses/i2c-piix4
+++ b/Documentation/i2c/busses/i2c-piix4
@@ -13,7 +13,7 @@ Supported adapters:
13 * AMD SP5100 (SB700 derivative found on some server mainboards) 13 * AMD SP5100 (SB700 derivative found on some server mainboards)
14 Datasheet: Publicly available at the AMD website 14 Datasheet: Publicly available at the AMD website
15 http://support.amd.com/us/Embedded_TechDocs/44413.pdf 15 http://support.amd.com/us/Embedded_TechDocs/44413.pdf
16 * AMD Hudson-2, CZ 16 * AMD Hudson-2, ML, CZ
17 Datasheet: Not publicly available 17 Datasheet: Not publicly available
18 * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge 18 * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
19 Datasheet: Publicly available at the SMSC website http://www.smsc.com 19 Datasheet: Publicly available at the SMSC website http://www.smsc.com
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 6bcdea5856af..f5ed03164d86 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -152,6 +152,7 @@ config I2C_PIIX4
152 ATI SB700/SP5100 152 ATI SB700/SP5100
153 ATI SB800 153 ATI SB800
154 AMD Hudson-2 154 AMD Hudson-2
155 AMD ML
155 AMD CZ 156 AMD CZ
156 Serverworks OSB4 157 Serverworks OSB4
157 Serverworks CSB5 158 Serverworks CSB5
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index a028617b8f13..f71b4d381c00 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -22,7 +22,7 @@
22 Intel PIIX4, 440MX 22 Intel PIIX4, 440MX
23 Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100 23 Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100
24 ATI IXP200, IXP300, IXP400, SB600, SB700/SP5100, SB800 24 ATI IXP200, IXP300, IXP400, SB600, SB700/SP5100, SB800
25 AMD Hudson-2, CZ 25 AMD Hudson-2, ML, CZ
26 SMSC Victory66 26 SMSC Victory66
27 27
28 Note: we assume there can only be one device, with one or more 28 Note: we assume there can only be one device, with one or more
@@ -235,7 +235,8 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev,
235{ 235{
236 unsigned short piix4_smba; 236 unsigned short piix4_smba;
237 unsigned short smba_idx = 0xcd6; 237 unsigned short smba_idx = 0xcd6;
238 u8 smba_en_lo, smba_en_hi, i2ccfg, i2ccfg_offset = 0x10, smb_en; 238 u8 smba_en_lo, smba_en_hi, smb_en, smb_en_status;
239 u8 i2ccfg, i2ccfg_offset = 0x10;
239 240
240 /* SB800 and later SMBus does not support forcing address */ 241 /* SB800 and later SMBus does not support forcing address */
241 if (force || force_addr) { 242 if (force || force_addr) {
@@ -245,7 +246,15 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev,
245 } 246 }
246 247
247 /* Determine the address of the SMBus areas */ 248 /* Determine the address of the SMBus areas */
248 smb_en = (aux) ? 0x28 : 0x2c; 249 if ((PIIX4_dev->vendor == PCI_VENDOR_ID_AMD &&
250 PIIX4_dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS &&
251 PIIX4_dev->revision >= 0x41) ||
252 (PIIX4_dev->vendor == PCI_VENDOR_ID_AMD &&
253 PIIX4_dev->device == 0x790b &&
254 PIIX4_dev->revision >= 0x49))
255 smb_en = 0x00;
256 else
257 smb_en = (aux) ? 0x28 : 0x2c;
249 258
250 if (!request_region(smba_idx, 2, "smba_idx")) { 259 if (!request_region(smba_idx, 2, "smba_idx")) {
251 dev_err(&PIIX4_dev->dev, "SMBus base address index region " 260 dev_err(&PIIX4_dev->dev, "SMBus base address index region "
@@ -258,13 +267,22 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev,
258 smba_en_hi = inb_p(smba_idx + 1); 267 smba_en_hi = inb_p(smba_idx + 1);
259 release_region(smba_idx, 2); 268 release_region(smba_idx, 2);
260 269
261 if ((smba_en_lo & 1) == 0) { 270 if (!smb_en) {
271 smb_en_status = smba_en_lo & 0x10;
272 piix4_smba = smba_en_hi << 8;
273 if (aux)
274 piix4_smba |= 0x20;
275 } else {
276 smb_en_status = smba_en_lo & 0x01;
277 piix4_smba = ((smba_en_hi << 8) | smba_en_lo) & 0xffe0;
278 }
279
280 if (!smb_en_status) {
262 dev_err(&PIIX4_dev->dev, 281 dev_err(&PIIX4_dev->dev,
263 "Host SMBus controller not enabled!\n"); 282 "Host SMBus controller not enabled!\n");
264 return -ENODEV; 283 return -ENODEV;
265 } 284 }
266 285
267 piix4_smba = ((smba_en_hi << 8) | smba_en_lo) & 0xffe0;
268 if (acpi_check_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) 286 if (acpi_check_region(piix4_smba, SMBIOSIZE, piix4_driver.name))
269 return -ENODEV; 287 return -ENODEV;
270 288