coreboot-kgpe-d16/util/cbfstool
Patrick Georgi b890a1228d Remove address from GPLv2 headers
As per discussion with lawyers[tm], it's not a good idea to
shorten the license header too much - not for legal reasons
but because there are tools that look for them, and giving
them a standard pattern simplifies things.

However, we got confirmation that we don't have to update
every file ever added to coreboot whenever the FSF gets a
new lease, but can drop the address instead.

util/kconfig is excluded because that's imported code that
we may want to synchronize every now and then.

$ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *MA[, ]*02110-1301[, ]*USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 59 Temple Place[-, ]*Suite 330, Boston, MA *02111-1307[, ]*USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.:Foundation, Inc.:" {} +
$ find * -type f
	-a \! -name \*.patch \
	-a \! -name \*_shipped \
	-a \! -name LICENSE_GPL \
	-a \! -name LGPL.txt \
	-a \! -name COPYING \
	-a \! -name DISCLAIMER \
	-exec sed -i "/Foundation, Inc./ N;s:Foundation, Inc.* USA\.* *:Foundation, Inc. :;s:Foundation, Inc. $:Foundation, Inc.:" {} +

Change-Id: Icc968a5a5f3a5df8d32b940f9cdb35350654bef9
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/9233
Tested-by: build bot (Jenkins)
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
2015-05-21 20:50:25 +02:00
..
flashmap fmap: request libc compatibility level that includes memccpy 2015-05-09 14:57:55 +02:00
lzma cbfstool: Clean up in preparation for adding new files 2015-04-25 12:14:25 +02:00
EXAMPLE
Makefile cbfstool: clarify dependencies in Makefile 2015-05-19 20:30:04 +02:00
Makefile.inc cbfstool: Copy generated files to the build hierarchy before use 2015-05-19 20:30:11 +02:00
README.fmaptool fmaptool: Introduce the fmd ("flashmap descriptor") language and compiler 2015-05-08 19:55:42 +02:00
cbfs-mkpayload.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
cbfs-mkstage.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
cbfs-payload-linux.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
cbfs.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
cbfs_image.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
cbfs_image.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
cbfs_sections.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
cbfs_sections.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
cbfstool.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
coff.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
common.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
common.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
compress.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
elf.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
elfheaders.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
elfparsing.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
fit.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
fit.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
flashmap_tests.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
fmap_from_fmd.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
fmap_from_fmd.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
fmaptool.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
fmd.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
fmd.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
fmd_parser.c_shipped cbfstool: Rename autogenerated targets 2015-05-19 17:03:54 +02:00
fmd_parser.h_shipped cbfstool: Rename autogenerated targets 2015-05-19 17:03:54 +02:00
fmd_parser.y Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
fmd_scanner.c_shipped Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
fmd_scanner.h_shipped cbfstool: Rename autogenerated targets 2015-05-19 17:03:54 +02:00
fmd_scanner.l Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
fv.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
linux.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
linux_trampoline.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
linux_trampoline.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
option.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
partitioned_file.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
partitioned_file.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
rmodtool.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
rmodule.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
rmodule.h Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
swab.h
xdr.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00

README.fmaptool

Flashmap descriptors in coreboot
================================
Flashmap (https://code.google.com/p/flashmap) is a binary format for representing the layout of
flash chips. Since coreboot is starting to use a "partition" of this format to describe the flash
chip layout---both at runtime and when flashing a new image onto a chip---, the project needed a
reasonably expressive plaintext format for representing such sections in the source tree. Our
solution is the fmd ("flashmap descriptor") language, and the files in this directory contain a
scanner, parser, semantic analyser, and flashmap converter. Here's an informal language description:

# <line comment>
<image name>[@<memory-mapped address>] <image size> {
	<section name>[@<offset from start of image>] [<section size>] [{
		<subsection name>[@<offset from start of parent section>] [<subsection size>] [{
			# Sections can be nested as deeply as desired
			<subsubsection name>[(CBFS)][@...] [...] [{...}]
		}]
		[<subsection name>[(CBFS)][@...] [...] [{...}]]
		# There can be many subsections at each level of nesting: they will be inserted
		# sequentially, and although gaps are allowed, any provided offsets are always
		# relative to the closest parent node's and must be strictly increasing with neither
		# overlapping nor degenerate-size sections.
	}]
}

Note that the above example contains a few symbols that are actually metasyntax, and therefore have
neither meaning nor place in a real file. The <.*> s indicate placeholders for parameters:
 - The names are strings, which are provided as single-word---no whitespace---groups of
   syntactically unimportant symbols (i.e. everything except @, {, and }): they are not surrounded
   by quotes or any other form of delimiter.
 - The other fields are nonnegative integers, which may be given as decimal or hexadecimal; in
   either case, a K, M, or G may be appended---without intermediate whitespace---as a multiplier.
 - Comments consist of anything one manages to enter, provided it doesn't start a new line.
The [.*] s indicate that a portion of the file could be omitted altogether:
 - Just because something is noted as optional doesn't mean it is in every case: the answer might
   actually depend on which other information is---or isn't---provided.
 - In particular, it is only legal to place a (CBFS) annotation on a leaf section; that is, choosing
   to add child sections excludes the possibility of putting a CBFS in their parent. Such
   annotations are only used to decide where CBFS empty file headers should be created, and do not
   result in the storage of any additional metadata in the resulting FMAP section.
Additionally, it's important to note these properties of the overall file and its values:
 - Other than within would-be strings and numbers, whitespace is ignored. It goes without saying
   that such power comes with responsibility, which is why this sentence is here.
 - Although the .*section names must be globally unique, one of them may---but is not required to---
   match the image name.
 - It is a syntax error to supply a number---besides 0---that begins with the character 0, as there
   is no intention of adding octals to the mix.
 - The image's memory address should be present on---and only on---layouts for memory-mapped chips.
 - Although it may be evident from above, all .*section offsets are relative only to the immediate
   parent. There is no way to include an absolute offset (i.e. from the beginning of flash), which
   means that it is "safe" to reorder the .*section s within a particular level of nesting, as long
   as the change doesn't cause their positions and sizes to necessitate overlap or zero sizes.
 - A .*section with omitted offset is assumed to start at as low a position as possible---with no
   consideration of alignment---and one with omitted size is assumed to fill the remaining space
   until the next sibling or before the end of its parent.
 - It's fine to omit any .*section 's offset, size, or both, provided its position and size are
   still unambiguous in the context of its *sibling* sections and its parent's *size*. In
   particular, knowledge of one .*section 's children or the .*section s' common parent's siblings
   will not be used for this purpose.
 - Although .*section s are not required to have children, the flash chip as a whole must have at
   least one.
 - Though the braces after .*section s may be omitted for those that have no children, if they are
   present, they must contain at least one child.

PL people and sympathizers may wish to examine the formal abstract syntax and context-free grammar,
which are located in fmd_scanner.l and fmd_scanner.y, respectively. Those interested in the
algorithm used to infer omitted values will feel at home in fmd.c, particularly near the definition
of validate_and_complete_info().