/*-1* Copyright (c) 2016 Andriy Gapon <[email protected]>2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12*13* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND14* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE16* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE17* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL18* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS19* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)20* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT21* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY22* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF23* SUCH DAMAGE.24*/2526/*27* The following registers, bits and magic values are defined in Register28* Reference Guide documents for SB600, SB7x0, SB8x0, SB9x0 southbridges and29* various versions of Fusion Controller Hubs (FCHs). FCHs integrated into30* CPUs are documented in BIOS and Kernel Development Guide documents for31* the corresponding processor families.32*33* At present there are three classes of supported chipsets:34* - SB600 and S7x0 southbridges where the SMBus controller device has35* a PCI Device ID of 0x43851002 and a revision less than 0x4036* - several types of southbridges and FCHs:37* o SB8x0, SB9x0 southbridges where the SMBus controller device has a PCI38* Device ID of 0x43851002 and a revision greater than or equal to 0x4039* o FCHs where the controller has an ID of 0x780b1022 and a revision less40* than 0x41 (various variants of "Hudson" and "Bolton" as well as FCHs41* integrated into processors, e.g. "Kabini")42* o FCHs where the controller has an ID of 0x790b1022 and a revision less43* than 0x4944* - several types of FCHs:45* o FCHs where the SMBus controller device has a PCI Device ID of 0x780b102246* and a revision greater than or equal to 0x41 (integrated into "Mullins"47* processors, code named "ML")48* o FCHs where the controller has an ID of 0x790b1022 and a revision greater49* than or equal to 0x49 (integrated into "Carrizo" processors, code named50* "KERNCZ" or "CZ")51*52* The register definitions are compatible within the classes and may be53* incompatible across them.54*/5556/*57* IO registers for accessing the PMIO space.58* See SB7xx RRG 2.3.3.1.1, for instance.59*/60#define AMDSB_PMIO_INDEX 0xcd661#define AMDSB_PMIO_DATA (PMIO_INDEX + 1)62#define AMDSB_PMIO_WIDTH 26364/*65* SB7x0 and compatible registers in the PMIO space.66* See SB7xx RRG 2.3.3.2.67*/68#define AMDSB_PM_RESET_STATUS0 0x4469#define AMDSB_PM_RESET_STATUS1 0x4570#define AMDSB_WD_RST_STS 0x0271#define AMDSB_PM_WDT_CTRL 0x6972#define AMDSB_WDT_DISABLE 0x0173#define AMDSB_WDT_RES_MASK (0x02 | 0x04)74#define AMDSB_WDT_RES_32US 0x0075#define AMDSB_WDT_RES_10MS 0x0276#define AMDSB_WDT_RES_100MS 0x0477#define AMDSB_WDT_RES_1S 0x0678#define AMDSB_PM_WDT_BASE_LSB 0x6c79#define AMDSB_PM_WDT_BASE_MSB 0x6f8081/*82* SB8x0 and compatible registers in the PMIO space.83* See SB8xx RRG 2.3.3, for instance.84*/85#define AMDSB8_PM_SMBUS_EN 0x2c86#define AMDSB8_SMBUS_EN 0x0187#define AMDSB8_SMBUS_ADDR_MASK 0xffe0u88#define AMDSB8_PM_WDT_EN 0x4889#define AMDSB8_WDT_DEC_EN 0x0190#define AMDSB8_WDT_DISABLE 0x0291#define AMDSB8_PM_WDT_CTRL 0x4c92#define AMDSB8_WDT_32KHZ 0x0093#define AMDSB8_WDT_1HZ 0x0394#define AMDSB8_WDT_RES_MASK 0x0395#define AMDSB8_PM_RESET_STATUS 0xc0 /* 32 bit wide */96#define AMDSB8_WD_RST_STS 0x200000097#define AMDSB8_PM_RESET_CTRL 0xc498#define AMDSB8_RST_STS_DIS 0x0499100/*101* Newer FCH registers in the PMIO space.102* See BKDG for Family 16h Models 30h-3Fh 3.26.13 PMx00 and PMx04.103*/104#define AMDFCH41_PM_DECODE_EN0 0x00105#define AMDFCH41_SMBUS_EN 0x10106#define AMDFCH41_WDT_EN 0x80107#define AMDFCH41_PM_DECODE_EN1 0x01108#define AMDFCH41_PM_DECODE_EN3 0x03109#define AMDFCH41_WDT_RES_MASK 0x03110#define AMDFCH41_WDT_RES_32US 0x00111#define AMDFCH41_WDT_RES_10MS 0x01112#define AMDFCH41_WDT_RES_100MS 0x02113#define AMDFCH41_WDT_RES_1S 0x03114#define AMDFCH41_WDT_EN_MASK 0x0c115#define AMDFCH41_WDT_ENABLE 0x00116#define AMDFCH41_PM_ISA_CTRL 0x04117#define AMDFCH41_MMIO_EN 0x02118119/*120* Fixed MMIO addresses for accessing Watchdog and SMBus registers.121* See BKDG for Family 16h Models 30h-3Fh 3.26.13 PMx00 and PMx04.122*/123#define AMDFCH41_WDT_FIXED_ADDR 0xfeb00000u124#define AMDFCH41_MMIO_ADDR 0xfed80000u125#define AMDFCH41_MMIO_PM_OFF 0x0300126#define AMDFCH41_MMIO_SMBUS_OFF 0x0a00127#define AMDFCH41_MMIO_WDT_OFF 0x0b00128129/*130* PCI Device IDs and revisions.131* SB600 RRG 2.3.1.1,132* SB7xx RRG 2.3.1.1,133* SB8xx RRG 2.3.1,134* BKDG for Family 15h Models 60h-6Fh 3.26.6.1,135* BKDG for Family 15h Models 70h-7Fh 3.26.6.1,136* BKDG for Family 16h Models 00h-0Fh 3.26.7.1,137* BKDG for Family 16h Models 30h-3Fh 3.26.7.1.138* Also, see i2c-piix4 aka piix4_smbus Linux driver.139*/140#define AMDSB_SMBUS_DEVID 0x43851002141#define AMDSB8_SMBUS_REVID 0x40142#define AMDFCH_SMBUS_DEVID 0x780b1022143#define AMDFCH41_SMBUS_REVID 0x41144#define AMDCZ_SMBUS_DEVID 0x790b1022145#define AMDCZ49_SMBUS_REVID 0x49146#define AMDCZ51_SMBUS_REVID 0x51147148#define HYGONCZ_SMBUS_DEVID 0x790b1d94149150151