summaryrefslogtreecommitdiff
path: root/src/southbridge/amd/cimx/sb800/chip.h
blob: 2c2ce1ec1364af75babfe6513cca0b5011423f42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/*
 * This file is part of the coreboot project.
 *
 * Copyright (C) 2011 Advanced Micro Devices, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */

#ifndef _CIMX_SB800_CHIP_H_
#define _CIMX_SB800_CHIP_H_
#include "fan.h" /* include for #defines used in devicetree.cb */

/*
 * configuration set in mainboard/devicetree.cb
 *  boot_switch_sata_ide:
 *   0 -set SATA as primary, PATA(IDE) as secondary.
 *   1 -set PATA(IDE) as primary, SATA as secondary. if you want to boot from IDE,
 *  gpp_configuration - The configuration of General Purpose Port A/B/C/D
 *   0(GPP_CFGMODE_X4000) -PortA Lanes[3:0]
 *   2(GPP_CFGMODE_X2200) -PortA Lanes[1:0], PortB Lanes[3:2]
 *   3(GPP_CFGMODE_X2110) -PortA Lanes[1:0], PortB Lane2, PortC Lane3
 *   4(GPP_CFGMODE_X1111) -PortA Lanes0, PortB Lane1, PortC Lane2, PortD Lane3
 */
struct southbridge_amd_cimx_sb800_config
{
	u32 boot_switch_sata_ide : 1;
	u8  gpp_configuration;

	/*
	 * SB800 IMC and fan control
	 */

	u16 imc_port_address;

	u32 fan0_enabled : 1;
	u32 fan1_enabled : 1;
	u32 fan2_enabled : 1;
	u32 fan3_enabled : 1;
	u32 fan4_enabled : 1;
	u32 imc_fan_zone0_enabled : 1;
	u32 imc_fan_zone1_enabled : 1;
	u32 imc_fan_zone2_enabled : 1;
	u32 imc_fan_zone3_enabled : 1;
	u32 imc_tempin0_enabled : 1;
	u32 imc_tempin1_enabled : 1;
	u32 imc_tempin2_enabled : 1;
	u32 imc_tempin3_enabled : 1;

	union {
		struct {
			u8  fan0_control_reg_value;
			u8  fan0_frequency_reg_value;
			u8  fan0_low_duty_reg_value;
			u8  fan0_med_duty_reg_value;
			u8  fan0_multiplier_reg_value;
			u8  fan0_low_temp_lo_reg_value;
			u8  fan0_low_temp_hi_reg_value;
			u8  fan0_med_temp_lo_reg_value;
			u8  fan0_med_temp_hi_reg_value;
			u8  fan0_high_temp_lo_reg_value;
			u8  fan0_high_temp_hi_reg_value;
			u8  fan0_linear_range_reg_value;
			u8  fan0_linear_hold_reg_value;
		};
		u8  fan0_config_vals[FAN_REGISTER_COUNT];
	};

	union {
		struct {
			u8  fan1_control_reg_value;
			u8  fan1_frequency_reg_value;
			u8  fan1_low_duty_reg_value;
			u8  fan1_med_duty_reg_value;
			u8  fan1_multiplier_reg_value;
			u8  fan1_low_temp_lo_reg_value;
			u8  fan1_low_temp_hi_reg_value;
			u8  fan1_med_temp_lo_reg_value;
			u8  fan1_med_temp_hi_reg_value;
			u8  fan1_high_temp_lo_reg_value;
			u8  fan1_high_temp_hi_reg_value;
			u8  fan1_linear_range_reg_value;
			u8  fan1_linear_hold_reg_value;
		};
		u8  fan1_config_vals[FAN_REGISTER_COUNT];
	};

	union {
		struct {
			u8  fan2_control_reg_value;
			u8  fan2_frequency_reg_value;
			u8  fan2_low_duty_reg_value;
			u8  fan2_med_duty_reg_value;
			u8  fan2_multiplier_reg_value;
			u8  fan2_low_temp_lo_reg_value;
			u8  fan2_low_temp_hi_reg_value;
			u8  fan2_med_temp_lo_reg_value;
			u8  fan2_med_temp_hi_reg_value;
			u8  fan2_high_temp_lo_reg_value;
			u8  fan2_high_temp_hi_reg_value;
			u8  fan2_linear_range_reg_value;
			u8  fan2_linear_hold_reg_value;
		};
		u8  fan2_config_vals[FAN_REGISTER_COUNT];
	};

	union {
		struct {
			u8  fan3_control_reg_value;
			u8  fan3_frequency_reg_value;
			u8  fan3_low_duty_reg_value;
			u8  fan3_med_duty_reg_value;
			u8  fan3_multiplier_reg_value;
			u8  fan3_low_temp_lo_reg_value;
			u8  fan3_low_temp_hi_reg_value;
			u8  fan3_med_temp_lo_reg_value;
			u8  fan3_med_temp_hi_reg_value;
			u8  fan3_high_temp_lo_reg_value;
			u8  fan3_high_temp_hi_reg_value;
			u8  fan3_linear_range_reg_value;
			u8  fan3_linear_hold_reg_value;
		};
		u8  fan3_config_vals[FAN_REGISTER_COUNT];
	};

	union {
		struct {
			u8  fan4_control_reg_value;
			u8  fan4_frequency_reg_value;
			u8  fan4_low_duty_reg_value;
			u8  fan4_med_duty_reg_value;
			u8  fan4_multiplier_reg_value;
			u8  fan4_low_temp_lo_reg_value;
			u8  fan4_low_temp_hi_reg_value;
			u8  fan4_med_temp_lo_reg_value;
			u8  fan4_med_temp_hi_reg_value;
			u8  fan4_high_temp_lo_reg_value;
			u8  fan4_high_temp_hi_reg_value;
			u8  fan4_linear_range_reg_value;
			u8  fan4_linear_hold_reg_value;
		};
		u8  fan4_config_vals[FAN_REGISTER_COUNT];
	};

	union {
		struct {
			u8 imc_zone0_mode1;
			u8 imc_zone0_mode2;
			u8 imc_zone0_temp_offset;
			u8 imc_zone0_hysteresis;
			u8 imc_zone0_smbus_addr;
			u8 imc_zone0_smbus_num;
			u8 imc_zone0_pwm_step;
			u8 imc_zone0_ramping;
		};
		u8  imc_zone0_config_vals[IMC_FAN_CONFIG_COUNT];
	};
	u8  imc_zone0_thresholds[IMC_FAN_THRESHOLD_COUNT];
	u8  imc_zone0_fanspeeds[IMC_FAN_SPEED_COUNT];

	union {
		struct {
		u8  imc_zone1_mode1;
		u8  imc_zone1_mode2;
		u8  imc_zone1_temp_offset;
		u8  imc_zone1_hysteresis;
		u8  imc_zone1_smbus_addr;
		u8  imc_zone1_smbus_num;
		u8  imc_zone1_pwm_step;
		u8  imc_zone1_ramping;
		};
		u8  imc_zone1_config_vals[IMC_FAN_CONFIG_COUNT];
	};
	u8  imc_zone1_thresholds[IMC_FAN_THRESHOLD_COUNT];
	u8  imc_zone1_fanspeeds[IMC_FAN_SPEED_COUNT];

	union {
		struct {
			u8  imc_zone2_mode1;
			u8  imc_zone2_mode2;
			u8  imc_zone2_temp_offset;
			u8  imc_zone2_hysteresis;
			u8  imc_zone2_smbus_addr;
			u8  imc_zone2_smbus_num;
			u8  imc_zone2_pwm_step;
			u8  imc_zone2_ramping;
		};
		u8  imc_zone2_config_vals[IMC_FAN_CONFIG_COUNT];
	};
	u8  imc_zone2_thresholds[IMC_FAN_THRESHOLD_COUNT];
	u8  imc_zone2_fanspeeds[IMC_FAN_SPEED_COUNT];

	union {
		struct {
			u8  imc_zone3_mode1;
			u8  imc_zone3_mode2;
			u8  imc_zone3_temp_offset;
			u8  imc_zone3_hysteresis;
			u8  imc_zone3_smbus_addr;
			u8  imc_zone3_smbus_num;
			u8  imc_zone3_pwm_step;
			u8  imc_zone3_ramping;
		};
		u8 imc_zone3_config_vals[IMC_FAN_CONFIG_COUNT];
	};
	u8  imc_zone3_thresholds[IMC_FAN_THRESHOLD_COUNT];
	u8  imc_zone3_fanspeeds[IMC_FAN_SPEED_COUNT];

	u32 imc_tempin0_at;
	u32 imc_tempin0_ct;
	u8 imc_tempin0_tuning_param;

	u32 imc_tempin1_at;
	u32 imc_tempin1_ct;
	u8  imc_tempin1_tuning_param;

	u32 imc_tempin2_at;
	u32 imc_tempin2_ct;
	u8  imc_tempin2_tuning_param;

	u32 imc_tempin3_at;
	u32 imc_tempin3_ct;
	u8  imc_tempin3_tuning_param;

};
#endif /* _CIMX_SB800_CHIP_H_ */