2 * This file is part of the coreboot project.
4 * Copyright (C) 2004 Ron G. Minnich
5 * Copyright (C) 2004 Eric Biederman
6 * Copyright (C) 2008-2009 coresystems GmbH
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; version 2 of
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 /* the problem: we have 82801dbm support in fb1, and 82801er in fb2.
24 * fb1 code is what we want, fb2 structure is needed however.
25 * so we need to get fb1 code for 82801dbm into fb2 structure.
27 /* What I did: took the 80801er stuff from fb2, verify it against the
28 * db stuff in fb1, and made sure it was right.
34 #if !defined( __ROMCC__ ) && !defined(__PRE_RAM__)
36 extern void i82801dx_enable(device_t dev);
39 #define MAINBOARD_POWER_OFF 0
40 #define MAINBOARD_POWER_ON 1
41 #define MAINBOARD_POWER_KEEP 2
43 #ifndef CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL
44 #define CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL MAINBOARD_POWER_ON
48 * 000 = Non-combined. P0 is primary master. P1 is secondary master.
49 * 001 = Non-combined. P0 is secondary master. P1 is primary master.
50 * 100 = Combined. P0 is primary master. P1 is primary slave. IDE is secondary;
51 * Primary IDE channel disabled.
52 * 101 = Combined. P0 is primary slave. P1 is primary master. IDE is secondary.
53 * 110 = Combined. IDE is primary. P0 is secondary master. P1 is secondary
54 * slave; Secondary IDE channel disabled.
55 * 111 = Combined. IDE is primary. P0 is secondary slave. P1 is secondary master.
57 /* PCI Configuration Space (D31:F1) */
58 #define IDE_TIM_PRI 0x40 /* IDE timings, primary */
59 #define IDE_TIM_SEC 0x42 /* IDE timings, secondary */
62 #define IDE_DECODE_ENABLE (1 << 15)
66 #define PCI_DMA_CFG 0x90
67 #define SERIRQ_CNTL 0x64
71 #define GEN_PMCON_3 0xa4
75 #define PMBASE_ADDR 0x0400
76 #define ACPI_CNTL 0x44
77 #define BIOS_CNTL 0x4E
78 #define GPIO_BASE 0x58
79 #define GPIO_CNTL 0x5C
80 #define PIRQA_ROUT 0x60
81 #define PIRQE_ROUT 0x68
90 #define SUB_BUS_NUM 0x1A
98 #define PCI_MAST_STS 0x82
100 #define RTC_FAILED (1 <<2)
103 #define SMBUS_IO_BASE 0x1000
105 #define SMBHSTSTAT 0x0
106 #define SMBHSTCTL 0x2
107 #define SMBHSTCMD 0x3
108 #define SMBXMITADD 0x4
109 #define SMBHSTDAT0 0x5
110 #define SMBHSTDAT1 0x6
111 #define SMBBLKDAT 0x7
112 #define SMBTRNSADD 0x9
113 #define SMBSLVDATA 0xa
114 #define SMLINK_PIN_CTL 0xe
115 #define SMBUS_PIN_CTL 0xf
117 /* Between 1-10 seconds, We should never timeout normally
118 * Longer than this is just painful when a timeout condition occurs.
120 #define SMBUS_TIMEOUT (100*1000)
123 #define WAK_STS (1 << 15)
124 #define PCIEXPWAK_STS (1 << 14)
125 #define PRBTNOR_STS (1 << 11)
126 #define RTC_STS (1 << 10)
127 #define PWRBTN_STS (1 << 8)
128 #define GBL_STS (1 << 5)
129 #define BM_STS (1 << 4)
130 #define TMROF_STS (1 << 0)
132 #define PCIEXPWAK_DIS (1 << 14)
133 #define RTC_EN (1 << 10)
134 #define PWRBTN_EN (1 << 8)
135 #define GBL_EN (1 << 5)
136 #define TMROF_EN (1 << 0)
138 #define SLP_EN (1 << 13)
139 #define SLP_TYP (7 << 10)
140 #define GBL_RLS (1 << 2)
141 #define BM_RLD (1 << 1)
142 #define SCI_EN (1 << 0)
144 #define PROC_CNT 0x10
148 #define PM2_CNT 0x20 // mobile only
149 #define GPE0_STS 0x28
150 #define PME_B0_STS (1 << 13)
151 #define USB3_STS (1 << 12)
152 #define PME_STS (1 << 11)
153 #define BATLOW_STS (1 << 10)
154 #define GST_STS (1 << 9)
155 #define RI_STS (1 << 8)
156 #define SMB_WAK_STS (1 << 7)
157 #define TCOSCI_STS (1 << 6)
158 #define AC97_STS (1 << 5)
159 #define USB2_STS (1 << 4)
160 #define USB1_STS (1 << 3)
161 #define SWGPE_STS (1 << 2)
162 #define HOT_PLUG_STS (1 << 1)
163 #define THRM_STS (1 << 0)
165 #define PME_B0_EN (1 << 13)
166 #define PME_EN (1 << 11)
168 #define EL_SMI_EN (1 << 25) // Intel Quick Resume Technology
169 #define INTEL_USB2_EN (1 << 18) // Intel-Specific USB2 SMI logic
170 #define LEGACY_USB2_EN (1 << 17) // Legacy USB2 SMI logic
171 #define PERIODIC_EN (1 << 14) // SMI on PERIODIC_STS in SMI_STS
172 #define TCO_EN (1 << 13) // Enable TCO Logic (BIOSWE et al)
173 #define MCSMI_EN (1 << 11) // Trap microcontroller range access
174 #define BIOS_RLS (1 << 7) // asserts SCI on bit set
175 #define SWSMI_TMR_EN (1 << 6) // start software smi timer on bit set
176 #define APMC_EN (1 << 5) // Writes to APM_CNT cause SMI#
177 #define SLP_SMI_EN (1 << 4) // Write to SLP_EN in PM1_CNT asserts SMI#
178 #define LEGACY_USB_EN (1 << 3) // Legacy USB circuit SMI logic
179 #define BIOS_EN (1 << 2) // Assert SMI# on setting GBL_RLS bit
180 #define EOS (1 << 1) // End of SMI (deassert SMI#)
181 #define GBL_SMI_EN (1 << 0) // SMI# generation at all?
183 #define ALT_GP_SMI_EN 0x38
184 #define ALT_GP_SMI_STS 0x3a
185 #define GPE_CNTL 0x42
186 #define DEVACT_STS 0x44
190 #define TCOBASE 0x60 /* TCO Base Address Register */
191 #define TCO1_CNT 0x08 /* TCO1 Control Register */
193 #endif /* I82801DX_H */