xref: /openbmc/u-boot/Documentation/index.rst (revision 78a88f79)
1*78a88f79SMario Six====================
2*78a88f79SMario SixU-Boot Hacker Manual
3*78a88f79SMario Six====================
4*78a88f79SMario Six
5*78a88f79SMario SixLinker-Generated Arrays
6*78a88f79SMario Six=======================
7*78a88f79SMario Six
8*78a88f79SMario SixA linker list is constructed by grouping together linker input
9*78a88f79SMario Sixsections, each containing one entry of the list. Each input section
10*78a88f79SMario Sixcontains a constant initialized variable which holds the entry's
11*78a88f79SMario Sixcontent. Linker list input sections are constructed from the list
12*78a88f79SMario Sixand entry names, plus a prefix which allows grouping all lists
13*78a88f79SMario Sixtogether. Assuming _list and _entry are the list and entry names,
14*78a88f79SMario Sixthen the corresponding input section name is
15*78a88f79SMario Six
16*78a88f79SMario Six::
17*78a88f79SMario Six
18*78a88f79SMario Six  .u_boot_list_ + 2_ + @_list + _2_ + @_entry
19*78a88f79SMario Six
20*78a88f79SMario Sixand the C variable name is
21*78a88f79SMario Six
22*78a88f79SMario Six::
23*78a88f79SMario Six
24*78a88f79SMario Six  _u_boot_list + _2_ + @_list + _2_ + @_entry
25*78a88f79SMario Six
26*78a88f79SMario SixThis ensures uniqueness for both input section and C variable name.
27*78a88f79SMario Six
28*78a88f79SMario SixNote that the names differ only in the first character, "." for the
29*78a88f79SMario Sixsection and "_" for the variable, so that the linker cannot confuse
30*78a88f79SMario Sixsection and symbol names. From now on, both names will be referred
31*78a88f79SMario Sixto as
32*78a88f79SMario Six
33*78a88f79SMario Six::
34*78a88f79SMario Six
35*78a88f79SMario Six  %u_boot_list_ + 2_ + @_list + _2_ + @_entry
36*78a88f79SMario Six
37*78a88f79SMario SixEntry variables need never be referred to directly.
38*78a88f79SMario Six
39*78a88f79SMario SixThe naming scheme for input sections allows grouping all linker lists
40*78a88f79SMario Sixinto a single linker output section and grouping all entries for a
41*78a88f79SMario Sixsingle list.
42*78a88f79SMario Six
43*78a88f79SMario SixNote the two '_2_' constant components in the names: their presence
44*78a88f79SMario Sixallows putting a start and end symbols around a list, by mapping
45*78a88f79SMario Sixthese symbols to sections names with components "1" (before) and
46*78a88f79SMario Six"3" (after) instead of "2" (within).
47*78a88f79SMario SixStart and end symbols for a list can generally be defined as
48*78a88f79SMario Six
49*78a88f79SMario Six::
50*78a88f79SMario Six
51*78a88f79SMario Six  %u_boot_list_2_ + @_list + _1_...
52*78a88f79SMario Six  %u_boot_list_2_ + @_list + _3_...
53*78a88f79SMario Six
54*78a88f79SMario SixStart and end symbols for the whole of the linker lists area can be
55*78a88f79SMario Sixdefined as
56*78a88f79SMario Six
57*78a88f79SMario Six::
58*78a88f79SMario Six
59*78a88f79SMario Six  %u_boot_list_1_...
60*78a88f79SMario Six  %u_boot_list_3_...
61*78a88f79SMario Six
62*78a88f79SMario SixHere is an example of the sorted sections which result from a list
63*78a88f79SMario Six"array" made up of three entries : "first", "second" and "third",
64*78a88f79SMario Sixiterated at least once.
65*78a88f79SMario Six
66*78a88f79SMario Six::
67*78a88f79SMario Six
68*78a88f79SMario Six  .u_boot_list_2_array_1
69*78a88f79SMario Six  .u_boot_list_2_array_2_first
70*78a88f79SMario Six  .u_boot_list_2_array_2_second
71*78a88f79SMario Six  .u_boot_list_2_array_2_third
72*78a88f79SMario Six  .u_boot_list_2_array_3
73*78a88f79SMario Six
74*78a88f79SMario SixIf lists must be divided into sublists (e.g. for iterating only on
75*78a88f79SMario Sixpart of a list), one can simply give the list a name of the form
76*78a88f79SMario Six'outer_2_inner', where 'outer' is the global list name and 'inner'
77*78a88f79SMario Sixis the sub-list name. Iterators for the whole list should use the
78*78a88f79SMario Sixglobal list name ("outer"); iterators for only a sub-list should use
79*78a88f79SMario Sixthe full sub-list name ("outer_2_inner").
80*78a88f79SMario Six
81*78a88f79SMario SixHere is an example of the sections generated from a global list
82*78a88f79SMario Sixnamed "drivers", two sub-lists named "i2c" and "pci", and iterators
83*78a88f79SMario Sixdefined for the whole list and each sub-list:
84*78a88f79SMario Six
85*78a88f79SMario Six::
86*78a88f79SMario Six
87*78a88f79SMario Six  %u_boot_list_2_drivers_1
88*78a88f79SMario Six  %u_boot_list_2_drivers_2_i2c_1
89*78a88f79SMario Six  %u_boot_list_2_drivers_2_i2c_2_first
90*78a88f79SMario Six  %u_boot_list_2_drivers_2_i2c_2_first
91*78a88f79SMario Six  %u_boot_list_2_drivers_2_i2c_2_second
92*78a88f79SMario Six  %u_boot_list_2_drivers_2_i2c_2_third
93*78a88f79SMario Six  %u_boot_list_2_drivers_2_i2c_3
94*78a88f79SMario Six  %u_boot_list_2_drivers_2_pci_1
95*78a88f79SMario Six  %u_boot_list_2_drivers_2_pci_2_first
96*78a88f79SMario Six  %u_boot_list_2_drivers_2_pci_2_second
97*78a88f79SMario Six  %u_boot_list_2_drivers_2_pci_2_third
98*78a88f79SMario Six  %u_boot_list_2_drivers_2_pci_3
99*78a88f79SMario Six  %u_boot_list_2_drivers_3
100*78a88f79SMario Six
101*78a88f79SMario Six.. kernel-doc:: include/linker_lists.h
102*78a88f79SMario Six   :internal:
103*78a88f79SMario Six
104*78a88f79SMario SixSerial system
105*78a88f79SMario Six=============
106*78a88f79SMario Six
107*78a88f79SMario Six.. kernel-doc:: drivers/serial/serial.c
108*78a88f79SMario Six   :internal:
109*78a88f79SMario Six
110*78a88f79SMario SixThe U-Boot EFI subsystem
111*78a88f79SMario Six========================
112*78a88f79SMario Six
113*78a88f79SMario SixBoot services
114*78a88f79SMario Six-------------
115*78a88f79SMario Six
116*78a88f79SMario Six.. kernel-doc:: lib/efi_loader/efi_boottime.c
117*78a88f79SMario Six   :internal:
118