Angel Pons | 182dbde | 2020-04-02 23:49:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 2 | |
| 3 | #ifndef SOUTHBRIDGE_INTEL_I82801GX_I82801IX_H |
| 4 | #define SOUTHBRIDGE_INTEL_I82801GX_I82801IX_H |
| 5 | |
Kevin Paul Herbert | bde6d30 | 2014-12-24 18:43:20 -0800 | [diff] [blame] | 6 | #define DEFAULT_TBAR ((u8 *)0xfed1b000) |
Arthur Heymans | 2e464cf | 2018-06-13 00:07:09 +0200 | [diff] [blame] | 7 | |
| 8 | #include <southbridge/intel/common/rcba.h> |
Kevin Paul Herbert | bde6d30 | 2014-12-24 18:43:20 -0800 | [diff] [blame] | 9 | |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 10 | #if CONFIG(BOARD_EMULATION_QEMU_X86_Q35) |
Gerd Hoffmann | b142a51 | 2013-09-17 09:49:02 +0200 | [diff] [blame] | 11 | /* |
| 12 | * Qemu has the fw_cfg interface at 0x510. Move the pmbase to a |
| 13 | * non-conflicting address. No need to worry about speedstep, it |
| 14 | * is not supported by qemu and isn't enabled in the qemu config. |
| 15 | */ |
| 16 | # define DEFAULT_PMBASE 0x00000600 |
| 17 | #else |
| 18 | # define DEFAULT_PMBASE 0x00000500 /* Speedstep code has this hardcoded, too. */ |
| 19 | #endif |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 20 | #define DEFAULT_TCOBASE (DEFAULT_PMBASE + 0x60) |
| 21 | #define DEFAULT_GPIOBASE 0x00000580 |
| 22 | |
| 23 | |
| 24 | #define APM_CNT 0xb2 |
| 25 | |
| 26 | #define PM1_STS 0x00 |
| 27 | #define PWRBTN_STS (1 << 8) |
| 28 | #define RTC_STS (1 << 10) |
| 29 | #define PM1_EN 0x02 |
| 30 | #define PWRBTN_EN (1 << 8) |
| 31 | #define GBL_EN (1 << 5) |
| 32 | #define PM1_CNT 0x04 |
| 33 | #define SCI_EN (1 << 0) |
| 34 | #define PM_LV2 0x14 |
| 35 | #define PM_LV3 0x15 |
| 36 | #define PM_LV4 0x16 |
| 37 | #define PM_LV5 0x17 |
| 38 | #define PM_LV6 0x18 |
| 39 | #define GPE0_STS 0x20 |
| 40 | #define SMI_EN 0x30 |
| 41 | #define PERIODIC_EN (1 << 14) |
| 42 | #define TCO_EN (1 << 13) |
| 43 | #define APMC_EN (1 << 5) |
| 44 | #define BIOS_EN (1 << 2) |
| 45 | #define EOS (1 << 1) |
| 46 | #define GBL_SMI_EN (1 << 0) |
| 47 | #define SMI_STS 0x34 |
| 48 | #define ALT_GP_SMI_EN 0x38 |
| 49 | #define ALT_GP_SMI_STS 0x3a |
| 50 | |
| 51 | |
Timothy Pearson | 58649b0 | 2015-04-05 18:03:15 -0500 | [diff] [blame] | 52 | #define GP_IO_USE_SEL 0x00 |
| 53 | #define GP_IO_SEL 0x04 |
| 54 | #define GP_LVL 0x0c |
| 55 | #define GPO_BLINK 0x18 |
| 56 | #define GPI_INV 0x2c |
| 57 | #define GP_IO_USE_SEL2 0x30 |
| 58 | #define GP_IO_SEL2 0x34 |
| 59 | #define GP_LVL2 0x38 |
| 60 | |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 61 | #define DEBUG_PERIODIC_SMIS 0 |
| 62 | |
| 63 | #define MAINBOARD_POWER_OFF 0 |
| 64 | #define MAINBOARD_POWER_ON 1 |
| 65 | #define MAINBOARD_POWER_KEEP 2 |
| 66 | |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 67 | /* D31:F0 LPC bridge */ |
| 68 | #define D31F0_PMBASE 0x40 |
| 69 | #define D31F0_ACPI_CNTL 0x44 |
| 70 | #define D31F0_GPIO_BASE 0x48 |
| 71 | #define D31F0_GPIO_CNTL 0x4c |
| 72 | #define D31F0_PIRQA_ROUT 0x60 |
| 73 | #define D31F0_PIRQB_ROUT 0x61 |
| 74 | #define D31F0_PIRQC_ROUT 0x62 |
| 75 | #define D31F0_PIRQD_ROUT 0x63 |
| 76 | #define D31F0_SERIRQ_CNTL 0x64 |
| 77 | #define D31F0_PIRQE_ROUT 0x68 |
| 78 | #define D31F0_PIRQF_ROUT 0x69 |
| 79 | #define D31F0_PIRQG_ROUT 0x6a |
| 80 | #define D31F0_PIRQH_ROUT 0x6b |
| 81 | #define D31F0_LPC_IODEC 0x80 |
| 82 | #define D31F0_LPC_EN 0x82 |
| 83 | #define D31F0_GEN1_DEC 0x84 |
Vladimir Serbinenko | 9d2cb7c | 2014-08-10 21:56:41 +0200 | [diff] [blame] | 84 | #define D31F0_GEN2_DEC 0x88 |
| 85 | #define D31F0_GEN3_DEC 0x8c |
| 86 | #define D31F0_GEN4_DEC 0x90 |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 87 | #define D31F0_GEN_PMCON_1 0xa0 |
| 88 | #define D31F0_GEN_PMCON_3 0xa4 |
| 89 | #define D31F0_C5_EXIT_TIMING 0xa8 |
| 90 | #define D31F0_CxSTATE_CNF 0xa9 |
| 91 | #define D31F0_C4TIMING_CNT 0xaa |
| 92 | #define D31F0_GPIO_ROUT 0xb8 |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 93 | |
| 94 | /* GEN_PMCON_3 bits */ |
| 95 | #define RTC_BATTERY_DEAD (1 << 2) |
| 96 | #define RTC_POWER_FAILED (1 << 1) |
| 97 | #define SLEEP_AFTER_POWER_FAIL (1 << 0) |
| 98 | |
| 99 | |
| 100 | /* D31:F2 SATA */ |
| 101 | #define D31F2_IDE_TIM_PRI 0x40 |
| 102 | #define D31F2_IDE_TIM_SEC 0x42 |
| 103 | #define D31F2_SIDX 0xa0 |
| 104 | #define D31F2_SDAT 0xa4 |
| 105 | |
| 106 | |
| 107 | /* D30:F0 PCI-to-PCI bridge */ |
| 108 | #define D30F0_SMLT 0x1b |
| 109 | |
| 110 | |
| 111 | /* D28:F0-5 PCIe root ports */ |
| 112 | #define D28Fx_XCAP 0x42 |
| 113 | #define D28Fx_SLCAP 0x54 |
| 114 | |
| 115 | |
| 116 | #define SMBUS_IO_BASE 0x0400 |
| 117 | |
| 118 | /* PCI Configuration Space (D31:F3): SMBus */ |
| 119 | #define SMB_BASE 0x20 |
| 120 | #define HOSTC 0x40 |
| 121 | |
| 122 | /* HOSTC bits */ |
| 123 | #define I2C_EN (1 << 2) |
| 124 | #define SMB_SMI_EN (1 << 1) |
| 125 | #define HST_EN (1 << 0) |
| 126 | |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 127 | #define RCBA_V0CTL 0x0014 |
| 128 | #define RCBA_V1CAP 0x001c |
| 129 | #define RCBA_V1CTL 0x0020 |
| 130 | #define RCBA_V1STS 0x0026 |
| 131 | #define RCBA_PAT 0x0030 |
Stefan Tauner | cea31ea | 2018-08-11 18:45:28 +0200 | [diff] [blame] | 132 | #define RCBA_CIR1 0x0088 |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 133 | #define RCBA_ESD 0x0104 |
| 134 | #define RCBA_ULD 0x0110 |
| 135 | #define RCBA_ULBA 0x0118 |
| 136 | #define RCBA_LCAP 0x01a4 |
| 137 | #define RCBA_LCTL 0x01a8 |
| 138 | #define RCBA_LSTS 0x01aa |
Stefan Tauner | cea31ea | 2018-08-11 18:45:28 +0200 | [diff] [blame] | 139 | #define RCBA_CIR2 0x01f4 |
| 140 | #define RCBA_CIR3 0x01fc |
| 141 | #define RCBA_BCR 0x0220 |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 142 | #define RCBA_DMIC 0x0234 |
| 143 | #define RCBA_RPFN 0x0238 |
Stefan Tauner | cea31ea | 2018-08-11 18:45:28 +0200 | [diff] [blame] | 144 | #define RCBA_CIR13 0x0f20 |
| 145 | #define RCBA_CIR5 0x1d40 |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 146 | #define RCBA_DMC 0x2010 |
Stefan Tauner | cea31ea | 2018-08-11 18:45:28 +0200 | [diff] [blame] | 147 | #define RCBA_CIR6 0x2024 |
| 148 | #define RCBA_CIR7 0x2034 |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 149 | #define RCBA_HPTC 0x3404 |
Stefan Tauner | cea31ea | 2018-08-11 18:45:28 +0200 | [diff] [blame] | 150 | #define GCS 0x3410 |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 151 | #define RCBA_BUC 0x3414 |
| 152 | #define RCBA_FD 0x3418 /* Function Disable, see below. */ |
| 153 | #define RCBA_CG 0x341c |
| 154 | #define RCBA_FDSW 0x3420 |
Stefan Tauner | cea31ea | 2018-08-11 18:45:28 +0200 | [diff] [blame] | 155 | #define RCBA_CIR8 0x3430 |
| 156 | #define RCBA_CIR9 0x350c |
| 157 | #define RCBA_CIR10 0x352c |
Martin Roth | 2ed0aa2 | 2016-01-05 20:58:58 -0700 | [diff] [blame] | 158 | #define RCBA_MAP 0x35f0 /* UHCI controller #6 remapping */ |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 159 | |
| 160 | #define BUC_LAND (1 << 5) /* LAN */ |
| 161 | #define FD_SAD2 (1 << 25) /* SATA #2 */ |
| 162 | #define FD_TTD (1 << 24) /* Thermal Throttle */ |
| 163 | #define FD_PE6D (1 << 21) /* PCIe root port 6 */ |
| 164 | #define FD_PE5D (1 << 20) /* PCIe root port 5 */ |
| 165 | #define FD_PE4D (1 << 19) /* PCIe root port 4 */ |
| 166 | #define FD_PE3D (1 << 18) /* PCIe root port 3 */ |
| 167 | #define FD_PE2D (1 << 17) /* PCIe root port 2 */ |
| 168 | #define FD_PE1D (1 << 16) /* PCIe root port 1 */ |
| 169 | #define FD_EHCI1D (1 << 15) /* EHCI #1 */ |
| 170 | #define FD_LBD (1 << 14) /* LPC bridge */ |
| 171 | #define FD_EHCI2D (1 << 13) /* EHCI #2 */ |
| 172 | #define FD_U5D (1 << 12) /* UHCI #5 */ |
| 173 | #define FD_U4D (1 << 11) /* UHCI #4 */ |
| 174 | #define FD_U3D (1 << 10) /* UHCI #3 */ |
| 175 | #define FD_U2D (1 << 9) /* UHCI #2 */ |
| 176 | #define FD_U1D (1 << 8) /* UHCI #1 */ |
| 177 | #define FD_U6D (1 << 7) /* UHCI #6 */ |
| 178 | #define FD_HDAD (1 << 4) /* HD audio */ |
| 179 | #define FD_SD (1 << 3) /* SMBus */ |
| 180 | #define FD_SAD1 (1 << 2) /* SATA #1 */ |
| 181 | |
| 182 | |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 183 | #ifndef __ACPI__ |
| 184 | #ifndef __ASSEMBLER__ |
| 185 | |
Kyösti Mälkki | f1b58b7 | 2019-03-01 13:43:02 +0200 | [diff] [blame] | 186 | #include <device/pci_ops.h> |
| 187 | |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 188 | static inline int lpc_is_mobile(const u16 devid) |
| 189 | { |
| 190 | return (devid == 0x2917) || (devid == 0x2919); |
| 191 | } |
| 192 | #define LPC_IS_MOBILE(dev) lpc_is_mobile(pci_read_config16(dev, PCI_DEVICE_ID)) |
| 193 | |
Kyösti Mälkki | 571b7b2 | 2019-07-08 23:25:05 +0300 | [diff] [blame] | 194 | void aseg_smm_lock(void); |
| 195 | |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 196 | void i82801ix_early_init(void); |
Arthur Heymans | 9ed0df4 | 2019-10-12 14:18:18 +0200 | [diff] [blame] | 197 | void i82801ix_lpc_decode(void); |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 198 | void i82801ix_dmi_setup(void); |
| 199 | void i82801ix_dmi_poll_vc1(void); |
Kyösti Mälkki | 12b121c | 2019-08-18 16:33:39 +0300 | [diff] [blame] | 200 | |
Patrick Georgi | e72a8a3 | 2012-11-06 11:05:09 +0100 | [diff] [blame] | 201 | #endif |
| 202 | #endif |
| 203 | |
| 204 | #endif |