@@ -231,11 +231,11 @@ static int piix4_setup(struct pci_dev *PIIX4_dev,
231231}
232232
233233static int piix4_setup_sb800 (struct pci_dev * PIIX4_dev ,
234- const struct pci_device_id * id )
234+ const struct pci_device_id * id , u8 aux )
235235{
236236 unsigned short piix4_smba ;
237237 unsigned short smba_idx = 0xcd6 ;
238- u8 smba_en_lo , smba_en_hi , i2ccfg , i2ccfg_offset = 0x10 , smb_en = 0x2c ;
238+ u8 smba_en_lo , smba_en_hi , i2ccfg , i2ccfg_offset = 0x10 , smb_en ;
239239
240240 /* SB800 and later SMBus does not support forcing address */
241241 if (force || force_addr ) {
@@ -245,6 +245,8 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev,
245245 }
246246
247247 /* Determine the address of the SMBus areas */
248+ smb_en = (aux ) ? 0x28 : 0x2c ;
249+
248250 if (!request_region (smba_idx , 2 , "smba_idx" )) {
249251 dev_err (& PIIX4_dev -> dev , "SMBus base address index region "
250252 "0x%x already in use!\n" , smba_idx );
@@ -272,6 +274,13 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev,
272274 return - EBUSY ;
273275 }
274276
277+ /* Aux SMBus does not support IRQ information */
278+ if (aux ) {
279+ dev_info (& PIIX4_dev -> dev ,
280+ "SMBus Host Controller at 0x%x\n" , piix4_smba );
281+ return piix4_smba ;
282+ }
283+
275284 /* Request the SMBus I2C bus config region */
276285 if (!request_region (piix4_smba + i2ccfg_offset , 1 , "i2ccfg" )) {
277286 dev_err (& PIIX4_dev -> dev , "SMBus I2C bus config region "
@@ -597,7 +606,7 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
597606 dev -> revision >= 0x40 ) ||
598607 dev -> vendor == PCI_VENDOR_ID_AMD )
599608 /* base address location etc changed in SB800 */
600- retval = piix4_setup_sb800 (dev , id );
609+ retval = piix4_setup_sb800 (dev , id , 0 );
601610 else
602611 retval = piix4_setup (dev , id );
603612
@@ -611,17 +620,29 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
611620 return retval ;
612621
613622 /* Check for auxiliary SMBus on some AMD chipsets */
623+ retval = - ENODEV ;
624+
614625 if (dev -> vendor == PCI_VENDOR_ID_ATI &&
615- dev -> device == PCI_DEVICE_ID_ATI_SBX00_SMBUS &&
616- dev -> revision < 0x40 ) {
617- retval = piix4_setup_aux (dev , id , 0x58 );
618- if (retval > 0 ) {
619- /* Try to add the aux adapter if it exists,
620- * piix4_add_adapter will clean up if this fails */
621- piix4_add_adapter (dev , retval , & piix4_aux_adapter );
626+ dev -> device == PCI_DEVICE_ID_ATI_SBX00_SMBUS ) {
627+ if (dev -> revision < 0x40 ) {
628+ retval = piix4_setup_aux (dev , id , 0x58 );
629+ } else {
630+ /* SB800 added aux bus too */
631+ retval = piix4_setup_sb800 (dev , id , 1 );
622632 }
623633 }
624634
635+ if (dev -> vendor == PCI_VENDOR_ID_AMD &&
636+ dev -> device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS ) {
637+ retval = piix4_setup_sb800 (dev , id , 1 );
638+ }
639+
640+ if (retval > 0 ) {
641+ /* Try to add the aux adapter if it exists,
642+ * piix4_add_adapter will clean up if this fails */
643+ piix4_add_adapter (dev , retval , & piix4_aux_adapter );
644+ }
645+
625646 return 0 ;
626647}
627648
0 commit comments