1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#ifndef SOUTHBRIDGE_INTEL_I82371EB_I82371EB_H
22#define SOUTHBRIDGE_INTEL_I82371EB_I82371EB_H
23
24#if !defined(__ASSEMBLER__)
25#if !defined(__PRE_RAM__)
26#if !defined(__ACPI__)
27
28#include <arch/io.h>
29#include <device/device.h>
30#include "chip.h"
31
32void i82371eb_enable(device_t dev);
33void i82371eb_hard_reset(void);
34
35#endif
36#endif
37#endif
38
39#if defined(__PRE_RAM__) && !defined(__ROMCC__)
40void enable_smbus(void);
41int smbus_read_byte(u8 device, u8 address);
42void enable_pm(void);
43#endif
44
45
46
47
48
49
50
51
52
53#define ONOFF(cond,reg,bits) ((cond) ? ((reg) | (bits)) : ((reg) & ~(bits)))
54
55#define XBCS 0x4e
56#define GENCFG 0xb0
57#define RC 0xcf9
58
59
60#define IDETIM_PRI 0x40
61#define IDETIM_SEC 0x42
62#define UDMACTL 0x48
63#define UDMATIM 0x4a
64
65
66#define SMBBA 0x90
67#define SMBUS_IO_BASE 0x0f00
68#define SMBHSTCFG 0xd2
69
70
71#define PMSTS 0x00
72#define PMEN 0x02
73#define PWRBTN_EN (1<<8)
74#define GBL_EN (1<<5)
75#define PMCNTRL 0x04
76#define SUS_EN (1<<13)
77#define SUS_TYP_MSK (7<<10)
78#define SUS_TYP_S0 (5<<10)
79#define SUS_TYP_S1 (4<<10)
80#define SUS_TYP_S2 (3<<10)
81
82#define SUS_TYP_S3 (1<<10)
83#define SUS_TYP_S5 (0<<10)
84#define SCI_EN (1<<0)
85#define PMTMR 0x08
86#define GPSTS 0x0c
87#define GPEN 0x0e
88#define THRM_EN (1<<0)
89#define PCNTRL 0x10
90#define GLBSTS 0x18
91#define IRQ_RSM_STS (1<<11)
92#define EXTSMI_STS (1<<10)
93#define GSTBY_STS (1<<8)
94#define GP_STS (1<<7)
95#define BM1_STS (1<<6)
96#define APM_STS (1<<5)
97#define DEV_STS (1<<4)
98#define BIOS_EN (1<<1)
99#define LEGACY_USB_EN (1<<0)
100#define DEVSTS 0x1c
101#define GLBEN 0x20
102#define EXTSMI_EN (1<<10)
103#define GSTBY_EN (1<<8)
104#define BM_TRP_EN (1<<1)
105#define BIOS_EN (1<<1)
106#define LEGACY_USB_EN (1<<0)
107#define GLBCTL 0x28
108#define EOS (1<<16)
109#define SMI_EN (1<<0)
110#define DEVCTL 0x2c
111#define TRP_EN_DEV12 (1<<24)
112#define GPO0 0x34
113#define GPO1 0x35
114#define GPO2 0x36
115#define GPO3 0x37
116
117#define PMBA 0x40
118#define DEFAULT_PMBASE 0xe400
119#define PM_IO_BASE DEFAULT_PMBASE
120#define PMREGMISC 0x80
121
122
123#define EXT_BIOS_ENABLE_1MB (1 << 9)
124#define EXT_BIOS_ENABLE (1 << 7)
125#define LOWER_BIOS_ENABLE (1 << 6)
126#define WRITE_PROTECT_ENABLE (1 << 2)
127#define SRST (1 << 1)
128#define RCPU (1 << 2)
129#define SMB_HST_EN (1 << 0)
130#define IDE_DECODE_ENABLE (1 << 15)
131#define DTE0 (1 << 3)
132#define DTE1 (1 << 7)
133#define PSDE0 (1 << 0)
134#define PSDE1 (1 << 1)
135#define SSDE0 (1 << 2)
136#define SSDE1 (1 << 3)
137#define ISA (1 << 0)
138#define EIO (0 << 0)
139#define PMIOSE (1 << 0)
140
141#endif
142