summaryrefslogtreecommitdiffstats
path: root/src/mainboard/Kconfig
blob: aec996ab0b0c487b0d8879a8199dd10c3dc56049 (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
237
238
239
240
241
242
243
244
245
comment "Important: Run 'make distclean' before switching boards"

choice
	prompt "Mainboard vendor"
	default VENDOR_EMULATION

source "src/mainboard/*/Kconfig.name"

endchoice

source "src/mainboard/*/Kconfig"

config MAINBOARD_DIR
	string

config MAINBOARD_PART_NUMBER
	string "Mainboard part number"

config MAINBOARD_VENDOR
	string "Mainboard vendor name"

config VARIANT_DIR
	string

config BOARD_ROMSIZE_KB_256
	bool
config BOARD_ROMSIZE_KB_512
	bool
config BOARD_ROMSIZE_KB_1024
	bool
config BOARD_ROMSIZE_KB_2048
	bool
config BOARD_ROMSIZE_KB_4096
	bool
config BOARD_ROMSIZE_KB_5120
	bool
config BOARD_ROMSIZE_KB_6144
	bool
config BOARD_ROMSIZE_KB_8192
	bool
config BOARD_ROMSIZE_KB_10240
	bool
config BOARD_ROMSIZE_KB_12288
	bool
config BOARD_ROMSIZE_KB_16384
	bool
config BOARD_ROMSIZE_KB_32768
	bool
config BOARD_ROMSIZE_KB_65536
	bool

# TODO: No help text possible for choice fields?
choice
	prompt "ROM chip size"
	default COREBOOT_ROMSIZE_KB_256   if BOARD_ROMSIZE_KB_256
	default COREBOOT_ROMSIZE_KB_512   if BOARD_ROMSIZE_KB_512
	default COREBOOT_ROMSIZE_KB_1024  if BOARD_ROMSIZE_KB_1024
	default COREBOOT_ROMSIZE_KB_2048  if BOARD_ROMSIZE_KB_2048
	default COREBOOT_ROMSIZE_KB_4096  if BOARD_ROMSIZE_KB_4096
	default COREBOOT_ROMSIZE_KB_5120  if BOARD_ROMSIZE_KB_5120
	default COREBOOT_ROMSIZE_KB_6144  if BOARD_ROMSIZE_KB_6144
	default COREBOOT_ROMSIZE_KB_8192  if BOARD_ROMSIZE_KB_8192
	default COREBOOT_ROMSIZE_KB_10240 if BOARD_ROMSIZE_KB_10240
	default COREBOOT_ROMSIZE_KB_12288 if BOARD_ROMSIZE_KB_12288
	default COREBOOT_ROMSIZE_KB_16384 if BOARD_ROMSIZE_KB_16384
	default COREBOOT_ROMSIZE_KB_32768 if BOARD_ROMSIZE_KB_32768
	default COREBOOT_ROMSIZE_KB_65536 if BOARD_ROMSIZE_KB_65536
	help
	  Select the size of the ROM chip you intend to flash coreboot on.

	  The build system will take care of creating a coreboot.rom file
	  of the matching size.

config COREBOOT_ROMSIZE_KB_256
	bool "256 KB"
	help
	  Choose this option if you have a 256 KB ROM chip.

config COREBOOT_ROMSIZE_KB_512
	bool "512 KB"
	help
	  Choose this option if you have a 512 KB ROM chip.

config COREBOOT_ROMSIZE_KB_1024
	bool "1024 KB (1 MB)"
	help
	  Choose this option if you have a 1024 KB (1 MB) ROM chip.

config COREBOOT_ROMSIZE_KB_2048
	bool "2048 KB (2 MB)"
	help
	  Choose this option if you have a 2048 KB (2 MB) ROM chip.

config COREBOOT_ROMSIZE_KB_4096
	bool "4096 KB (4 MB)"
	help
	  Choose this option if you have a 4096 KB (4 MB) ROM chip.

config COREBOOT_ROMSIZE_KB_5120
	bool "5120 KB (5 MB)"
	help
	  Choose this option if you have a 5120 KB (5 MB) ROM chip.

config COREBOOT_ROMSIZE_KB_6144
	bool "6144 KB (6 MB)"
	help
	  Choose this option if you have a 6144 KB (6 MB) ROM chip.

config COREBOOT_ROMSIZE_KB_8192
	bool "8192 KB (8 MB)"
	help
	  Choose this option if you have a 8192 KB (8 MB) ROM chip.

config COREBOOT_ROMSIZE_KB_10240
	bool "10240 KB (10 MB)"
	help
	  Choose this option if you have a 10240 KB (10 MB) ROM chip.

config COREBOOT_ROMSIZE_KB_12288
	bool "12288 KB (12 MB)"
	help
	  Choose this option if you have a 12288 KB (12 MB) ROM chip.

config COREBOOT_ROMSIZE_KB_16384
	bool "16384 KB (16 MB)"
	help
	  Choose this option if you have a 16384 KB (16 MB) ROM chip.

config COREBOOT_ROMSIZE_KB_32768
	bool "32768 KB (32 MB)"
	help
	  Choose this option if you have a 32768 KB (32 MB) ROM chip.

config COREBOOT_ROMSIZE_KB_65536
	bool "65536 KB (64 MB)"
	help
	  Choose this option if you have a 65536 KB (64 MB) ROM chip.

endchoice

# Map the config names to an integer (KB).
config COREBOOT_ROMSIZE_KB
	int
	default   256 if COREBOOT_ROMSIZE_KB_256
	default   512 if COREBOOT_ROMSIZE_KB_512
	default  1024 if COREBOOT_ROMSIZE_KB_1024
	default  2048 if COREBOOT_ROMSIZE_KB_2048
	default  4096 if COREBOOT_ROMSIZE_KB_4096
	default  5120 if COREBOOT_ROMSIZE_KB_5120
	default  6144 if COREBOOT_ROMSIZE_KB_6144
	default  8192 if COREBOOT_ROMSIZE_KB_8192
	default 10240 if COREBOOT_ROMSIZE_KB_10240
	default 12288 if COREBOOT_ROMSIZE_KB_12288
	default 16384 if COREBOOT_ROMSIZE_KB_16384
	default 32768 if COREBOOT_ROMSIZE_KB_32768
	default 65536 if COREBOOT_ROMSIZE_KB_65536

# Map the config names to a hex value (bytes).
config ROM_SIZE
	hex
	default 0x00040000 if COREBOOT_ROMSIZE_KB_256
	default 0x00080000 if COREBOOT_ROMSIZE_KB_512
	default 0x00100000 if COREBOOT_ROMSIZE_KB_1024
	default 0x00200000 if COREBOOT_ROMSIZE_KB_2048
	default 0x00400000 if COREBOOT_ROMSIZE_KB_4096
	default 0x00500000 if COREBOOT_ROMSIZE_KB_5120
	default 0x00600000 if COREBOOT_ROMSIZE_KB_6144
	default 0x00800000 if COREBOOT_ROMSIZE_KB_8192
	default 0x00a00000 if COREBOOT_ROMSIZE_KB_10240
	default 0x00c00000 if COREBOOT_ROMSIZE_KB_12288
	default 0x01000000 if COREBOOT_ROMSIZE_KB_16384
	default 0x02000000 if COREBOOT_ROMSIZE_KB_32768
	default 0x04000000 if COREBOOT_ROMSIZE_KB_65536

config ENABLE_POWER_BUTTON
	bool "Enable the power button" if POWER_BUTTON_IS_OPTIONAL
	default y if POWER_BUTTON_DEFAULT_ENABLE
	default n if POWER_BUTTON_DEFAULT_DISABLE
	help
	  The selected mainboard can optionally have the power button tied
	  to ground with a jumper so that the button appears to be
	  constantly depressed. If this option is enabled and the jumper is
	  installed then the board will turn on, but turn off again after a
	  short timeout, usually 4 seconds.

	  Select Y here if you have removed the jumper and want to use an
	  actual power button. Select N if you have the jumper installed.

config ENABLE_POWER_BUTTON
	def_bool y if !POWER_BUTTON_IS_OPTIONAL && POWER_BUTTON_FORCE_ENABLE
	def_bool n if !POWER_BUTTON_IS_OPTIONAL && POWER_BUTTON_FORCE_DISABLE

config HAVE_POWER_STATE_AFTER_FAILURE
	bool

if HAVE_POWER_STATE_AFTER_FAILURE

config HAVE_POWER_STATE_PREVIOUS_AFTER_FAILURE
	bool

config POWER_STATE_DEFAULT_ON_AFTER_FAILURE
	bool
	help
	  Selected by platforms or mainboards that want a "default on"
	  behaviour.

choice
	prompt "System Power State after Failure"
	default POWER_STATE_ON_AFTER_FAILURE \
		if POWER_STATE_DEFAULT_ON_AFTER_FAILURE
	default POWER_STATE_OFF_AFTER_FAILURE
	help
	  Provides a default for the power state the system should
	  go into after G3 (power loss). On many boards this can be
	  overridden by an NVRAM option.

config POWER_STATE_OFF_AFTER_FAILURE
	bool "S5 Soft Off"
	help
	  Choose this option if you want to put system into
	  S5 after reapplying power after failure.

config POWER_STATE_ON_AFTER_FAILURE
	bool "S0 Full On"
	help
	  Choose this option if you want to keep system in
	  S0 after reapplying power after failure.

config POWER_STATE_PREVIOUS_AFTER_FAILURE
	bool "Keep Previous State"
	depends on HAVE_POWER_STATE_PREVIOUS_AFTER_FAILURE
	help
	  Choose this option if you want to keep system in the
	  same power state as before failure after reapplying
	  power.

endchoice

config MAINBOARD_POWER_FAILURE_STATE
	int
	default 2 if POWER_STATE_PREVIOUS_AFTER_FAILURE
	default 1 if POWER_STATE_ON_AFTER_FAILURE
	default 0

endif # HAVE_POWER_STATE_AFTER_FAILURE