Skip to content

Commit f37992c

Browse files
author
Marek Kasiewicz
committed
Merge branch 'master' into develop
Signed-off-by: Marek Kasiewicz <[email protected]>
2 parents 9ef25de + c79fc47 commit f37992c

File tree

1,908 files changed

+36110
-27910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,908 files changed

+36110
-27910
lines changed

3rdparty/blobs

Submodule blobs updated from 353f246 to 02ab6c6

3rdparty/chromeec

Submodule chromeec updated from a1afae4 to a2390f3

Documentation/coding_style.md renamed to Documentation/contributing/coding_style.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ than desirable (in fact, they are worse than random typing - an infinite
530530
number of monkeys typing into GNU emacs would never make a good program).
531531

532532
So, you can either get rid of GNU emacs, or change it to use saner values.
533-
To do the latter, you can stick the following in your .emacs file:
533+
To do the latter, you can stick the following in your .emacs file:
534534

535535
```lisp
536536
(defun c-lineup-arglist-tabs-only (ignored)
@@ -834,22 +834,51 @@ subject to this rule. Generally they indicate failure by returning some
834834
out-of-range result. Typical examples would be functions that return
835835
pointers; they use NULL or the ERR_PTR mechanism to report failure.
836836

837-
Don't re-invent the kernel macros
838-
----------------------------------
837+
Headers and includes
838+
---------------
839839

840-
The header file include/linux/kernel.h contains a number of macros that
841-
you should use, rather than explicitly coding some variant of them
842-
yourself. For example, if you need to calculate the length of an array,
843-
take advantage of the macro
840+
Headers should always be included at the top of the file, preferrably in
841+
alphabetical order. Includes should always use the `#include <file.h>`
842+
notation, except for rare cases where a file in the same directory that
843+
is not part of a normal include path gets included (e.g. local headers
844+
in mainboard directories), which should use `#include "file.h"`. Headers
845+
that can be included from both assembly files and .c files should keep
846+
all C code wrapped in `#ifndef __ASSEMBLER__` blocks, including includes
847+
to other headers that don't follow that provision.
848+
849+
Files should generally include every header they need a definition from
850+
directly (and not include any unnecessary extra headers). Excepted from
851+
this are certain headers that intentionally chain-include other headers
852+
which logically belong to them and are just factored out into a separate
853+
location for implementation or organizatory reasons. This could be
854+
because part of the definitions is generic and part SoC-specific (e.g.
855+
`<gpio.h>` chain-including `<soc/gpio.h>`), architecture-specific (e.g.
856+
`<device/mmio.h>` chain-including `<arch/mmio.h>`), separated out into
857+
commonlib[/bsd] for sharing/license reasons (e.g. `<cbfs.h>`
858+
chain-including `<commonlib/bsd/cbfs_serialized.h>`) or just split out
859+
to make organizing subunits of a larger header easier. This can also
860+
happen when certain definitions need to be in a specific header for
861+
legacy POSIX reasons but we would like to logically group them together
862+
(e.g. `uintptr_t` is in `<stdint.h>` and `size_t` in `<stddef.h>`, but
863+
it's nicer to be able to just include `<types.h>` and get all the common
864+
type and helper function stuff we need everywhere).
865+
866+
The headers `<kconfig.h>`, `<rules.h>` and `<commonlib/bsd/compiler.h>`
867+
are always automatically included in all compilation units by the build
868+
system and should not be included manually.
869+
870+
Don't re-invent common macros
871+
-----------------------------
872+
873+
The header file `src/commonlib/bsd/include/commonlib/bsd/helpers.h`
874+
contains a number of macros that you should use, rather than explicitly
875+
coding some variant of them yourself. For example, if you need to
876+
calculate the length of an array, take advantage of the macro
844877

845878
```c
846879
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
847880
```
848881

849-
There are also min() and max() macros that do strict type checking if
850-
you need them. Feel free to peruse that header file to see what else is
851-
already defined that you shouldn't reproduce in your code.
852-
853882
Editor modelines and other cruft
854883
--------------------------------
855884

Documentation/getting_started/kconfig.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ int &lt;expr&gt; \[if &lt;expr&gt;\]
607607

608608

609609
##### Example:
610-
config PRE_GRAPHICS_DELAY
610+
config PRE_GRAPHICS_DELAY_MS
611611
int "Graphics initialization delay in ms"
612612
default 0
613613
help

Documentation/ifdtool/layout.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ way to categorize anything required by the SoC but not provided by coreboot.
1919
| IFD Region | IFD Region name | FMAP Name | Notes |
2020
| index | | | |
2121
+============+==================+===========+===========================================+
22-
| 0 | Flash Descriptor | SI_DESC | Always the top 4KB of flash |
22+
| 0 | Flash Descriptor | SI_DESC | Always the top 4 KiB of flash |
2323
+------------+------------------+-----------+-------------------------------------------+
2424
| 1 | BIOS | SI_BIOS | This is the region that contains coreboot |
2525
+------------+------------------+-----------+-------------------------------------------+
@@ -40,9 +40,9 @@ way to categorize anything required by the SoC but not provided by coreboot.
4040
The ifdtool can be used to manipulate a firmware image with a IFD. This tool
4141
will not take into account the FMAP while modifying the image which can lead to
4242
unexpected and hard to debug issues with the firmware image. For example if the
43-
ME region is defined at 6 MB in the IFD but the FMAP only allocates 4 MB for the
44-
ME, then when the ME is added by the ifdtool 6 MB will be written which could
45-
overwrite 2 MB of the BIOS.
43+
ME region is defined at 6 MiB in the IFD but the FMAP only allocates 4 MiB for
44+
the ME, then when the ME is added by the ifdtool 6 MiB will be written which
45+
could overwrite 2 MiB of the BIOS.
4646

4747
In order to validate that the FMAP and the IFD are compatible the ifdtool
4848
provides --validate (-t) option. `ifdtool -t` will read both the IFD and the
@@ -75,4 +75,4 @@ Region mismatch between pd and SI_PDR
7575
FMAP area SI_PDR:
7676
offset: 0x007fc000
7777
length: 0x00004000
78-
```
78+
```

Documentation/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Contents:
162162

163163
* [Getting Started](getting_started/index.md)
164164
* [Tutorial](tutorial/index.md)
165-
* [Coding Style](coding_style.md)
165+
* [Coding Style](contributing/coding_style.md)
166166
* [Project Ideas](contributing/project_ideas.md)
167167
* [Documentation Ideas](contributing/documentation_ideas.md)
168168
* [Code of Conduct](community/code_of_conduct.md)

Documentation/mainboard/facebook/monolith.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ These can be extracted from the original flash image as follows:
4141
00003000:006FFFFF me
4242
00001000:00002fff gbe
4343
```
44-
3) Use `ifdtool -n <layout_file> <flash_image>` to resize the *bios* region from the default 6MB
45-
to 9 MB, this is required to create sufficient space for LinuxBoot.
44+
3) Use `ifdtool -n <layout_file> <flash_image>` to resize the *bios* region from the default 6 MiB
45+
to 9 MiB, this is required to create sufficient space for LinuxBoot.
4646
NOTE: Please make sure only the firmware descriptor (*fd*) region is changed. Older versions
4747
of the ifdtool corrupt the *me* region.
4848
4) Use `ifdtool -x <resized_flash_image>` to extract the components.

0 commit comments

Comments
 (0)