Lines Matching +full:ati +full:- +full:base
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 Copyright (c) 1998 - 2002 Frodo Looijaard <frodol@dds.nl> and
11 Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100
12 ATI IXP200, IXP300, IXP400, SB600, SB700/SP5100, SB800
13 AMD Hudson-2, ML, CZ
74 /* Multi-port constants */
87 * Hudson-2/Bolton port is always selected by bits 2:1 of register 0x2f.
124 DMI_MATCH(DMI_BOARD_NAME, "PC-AM2RD790"),
138 on Intel-based systems */
173 if ((PIIX4_dev->vendor == PCI_VENDOR_ID_SERVERWORKS) && in piix4_setup()
174 (PIIX4_dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5)) in piix4_setup()
180 dev_err(&PIIX4_dev->dev, in piix4_setup()
182 return -EPERM; in piix4_setup()
187 PIIX4_dev->vendor == PCI_VENDOR_ID_INTEL) { in piix4_setup()
188 dev_err(&PIIX4_dev->dev, "IBM system detected; this module " in piix4_setup()
191 return -EPERM; in piix4_setup()
202 dev_err(&PIIX4_dev->dev, "SMBus base address " in piix4_setup()
203 "uninitialized - upgrade BIOS or use " in piix4_setup()
205 return -ENODEV; in piix4_setup()
210 return -ENODEV; in piix4_setup()
213 dev_err(&PIIX4_dev->dev, "SMBus region 0x%x already in use!\n", in piix4_setup()
215 return -EBUSY; in piix4_setup()
226 dev_info(&PIIX4_dev->dev, "WARNING: SMBus interface set to " in piix4_setup()
240 dev_notice(&PIIX4_dev->dev, in piix4_setup()
243 dev_err(&PIIX4_dev->dev, in piix4_setup()
246 return -ENODEV; in piix4_setup()
251 dev_dbg(&PIIX4_dev->dev, "Using IRQ for SMBus\n"); in piix4_setup()
253 dev_dbg(&PIIX4_dev->dev, "Using SMI# for SMBus\n"); in piix4_setup()
255 dev_err(&PIIX4_dev->dev, "Illegal Interrupt configuration " in piix4_setup()
259 dev_info(&PIIX4_dev->dev, in piix4_setup()
275 dev_err(&PIIX4_dev->dev, "SMBus does not support " in piix4_setup_sb800()
277 return -EINVAL; in piix4_setup_sb800()
281 if ((PIIX4_dev->vendor == PCI_VENDOR_ID_AMD && in piix4_setup_sb800()
282 PIIX4_dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS && in piix4_setup_sb800()
283 PIIX4_dev->revision >= 0x41) || in piix4_setup_sb800()
284 (PIIX4_dev->vendor == PCI_VENDOR_ID_AMD && in piix4_setup_sb800()
285 PIIX4_dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS && in piix4_setup_sb800()
286 PIIX4_dev->revision >= 0x49) || in piix4_setup_sb800()
287 (PIIX4_dev->vendor == PCI_VENDOR_ID_HYGON && in piix4_setup_sb800()
288 PIIX4_dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS)) in piix4_setup_sb800()
294 dev_err(&PIIX4_dev->dev, in piix4_setup_sb800()
295 "SMB base address index region 0x%x already in use.\n", in piix4_setup_sb800()
297 return -EBUSY; in piix4_setup_sb800()
318 dev_err(&PIIX4_dev->dev, in piix4_setup_sb800()
320 return -ENODEV; in piix4_setup_sb800()
324 return -ENODEV; in piix4_setup_sb800()
327 dev_err(&PIIX4_dev->dev, "SMBus region 0x%x already in use!\n", in piix4_setup_sb800()
329 return -EBUSY; in piix4_setup_sb800()
334 dev_info(&PIIX4_dev->dev, in piix4_setup_sb800()
342 dev_err(&PIIX4_dev->dev, "SMBus I2C bus config region " in piix4_setup_sb800()
345 return -EBUSY; in piix4_setup_sb800()
351 dev_dbg(&PIIX4_dev->dev, "Using IRQ for SMBus\n"); in piix4_setup_sb800()
353 dev_dbg(&PIIX4_dev->dev, "Using SMI# for SMBus\n"); in piix4_setup_sb800()
355 dev_info(&PIIX4_dev->dev, in piix4_setup_sb800()
360 if (PIIX4_dev->vendor == PCI_VENDOR_ID_AMD || in piix4_setup_sb800()
361 PIIX4_dev->vendor == PCI_VENDOR_ID_HYGON) { in piix4_setup_sb800()
362 if (PIIX4_dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS || in piix4_setup_sb800()
363 (PIIX4_dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS && in piix4_setup_sb800()
364 PIIX4_dev->revision >= 0x1F)) { in piix4_setup_sb800()
377 return -EBUSY; in piix4_setup_sb800()
390 dev_info(&PIIX4_dev->dev, in piix4_setup_sb800()
409 dev_dbg(&PIIX4_dev->dev, in piix4_setup_aux()
411 return -ENODEV; in piix4_setup_aux()
416 dev_dbg(&PIIX4_dev->dev, in piix4_setup_aux()
417 "Auxiliary SMBus base address uninitialized\n"); in piix4_setup_aux()
418 return -ENODEV; in piix4_setup_aux()
422 return -ENODEV; in piix4_setup_aux()
425 dev_err(&PIIX4_dev->dev, "Auxiliary SMBus region 0x%x " in piix4_setup_aux()
427 return -EBUSY; in piix4_setup_aux()
430 dev_info(&PIIX4_dev->dev, in piix4_setup_aux()
440 unsigned short piix4_smba = adapdata->smba; in piix4_transaction()
445 dev_dbg(&piix4_adapter->dev, "Transaction (pre): CNT=%02x, CMD=%02x, " in piix4_transaction()
452 dev_dbg(&piix4_adapter->dev, "SMBus busy (%02x). " in piix4_transaction()
456 dev_err(&piix4_adapter->dev, "Failed! (%02x)\n", temp); in piix4_transaction()
457 return -EBUSY; in piix4_transaction()
459 dev_dbg(&piix4_adapter->dev, "Successful!\n"); in piix4_transaction()
478 dev_err(&piix4_adapter->dev, "SMBus Timeout!\n"); in piix4_transaction()
479 result = -ETIMEDOUT; in piix4_transaction()
483 result = -EIO; in piix4_transaction()
484 dev_err(&piix4_adapter->dev, "Error: Failed bus transaction\n"); in piix4_transaction()
488 result = -EIO; in piix4_transaction()
489 dev_dbg(&piix4_adapter->dev, "Bus collision! SMBus may be " in piix4_transaction()
491 /* Clock stops and slave is stuck in mid-transmission */ in piix4_transaction()
495 result = -ENXIO; in piix4_transaction()
496 dev_dbg(&piix4_adapter->dev, "Error: no response!\n"); in piix4_transaction()
503 dev_err(&piix4_adapter->dev, "Failed reset at end of " in piix4_transaction()
506 dev_dbg(&piix4_adapter->dev, "Transaction (post): CNT=%02x, CMD=%02x, " in piix4_transaction()
519 unsigned short piix4_smba = adapdata->smba; in piix4_access()
541 outb_p(data->byte, SMBHSTDAT0); in piix4_access()
549 outb_p(data->word & 0xff, SMBHSTDAT0); in piix4_access()
550 outb_p((data->word & 0xff00) >> 8, SMBHSTDAT1); in piix4_access()
559 len = data->block[0]; in piix4_access()
561 return -EINVAL; in piix4_access()
565 outb_p(data->block[i], SMBBLKDAT); in piix4_access()
570 dev_warn(&adap->dev, "Unsupported transaction %d\n", size); in piix4_access()
571 return -EOPNOTSUPP; in piix4_access()
587 data->byte = inb_p(SMBHSTDAT0); in piix4_access()
590 data->word = inb_p(SMBHSTDAT0) + (inb_p(SMBHSTDAT1) << 8); in piix4_access()
593 data->block[0] = inb_p(SMBHSTDAT0); in piix4_access()
594 if (data->block[0] == 0 || data->block[0] > I2C_SMBUS_BLOCK_MAX) in piix4_access()
595 return -EPROTO; in piix4_access()
597 for (i = 1; i <= data->block[0]; i++) in piix4_access()
598 data->block[i] = inb_p(SMBBLKDAT); in piix4_access()
621 return -EBUSY; in piix4_imc_sleep()
630 while (timeout--) { in piix4_imc_sleep()
639 return -ETIMEDOUT; in piix4_imc_sleep()
656 while (timeout--) { in piix4_imc_wakeup()
678 unsigned short piix4_smba = adapdata->smba; in piix4_access_sb800()
686 return -EBUSY; in piix4_access_sb800()
699 } while (--retries); in piix4_access_sb800()
702 retval = -EBUSY; in piix4_access_sb800()
715 if ((size == I2C_SMBUS_BLOCK_DATA) && adapdata->notify_imc) { in piix4_access_sb800()
720 case -EBUSY: in piix4_access_sb800()
721 dev_warn(&adap->dev, in piix4_access_sb800()
722 "IMC base address index region 0x%x already in use.\n", in piix4_access_sb800()
725 case -ETIMEDOUT: in piix4_access_sb800()
726 dev_warn(&adap->dev, in piix4_access_sb800()
735 dev_warn(&adap->dev, in piix4_access_sb800()
737 adapdata->notify_imc = false; in piix4_access_sb800()
744 port = adapdata->port; in piix4_access_sb800()
757 if ((size == I2C_SMBUS_BLOCK_DATA) && adapdata->notify_imc) in piix4_access_sb800()
824 return -ENOMEM; in piix4_add_adapter()
827 adap->owner = THIS_MODULE; in piix4_add_adapter()
828 adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; in piix4_add_adapter()
829 adap->algo = sb800_main ? &piix4_smbus_algorithm_sb800 in piix4_add_adapter()
836 return -ENOMEM; in piix4_add_adapter()
839 adapdata->smba = smba; in piix4_add_adapter()
840 adapdata->sb800_main = sb800_main; in piix4_add_adapter()
841 adapdata->port = port << piix4_port_shift_sb800; in piix4_add_adapter()
842 adapdata->notify_imc = notify_imc; in piix4_add_adapter()
845 adap->dev.parent = &dev->dev; in piix4_add_adapter()
847 if (has_acpi_companion(&dev->dev)) { in piix4_add_adapter()
848 acpi_preset_companion(&adap->dev, in piix4_add_adapter()
849 ACPI_COMPANION(&dev->dev), in piix4_add_adapter()
853 snprintf(adap->name, sizeof(adap->name), in piix4_add_adapter()
877 if (dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS || in piix4_add_adapters_sb800()
878 (dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS && in piix4_add_adapters_sb800()
879 dev->revision >= 0x1F)) { in piix4_add_adapters_sb800()
899 dev_err(&dev->dev, in piix4_add_adapters_sb800()
901 while (--port >= 0) { in piix4_add_adapters_sb800()
903 if (adapdata->smba) { in piix4_add_adapters_sb800()
919 if ((dev->vendor == PCI_VENDOR_ID_ATI && in piix4_probe()
920 dev->device == PCI_DEVICE_ID_ATI_SBX00_SMBUS && in piix4_probe()
921 dev->revision >= 0x40) || in piix4_probe()
922 dev->vendor == PCI_VENDOR_ID_AMD || in piix4_probe()
923 dev->vendor == PCI_VENDOR_ID_HYGON) { in piix4_probe()
927 if ((dev->vendor == PCI_VENDOR_ID_AMD || in piix4_probe()
928 dev->vendor == PCI_VENDOR_ID_HYGON) && in piix4_probe()
929 dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) { in piix4_probe()
936 pci_bus_read_config_byte(dev->bus, PCI_DEVFN(0x14, 3), in piix4_probe()
942 /* base address location etc changed in SB800 */ in piix4_probe()
967 retval = -ENODEV; in piix4_probe()
969 if (dev->vendor == PCI_VENDOR_ID_ATI && in piix4_probe()
970 dev->device == PCI_DEVICE_ID_ATI_SBX00_SMBUS) { in piix4_probe()
971 if (dev->revision < 0x40) { in piix4_probe()
979 if (dev->vendor == PCI_VENDOR_ID_AMD && in piix4_probe()
980 (dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS || in piix4_probe()
981 dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS)) { in piix4_probe()
1000 if (adapdata->smba) { in piix4_adap_remove()
1002 if (adapdata->port == (0 << piix4_port_shift_sb800)) in piix4_adap_remove()
1003 release_region(adapdata->smba, SMBIOSIZE); in piix4_adap_remove()
1013 while (--port >= 0) { in piix4_remove()