blob: 32fdd19ec5f6924e2ae0e1dd6febfda21fa9024c [file] [log] [blame]
Patrick Georgi0588d192009-08-12 15:00:51 +00001\documentclass[10pt,letterpaper]{article}
2\usepackage[latin1]{inputenc}
3\usepackage{amsmath}
4\usepackage{amsfonts}
5\usepackage{amssymb}
6\author{Ron Minnich}
7\title{Kconfig usage in coreboot v2}
8\begin{document}
9\section{Introduction}
Myles Watson10c41fa2009-08-13 16:02:24 +000010This document describes how to use Kconfig in v2. We describe our usage of Kconfig files, Makefile.inc files, when and where to use them, how to use them, and, interestingly, when and where not to use them.
Patrick Georgi0588d192009-08-12 15:00:51 +000011\section{Kconfig variations}
Myles Watson10c41fa2009-08-13 16:02:24 +000012Most Kconfig files set variables, which can be set as part of the Kconfig dialog. Not all Kconfig variables are set by the user, however; some are too dangerous. These are merely enabled by the mainboard.
Patrick Georgi0588d192009-08-12 15:00:51 +000013
Myles Watson10c41fa2009-08-13 16:02:24 +000014For variables set by the user, see src/console/Kconfig.
Patrick Georgi0588d192009-08-12 15:00:51 +000015
Myles Watson10c41fa2009-08-13 16:02:24 +000016For variables not set by the user, see src/mainboard/amd/serengeti\_cheetah/Kconfig. Users should never set such variables as the cache as ram base. These are highly mainboard dependent.
Patrick Georgi0588d192009-08-12 15:00:51 +000017
Myles Watson10c41fa2009-08-13 16:02:24 +000018Kconfig files use the source command to include subdirectories. In most cases, save for limited cases described below, subdirectories have Kconfig files. They are always sourced unconditionally.
Patrick Georgi0588d192009-08-12 15:00:51 +000019
20\section{Makefile and Makefile.inc}
Myles Watson10c41fa2009-08-13 16:02:24 +000021There is only one Makefile, at the top level. All other makefiles are included as Makefile.inc. All the next-level Makefile.inc files are selected in the top level Makefile. Directories that are platform-independent are in BUILD-y; platform-dependent (e.g. Makefile.inc's that depend on architecture) are included in PLATFORM-y.
Patrick Georgi0588d192009-08-12 15:00:51 +000022
Myles Watson10c41fa2009-08-13 16:02:24 +000023Make is not recursive. There is only one make process.
Myles Watson879c1772009-08-25 19:46:50 +000024\subsection{subdirs usage}
25Further includes of Makefile.inc, if needed, are done via subdirs-y commands. As in Linux, the subdirs can be conditional or unconditional. Conditional includes are done via subdirs-\$(CONFIG\_VARIABLE) usage; unconditional are done via subdirs-y.
Patrick Georgi0588d192009-08-12 15:00:51 +000026
Myles Watson10c41fa2009-08-13 16:02:24 +000027We define the common rules for which variation to use below.
Patrick Georgi0588d192009-08-12 15:00:51 +000028\subsection{object file specification}
Myles Watson10c41fa2009-08-13 16:02:24 +000029There are several different types of objects specified in the tree. They are:
Patrick Georgi0588d192009-08-12 15:00:51 +000030\begin{description}
31\item[obj]objects for the ram part of the code
Myles Watson10c41fa2009-08-13 16:02:24 +000032\item[driver]drivers for the ram part. Drivers are not represented in the device tree but do have a driver struct attached in the driver section.
Patrick Georgi0588d192009-08-12 15:00:51 +000033\item[initobj]seperately-compiled code for the ROM section of coreboot
34\end{description}
Myles Watson10c41fa2009-08-13 16:02:24 +000035These items are specified via the -y syntax as well. Conditional object inclusion is done via the -\$(CONFIG\_VARIABLE) syntax.
Patrick Georgi0588d192009-08-12 15:00:51 +000036
37\section{Example: AMD serengeti cheetah}
38\subsection{mainboard/Kconfig}
Myles Watson10c41fa2009-08-13 16:02:24 +000039Defines Vendor variables. Currently defined variables are:
40Sources all Kconfig files in the vendor directories.
Patrick Georgi0588d192009-08-12 15:00:51 +000041\input{ mainboardkconfig.tex}
42\subsection{mainboard/Makefile.inc}
43There is none at this time.
Myles Watson10c41fa2009-08-13 16:02:24 +000044\subsection{mainboard/$<$vendor$>$/Kconfig}
45We use the amd as a model. The only action currently taken is to source all Kconfig's in the
46subdirectories.
47\subsection{mainboard/$<$vendor$>$/Makefile.inc}
48We use amd as a model. There is currently no Makefile.inc at this level.
49\subsection{mainboard/$<$vendor$>$/$<$board$>$/Kconfig}
50The mainboard Kconfig and Makefile.inc are designed to be the heart of the build. The defines
51and rules in here determine everything about how a mainboard target is built.
52We will use serengeti\_cheetah as a model. It defines these variables.
Patrick Georgi0588d192009-08-12 15:00:51 +000053\input{ mainboardkconfig.tex}
Myles Watson10c41fa2009-08-13 16:02:24 +000054\subsection{mainboard/$<$vendor$>$/$<$board$>$/Makefile.inc}
55This is a fairly complex Makefile.inc. Because this is such a critical component, we are going to excerpt and take it piece by piece.
56Note that this is the mainboard as of August, 2009, and it may change over time.
Patrick Georgi0588d192009-08-12 15:00:51 +000057\subsubsection{objects}
Myles Watson10c41fa2009-08-13 16:02:24 +000058We define objects in the first part. The mainbard itself is a driver and included unconditionally. Other objects are conditional:
Patrick Georgi0588d192009-08-12 15:00:51 +000059\begin{verbatim}
60driver-y += mainboard.o
61
62#needed by irq_tables and mptable and acpi_tables
63obj-y += get_bus_conf.o
64obj-$(CONFIG_HAVE_MP_TABLE) += mptable.o
65obj-$(CONFIG_HAVE_PIRQ_TABLE) += irq_tables.o
66obj-$(CONFIG_HAVE_ACPI_TABLES) += dsdt.o
67obj-$(CONFIG_HAVE_ACPI_TABLES) += acpi_tables.o
68obj-$(CONFIG_HAVE_ACPI_TABLES) += fadt.o
69
70#./ssdt.o is in northbridge/amd/amdk8/Config.lb
71obj-$(CONFIG_ACPI_SSDTX_NUM) += ssdt2.o
72obj-$(CONFIG_ACPI_SSDTX_NUM) += ssdt3.o
73obj-$(CONFIG_HAVE_ACPI_TABLES) += ssdt4.o
74driver-y += ../../../drivers/i2c/i2cmux/i2cmux.o
75
Myles Watson10c41fa2009-08-13 16:02:24 +000076# This is part of the conversion to init-obj and away from included code.
Patrick Georgi0588d192009-08-12 15:00:51 +000077
78initobj-y += crt0.o
79\end{verbatim}
80\subsubsection{romcc legacy support}
Myles Watson10c41fa2009-08-13 16:02:24 +000081We hope to move away from romcc soon, but for now, if one is using romcc, the Makefile.inc must define
82crt0 include files (assembly code for startup, usually); and several ldscripts. These are taken directly from the
83old Config.lb. Note that these use the -y syntax and can use the ability to be included conditionally.
Patrick Georgi0588d192009-08-12 15:00:51 +000084\begin{verbatim}
85crt0-y += ../../../../src/cpu/x86/16bit/entry16.inc
86crt0-y += ../../../../src/cpu/x86/32bit/entry32.inc
87crt0-y += ../../../../src/cpu/x86/16bit/reset16.inc
88crt0-y += ../../../../src/arch/i386/lib/id.inc
89crt0-y += ../../../../src/cpu/amd/car/cache_as_ram.inc
90crt0-y += auto.inc
91
92ldscript-y += ../../../../src/arch/i386/init/ldscript_fallback_cbfs.lb
93ldscript-y += ../../../../src/cpu/x86/16bit/entry16.lds
94ldscript-y += ../../../../src/cpu/x86/16bit/reset16.lds
95ldscript-y += ../../../../src/arch/i386/lib/id.lds
96ldscript-y += ../../../../src/arch/i386/lib/failover.lds
97
98\end{verbatim}
99\subsubsection{defines}
Myles Watson10c41fa2009-08-13 16:02:24 +0000100There are variables that should never be definable by users, as changing them will break the build or the image. These are set
101in MAINBOARD\_OPTIONS.
Patrick Georgi0588d192009-08-12 15:00:51 +0000102\begin{verbatim}
103MAINBOARD_OPTIONS=\
Myles Watson10c41fa2009-08-13 16:02:24 +0000104 -DCONFIG_AP_IN_SIPI_WAIT=0 \
105 -DCONFIG_USE_PRINTK_IN_CAR=1 \
106 -DCONFIG_HAVE_HIGH_TABLES=1
Patrick Georgi0588d192009-08-12 15:00:51 +0000107\end{verbatim}
108\subsubsection{POST\_EVALUATION}
Myles Watson10c41fa2009-08-13 16:02:24 +0000109POST\_EVALUATION rules should be placed after this section:
Patrick Georgi0588d192009-08-12 15:00:51 +0000110\begin{verbatim}
111ifdef POST_EVALUATION
112\end{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000113to ensure that the values of variables are correct.
114Here are the post-evaluation rules for this mainboard:
Patrick Georgi0588d192009-08-12 15:00:51 +0000115\begin{verbatim}
116$(obj)/dsdt.c: $(src)/mainboard/$(MAINBOARDDIR)/dsdt.asl
Myles Watson10c41fa2009-08-13 16:02:24 +0000117 iasl -p dsdt -tc $(src)/mainboard/$(MAINBOARDDIR)/dsdt.asl
118 mv dsdt.hex $@
Patrick Georgi0588d192009-08-12 15:00:51 +0000119
120$(obj)/mainboard/$(MAINBOARDDIR)/dsdt.o: $(obj)/dsdt.c
Myles Watson10c41fa2009-08-13 16:02:24 +0000121 $(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(DEBUG_CFLAGS) -I$(src) -I. -c $< -o $@
Patrick Georgi0588d192009-08-12 15:00:51 +0000122
123$(obj)/ssdt2.c: $(src)/mainboard/$(MAINBOARDDIR)/dx/pci2.asl
Myles Watson10c41fa2009-08-13 16:02:24 +0000124 iasl -p $(CURDIR)/pci2 -tc $(CONFIG_MAINBOARD)/dx/pci2.asl
125 perl -pi -e 's/AmlCode/AmlCode_ssdt2/g' pci2.hex
126 mv pci2.hex ssdt2.c
Patrick Georgi0588d192009-08-12 15:00:51 +0000127
128$(obj)/ssdt3.c: $(src)/mainboard/$(MAINBOARDDIR)/dx/pci3.asl"
Myles Watson10c41fa2009-08-13 16:02:24 +0000129 iasl -p $(CURDIR)/pci3 -tc $(CONFIG_MAINBOARD)/
130 perl -pi -e 's/AmlCode/AmlCode_ssdt3/g' pci3.hex
131 mv pci3.hex ssdt3.c
132
Patrick Georgi0588d192009-08-12 15:00:51 +0000133$(obj)/ssdt4.c: $(src)/mainboard/$(MAINBOARDDIR)/dx/pci4.asl"
Myles Watson10c41fa2009-08-13 16:02:24 +0000134 iasl -p $(CURDIR)/pci4 -tc $(CONFIG_MAINBOARD)/dx/pci4.asl
135 perl -pi -e 's/AmlCode/AmlCode_ssdt4/g' pci4.hex
136 mv pci4.hex ssdt4.c
Patrick Georgi0588d192009-08-12 15:00:51 +0000137
138$(obj)/mainboard/$(MAINBOARDDIR)/auto.inc: $(src)/mainboard/$(MAINBOARDDIR)/rom.c $(obj)/option_table.h
Myles Watson10c41fa2009-08-13 16:02:24 +0000139 $(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(DEBUG_CFLAGS) -I$(src) -I. -c -S $(src)/mainboard/$(MAINBOARDDIR)/rom.c -o $@
140 perl -e 's/\.rodata/.rom.data/g' -pi $@
141 perl -e 's/\.text/.section .rom.text/g' -pi $@
Patrick Georgi0588d192009-08-12 15:00:51 +0000142
143\end{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000144The last rule is for romcc, and, again, we hope to eliminate romcc usage and this rule soon. The first set of rules concern ACPI tables.
Patrick Georgi0588d192009-08-12 15:00:51 +0000145\subsubsection{devicetree.cb}
146Most of the old Config.lb is gone, but one piece remains: the device tree specification. This tree is still required to build a mainboard
Myles Watson10c41fa2009-08-13 16:02:24 +0000147properly, as it defines topology and chips that can be defined no other way.
148Let's go through the tree.
Patrick Georgi0588d192009-08-12 15:00:51 +0000149\begin{verbatim}
150chip northbridge/amd/amdk8/root_complex
Myles Watson10c41fa2009-08-13 16:02:24 +0000151 device apic_cluster 0 on
152 chip cpu/amd/socket_F
153 device apic 0 on end
154 end
155 end
156\end{verbatim}
157This topology is always somewhat confusing to newcomers, and even to coreboot veterans.
158
159We root the tree at the pci-e {\it root complex}. There is always the question of how and where to root the tree. Over the years we
160have found that the one part that never goes away is the root complex. CPU sockets may be empty or full; but there is always a northbridge
161somewhere, since it runs memory.
162
163
164What is the APIC? Northbridges always have an Advanced Programmable Interrupt Controller, and that {\it APIC cluster} is a topological connection to the
165CPU socket. So the tree is rooted at the northbridge, which has a link to an apic cluster, and then the CPU. The CPU contains
166its own APIC, and will define any parameters needed. In this case, we have a northbridge of type
167{\it northbridge/amd/amdk8/root\_complex}, with its own apic\_cluster device which we turn on,
168which connects to a {\it cpu/amd/socket\_F},
169which has an apic, which is on.
170
171Note that we do not enumerate all CPUs, even on this SMP mainboard. The reason is they may not all be there. The CPU we define here
172is the so-called Boot Strap Processor, or BSP; the other CPUs will come along later, as the are discovered. We do not require (unlike many
173BIOSes) that the BSP be CPU 0; any CPU will do.
174\begin{verbatim}
175 device pci_domain 0 on
176 chip northbridge/amd/amdk8
177 device pci 18.0 on # northbridge
178 # devices on link 0, link 0 == LDT 0
179\end{verbatim}
180Here begins the pci domain, which usually starts with 0. Then there is the northbridge, which bridges to the PCI bus. On
181Opterons, certain CPU control registers are managed in PCI config space in device 18.0 (BSP), 19.0 (AP), and up.
182\begin{verbatim}
183 chip southbridge/amd/amd8132
184 # the on/off keyword is mandatory
185 device pci 0.0 on end
186 device pci 0.1 on end
187 device pci 1.0 on end
188 device pci 1.1 on end
Patrick Georgi0588d192009-08-12 15:00:51 +0000189 end
190\end{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000191This is the 8132, a bridge to a secondary PCI bus.
Patrick Georgi0588d192009-08-12 15:00:51 +0000192\begin{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000193 chip southbridge/amd/amd8111
194 # this "device pci 0.0" is the parent the next one
195 # PCI bridge
196 device pci 0.0 on
197 device pci 0.0 on end
198 device pci 0.1 on end
199 device pci 0.2 off end
200 device pci 1.0 off end
201 end
Patrick Georgi0588d192009-08-12 15:00:51 +0000202\end{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000203The 8111 is a bridge to other busses and to the legacy ISA devices such as superio.
Patrick Georgi0588d192009-08-12 15:00:51 +0000204\begin{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000205 device pci 1.0 on
206 chip superio/winbond/w83627hf
207 device pnp 2e.0 off # Floppy
208 io 0x60 = 0x3f0
209 irq 0x70 = 6
210 drq 0x74 = 2
211 end
212 device pnp 2e.1 off # Parallel Port
213 io 0x60 = 0x378
214 irq 0x70 = 7
215 end
216 device pnp 2e.2 on # Com1
217 io 0x60 = 0x3f8
218 irq 0x70 = 4
219 end
220 device pnp 2e.3 off # Com2
221 io 0x60 = 0x2f8
222 irq 0x70 = 3
223 end
224 device pnp 2e.5 on # Keyboard
225 io 0x60 = 0x60
226 io 0x62 = 0x64
227 irq 0x70 = 1
228 irq 0x72 = 12
229 end
230 device pnp 2e.6 off # CIR
231 io 0x60 = 0x100
232 end
233 device pnp 2e.7 off # GAME_MIDI_GIPO1
234 io 0x60 = 0x220
235 io 0x62 = 0x300
236 irq 0x70 = 9
237 end
238 device pnp 2e.8 off end # GPIO2
239 device pnp 2e.9 off end # GPIO3
240 device pnp 2e.a off end # ACPI
241 device pnp 2e.b on # HW Monitor
242 io 0x60 = 0x290
243 irq 0x70 = 5
244 end
245 end
246 end
Patrick Georgi0588d192009-08-12 15:00:51 +0000247\end{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000248The pnp refers to the many Plug N Play devices on a superio. 2e refers to the base I/O address of the superio, and the number following the
2492e (i.e. 2e.1) is the Logical Device Number, or LDN. Each LDN has a common configuration (base, irq, etc.) and these are set by the statements under the LDN.
Patrick Georgi0588d192009-08-12 15:00:51 +0000250\begin{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000251 device pci 1.1 on end
252 device pci 1.2 on end
Patrick Georgi0588d192009-08-12 15:00:51 +0000253\end{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000254More devices. These statements set up placeholders in the device tree.
Patrick Georgi0588d192009-08-12 15:00:51 +0000255\begin{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000256 device pci 1.3 on
257 chip drivers/i2c/i2cmux # pca9556 smbus mux
258 device i2c 18 on #0 pca9516 1
259 chip drivers/generic/generic #dimm 0-0-0
260 device i2c 50 on end
Patrick Georgi0588d192009-08-12 15:00:51 +0000261 end
Myles Watson10c41fa2009-08-13 16:02:24 +0000262 chip drivers/generic/generic #dimm 0-0-1
263 device i2c 51 on end
264 end
265 chip drivers/generic/generic #dimm 0-1-0
266 device i2c 52 on end
267 end
268 chip drivers/generic/generic #dimm 0-1-1
269 device i2c 53 on end
270 end
271 end
272 device i2c 18 on #1 pca9516 2
273 chip drivers/generic/generic #dimm 1-0-0
274 device i2c 50 on end
275 end
276 chip drivers/generic/generic #dimm 1-0-1
277 device i2c 51 on end
278 end
279 chip drivers/generic/generic #dimm 1-1-0
280 device i2c 52 on end
281 end
282 chip drivers/generic/generic #dimm 1-1-1
283 device i2c 53 on end
284 end
285 chip drivers/generic/generic #dimm 1-2-0
286 device i2c 54 on end
287 end
288 chip drivers/generic/generic #dimm 1-2-1
289 device i2c 55 on end
290 end
291 chip drivers/generic/generic #dimm 1-3-0
292 device i2c 56 on end
293 end
294 chip drivers/generic/generic #dimm 1-3-1
295 device i2c 57 on end
296 end
297 end
298 end
299 end # acpi
300\end{verbatim}
301These are the i2c devices.
302\begin{verbatim}
303 device pci 1.5 off end
304 device pci 1.6 off end
305\end{verbatim}
306More placeholders.
307\begin{verbatim}
308 register "ide0_enable" = "1"
309 register "ide1_enable" = "1"
310 end
311 end # device pci 18.0
312
313\end{verbatim}
314These "register" commands set controls in the southbridge.
315\begin{verbatim}
316 device pci 18.0 on end
317 device pci 18.0 on end
318\end{verbatim}
319These are the other two hypertransport links.
320\begin{verbatim}
321 device pci 18.1 on end
322 device pci 18.2 on end
323 device pci 18.3 on end
324\end{verbatim}
325The 18.1 devices are, again, northbridge control for various k8 functions.
326\begin{verbatim}
327 end
328 \end{verbatim}
329That's it for the BSP I/O and HT busses. Now we begin the AP busses. Not much here.
330\begin{verbatim}
331 chip northbridge/amd/amdk8
332 device pci 19.0 on # northbridge
333 chip southbridge/amd/amd8151
334 # the on/off keyword is mandatory
335 device pci 0.0 on end
336 device pci 1.0 on end
337 end
338 end # device pci 19.0
339
340 device pci 19.0 on end
341 device pci 19.0 on end
342 device pci 19.1 on end
343 device pci 19.2 on end
344 device pci 19.3 on end
345 end
Patrick Georgi0588d192009-08-12 15:00:51 +0000346
347
348\end{verbatim}
349\begin{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000350 end #pci_domain
351# chip drivers/generic/debug
352# device pnp 0.0 off end # chip name
353# device pnp 0.1 on end # pci_regs_all
354# device pnp 0.2 off end # mem
355# device pnp 0.3 off end # cpuid
356# device pnp 0.4 off end # smbus_regs_all
357# device pnp 0.5 off end # dual core msr
358# device pnp 0.6 off end # cache size
359# device pnp 0.7 off end # tsc
Patrick Georgi0588d192009-08-12 15:00:51 +0000360# end
361
362end
363\end{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000364This is a trick used to debug by creating entries in the device tree.
Patrick Georgi0588d192009-08-12 15:00:51 +0000365
366\subsection{cpu socket}
Myles Watson10c41fa2009-08-13 16:02:24 +0000367The CPU socket is the key link from mainboard to its CPUs. Since many models of CPU can go in a socket, the mainboard mentions only
368the socket, and the socket, in turn, references the various model CPUs which can be plugged into it. The socket is thus the focus
369of all defines and Makefile controls for building the CPU components of a board.
Patrick Georgi0588d192009-08-12 15:00:51 +0000370
Myles Watson10c41fa2009-08-13 16:02:24 +0000371\subsubsection{ cpu/Kconfig}
372Defines variables. Current variables are:
Patrick Georgi0588d192009-08-12 15:00:51 +0000373\input{cpukconfig.tex}
Myles Watson10c41fa2009-08-13 16:02:24 +0000374Sources all Kconfig files in the vendor directories.
375\subsubsection{ cpu/Makefile.inc}
376Unconditionally sources all Makefile.inc in the vendor directories.
Patrick Georgi0588d192009-08-12 15:00:51 +0000377
Myles Watson10c41fa2009-08-13 16:02:24 +0000378\subsection{cpu/$<$vendor$>$/Kconfig}
379The only action currently taken is to source all Kconfig's in the
380subdirectories.
381\subsection{cpu/$<$vendor$>$/Makefile.inc}
382{\em Conditionally} source the socket directories.
383Example:
Patrick Georgi0588d192009-08-12 15:00:51 +0000384\begin{verbatim}
385subdirs-$(CONFIG_CPU_AMD_SOCKET_F) += socket_F
386\end{verbatim}
387.
Myles Watson10c41fa2009-08-13 16:02:24 +0000388CONFIG\_CPU\_AMD\_SOCKET\_F is set in a mainboard file.
Patrick Georgi0588d192009-08-12 15:00:51 +0000389
Myles Watson10c41fa2009-08-13 16:02:24 +0000390\subsection{cpu/$<$vendor$>$/$<$socket$>$/Kconfig}
391Set variables that relate to this {\em socket}, and {\em any models that plug into this socket}. Note that
392the socket, as much as possible, should control the models, because the models may plug into many sockets.
393Socket\_F currently sets:
Patrick Georgi0588d192009-08-12 15:00:51 +0000394\input{socketfkconfig.tex}
395
Myles Watson10c41fa2009-08-13 16:02:24 +0000396It sources only those Kconfigs that relate to this particular socket, i.e. not all possible models are sourced.
Patrick Georgi0588d192009-08-12 15:00:51 +0000397
Myles Watson10c41fa2009-08-13 16:02:24 +0000398\subsection{cpu/$<$vendor$>$/$<$model$>$/Kconfig}
Patrick Georgi0588d192009-08-12 15:00:51 +0000399CPU Model Kconfigs only set variables, We do not expect that they will source any other Kconfig. The socket Kconfig should do that
Myles Watson10c41fa2009-08-13 16:02:24 +0000400if needed.
401\subsection{cpu/$<$vendor$>$/$<$model$>$/Makefile.inc}
402The Makefile.inc {\em unconditionally} specifies drivers and objects to be included in the build. There is no conditional
403compilation at this point. IF a socket is included, it includes the models. If a model is included, it should include {em all}
404objects, because it is not possible to determine at build time what options may be needed for a given model CPU.
Patrick Georgi0588d192009-08-12 15:00:51 +0000405This Makefile.inc includes no other Makefile.inc files; any inclusion should be done in the socket Makefile.inc.
406
407\subsection{northbridge}
408\subsubsection{northbridge/Kconfig}
Myles Watson10c41fa2009-08-13 16:02:24 +0000409No variables. Source all vendor directory Kconfigs.
410\subsubsection{northbridge/Makefile.inc}
Patrick Georgi0588d192009-08-12 15:00:51 +0000411No variables. unconditionally include all vendor Makefile.inc
Myles Watson10c41fa2009-08-13 16:02:24 +0000412\subsubsection{northbridge/$<$vendor$>$/Kconfig}
413No variables. Source all chip directory Kconfigs.
414\subsubsection{northbridge/$<$vendor$>$/Makefile.inc}
415No variables. {\em Conditionally} include all chipset Makefile.inc. The variable
416is the name of the part, e.g.
Patrick Georgi0588d192009-08-12 15:00:51 +0000417\begin{verbatim}
418subdirs-$(CONFIG_NORTHBRIDGE_AMD_AMDK8) += amdk8
419\end{verbatim}
420.
Myles Watson10c41fa2009-08-13 16:02:24 +0000421\subsubsection{northbridge/$<$vendor$>$/$<$chip$>$/Kconfig}
422Typically a small number of variables. One defines the part name. Here is an example
423of the variables defined for the K8.
Patrick Georgi0588d192009-08-12 15:00:51 +0000424\begin{verbatim}
425config NORTHBRIDGE_AMD_AMDK8
Myles Watson10c41fa2009-08-13 16:02:24 +0000426 bool
427 default n
Patrick Georgi0588d192009-08-12 15:00:51 +0000428
429config AGP_APERTURE_SIZE
Myles Watson10c41fa2009-08-13 16:02:24 +0000430 hex
431 default 0x4000000
Patrick Georgi0588d192009-08-12 15:00:51 +0000432
433config HAVE_HIGH_TABLES
Myles Watson10c41fa2009-08-13 16:02:24 +0000434 int
435 default 1
Patrick Georgi0588d192009-08-12 15:00:51 +0000436\end{verbatim}
Myles Watson10c41fa2009-08-13 16:02:24 +0000437\subsubsection{northbridge/$<$vendor$>$/$<$chip$>$/Makefile.inc}
438Typically very small set of rules, and very simple.
439Since this file is already conditionally included,
Patrick Georgi0588d192009-08-12 15:00:51 +0000440we don't need to test for the chipset CONFIG variable. We
441can therefore test other variables (which is part of the reason
442we set up conditional inclusion of this file, instead
443of unconditionally including it). Here is an example from AMD K8.
Myles Watson10c41fa2009-08-13 16:02:24 +0000444Note that we can make a variable conditional on the ACPI tables.
Patrick Georgi0588d192009-08-12 15:00:51 +0000445\begin{verbatim}
446driver-y += northbridge.o
447driver-y += misc_control.o
448obj-y += get_sblk_pci1234.o
449obj-$(CONFIG_HAVE_ACPI_TABLES) += amdk8_acpi.o
450\end{verbatim}
451
Ronald G. Minnichb5f4e772009-08-17 15:42:18 +0000452\subsection{southbridge}
453\subsubsection{southbridge/Kconfig}
454No variables. Source all vendor directory Kconfigs.
455\subsubsection{southbridge/Makefile.inc}
456No variables. {\em Unconditionally} include all vendor Makefile.inc
457\subsubsection{southbridge/$<$vendor$>$/Kconfig}
458No variables. Source all chip directory Kconfigs.
459\subsubsection{southbridge/$<$vendor$>$/Makefile.inc}
460No variables. {\em Conditionally} include all chipset Makefile.inc. The variable
461is the name of the part, e.g.
462\begin{verbatim}
463subdirs-$(CONFIG_SOUTHBRIDGE_AMD_AMD8111) += amd8111
464\end{verbatim}
465.
466\subsubsection{southbridge/$<$vendor$>$/$<$chip$>$/Kconfig}
467Typically a small number of variables. One defines the part name. Here is an example
468of the variables defined for the K8.
469\begin{verbatim}
470config SOUTHBRIDGE_AMD_AMD8111
471 bool
472 default n
Patrick Georgi0588d192009-08-12 15:00:51 +0000473
Ronald G. Minnichb5f4e772009-08-17 15:42:18 +0000474\end{verbatim}
475\subsubsection{southbridge/$<$vendor$>$/$<$chip$>$/Makefile.inc}
476Typically very small set of rules, and very simple.
477Since this file is already conditionally included,
478we don't need to test for the chipset CONFIG variable. We
479can therefore test other variables (which is part of the reason
480we set up conditional inclusion of this file, instead
481of unconditionally including it). Here is an example from AMD 8111.
482No conditionals in this one yet.
483\begin{verbatim}
484driver-y += amd8111.o
485driver-y += amd8111_usb.o
486driver-y += amd8111_lpc.o
487driver-y += amd8111_ide.o
488driver-y += amd8111_acpi.o
489driver-y += amd8111_usb2.o
490driver-y += amd8111_ac97.o
491driver-y += amd8111_nic.o
492driver-y += amd8111_pci.o
493driver-y += amd8111_smbus.o
494obj-y += amd8111_reset.o
495\end{verbatim}
Patrick Georgi0588d192009-08-12 15:00:51 +0000496
497\subsubsection{vendor and part}
498\subsection{southbridge}
499\subsubsection{vendor and part}
500\subsection{superio}
Ronald G. Minnich5f6572e2009-08-12 15:39:38 +0000501\subsection{drivers/i2c}
Myles Watson10c41fa2009-08-13 16:02:24 +0000502This is a rather special case. There are no Kconfig files or Makefile.inc files here. They are not needed.
503To compile in one of these files, name the .o directory. E.g. in serengeti\_cheetah we have:
Ronald G. Minnich5f6572e2009-08-12 15:39:38 +0000504\begin{verbatim}
505\end{verbatim}
506
Patrick Georgi0588d192009-08-12 15:00:51 +0000507\subsubsection{vendor and part}
508
509\end{document}