summaryrefslogtreecommitdiffstats
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* abuild: break early if building tools failsPatrick Georgi2014-04-161-1/+1
| | | | | | | | Change-Id: I8da04df024a31c780b924a586d056a5351845153 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/4773 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* abuild: more verbose configuration stepPatrick Georgi2014-04-161-1/+1
| | | | | | | | | Also pass V=1 to the configuration step, if requested. Change-Id: If8b413d65d6bac34efab63614d039d74d920c8db Reviewed-on: http://review.coreboot.org/5492 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* util/cbfstool: Make cbfs_image_delete() NULL-tolerant.Edward O'Callaghan2014-04-071-0/+3
| | | | | | | | | | | | | | | | This fixes a double free crash that occurs when a call to cbfs_image_from_file() fails in cbfs_extract() and falls though to cbfs_image_delete() with a NULL-pointer. To reproduce the crash pass the following arguments where the files passed, in fact, do not exist. As follows: ./cbfstool build/coreboot.rom extract -n config -f /tmp/config.txt Change-Id: I2213ff175d0703705a0ec10271b30bb26b6f8d0a Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/5353 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
* util/cbmem: handle larger than 1MiB mappings for consoleAaron Durbin2014-04-021-14/+36
| | | | | | | | | | | | | | In some cases the cbmem console can be larger than the default mapping size of 1MiB. Therefore, add the ability to do a mapping that is larger than the default mapping using map_memory_size(). The console printing code will unconditionally map the console based on the size it finds in the cbmem entry. Change-Id: I016420576b9523ce81195160ae86ad16952b761c Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5440 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
* cbfstool: provide structure to linux payload builderAaron Durbin2014-03-282-116/+208
| | | | | | | | | | | | | | | | | | | | | | This change started with tracking down a bug where the trampoline size was not being taken into account for sizing the output buffer leading to a heap corruption. I was having a hard time keeping track of what num_segments actually tracked as well as what parts were being placed in the output buffer. Here's my attempt at hopefully providing more clarity. This change doesn't crash when adding a bzImage: $ dd if=/dev/zero of=bb.bin bs=64 count=1 $ ./cbfstool tmp.rom create -s 4M -B bb.bin -m x86 -a 64 $ ./cbfstool tmp.rom add-payload -f ~/Downloads/bzImage -C "1" -n "fallback"/payload Change-Id: Ib1de1ddfec3c7102facffc5815c52b340fcdc628 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5408 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Marc Jones <marc.jones@se-eng.com>
* util/superiotool: Add initial support for Fintek F71869ED.Wilbert Duijvenvoorde2014-03-272-2/+50
| | | | | | | | | | | | | | | | | | Datasheet: http://www.fintek.com.tw/files/productfiles/F71869_V1.1.pdf Practically the same as F71869AD, just another ID (0x1408). Tested on actual hardware, Jetway NC9C-550-LF. Update: Fixed F71869ED based on the proper datasheet: http://www.alldatasheet.com/datasheet-pdf/pdf/459075/FINTEK/F71869ED.html Change-Id: I5da858565ca16ba4d73b47b42fadd31dabbc290b Signed-off-by: Wilbert Duijvenvoorde <w.a.n.duijvenvoorde@gmail.com> Reviewed-on: http://review.coreboot.org/5380 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Idwer Vollering <vidwer@gmail.com>
* util/superiotool: Register fix for Fintek F71869ADWilbert Duijvenvoorde2014-03-241-16/+26
| | | | | | | | | | | | | Fixed F71869AD based on the proper datasheet: http://www.alldatasheet.com/datasheet-pdf/pdf/459074/FINTEK/F71869AD.html Change-Id: If22341551c6a1a9bbae088801a6194f7b5b6bf4d Signed-off-by: Wilbert Duijvenvoorde <w.a.n.duijvenvoorde@gmail.com> Reviewed-on: http://review.coreboot.org/5405 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Rudolf Marek <r.marek@assembler.cz>
* util: add rmodtool for parsing ELF files to rmodulesAaron Durbin2014-03-205-16/+800
| | | | | | | | | | | | | | | | | | The current implementation of creating rmodules relies on invoking the linker in a certain manner with the relocations overlaid on the BSS section. It's not really surprising that the linker doesn't always behave the way one wants depending on the linker used and the architecture. Instead, introduce rmodtool which takes an ELF file as an input, parses it, and creates a new ELF file in the format the rmodule loader expects. Change-Id: I31ac2d327d450ef841c3a7d9740b787278382bef Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5378 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
* cbfstool: add ELF writing supportAaron Durbin2014-03-182-0/+350
| | | | | | | | | | | | | | | | In order to generate rmodules in the format of ELF files there needs to be support for writing out ELF files. The ELF writer is fairly simple. It accpets sections that can be associated with an optional buffer (file data). For each section flagged with SHF_ALLOC a PT_LOAD segment is generated. There isn't smart merging of the sections into a single PT_LOAD segment. Change-Id: I4d1a11f2e65be2369fb3f8bff350cbb28e14c89d Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5377 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* romcc.c: Fixes warning about unused function from unused macros.Edward O'Callaghan2014-03-171-13/+0
| | | | | | | | | | | | | GCC suppresses warnings about unused static functions if they are inline, however Clang only does this for header files. None of these MASK_ declarations are used, so just remove them. Change-Id: Ia230beba3f6367237838d9b3d90536459e1d52cb Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/5273 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
* cbfstool: add symbol table parsing to the ELF parserAaron Durbin2014-03-142-0/+74
| | | | | | | | | | | | Optionally parse the symbol table contained within an ELF file. It currently assumes there is only one symbol table present, and it errors out if more than one is found. Change-Id: I4ac4ad03184a319562576d8ab24fa620e701672a Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5376 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
* cbfstool: add string table parsing to ELF parserAaron Durbin2014-03-142-4/+59
| | | | | | | | | | Optionally parse the string tables within an ELF file. Change-Id: I89f9da50b4fcf1fed7ac44f00c60b495c35555ef Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5375 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
* cbfstool: add relocation parsing to ELF parserAaron Durbin2014-03-142-0/+97
| | | | | | | | | | | Optionally parse the relocation entries found within an ELF file. Change-Id: I343647f104901eb8a6a997ddf44aa5d36c31b44b Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5374 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
* cbfstool: introduce struct parsed_elf and parse_elf()Aaron Durbin2014-03-142-31/+106
| | | | | | | | | | | | | | In order to make the ELF parsing more flexible introduce a parse_elf() function which takes a struct parsed_elf parameter. In addition take a flags parameter which instructs the ELF parser as to what data within the ELF file should be parsed. Change-Id: I3e30e84bf8043c3df96a6ab56cd077eef2632173 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5373 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
* cbfstool: remove incorrect section size checkAaron Durbin2014-03-131-5/+0
| | | | | | | | | | | | | I was overzealous in checking the section size with respect to the file size. That check makes no sense as the section only deals with link sizes -- not on-disk sizes. Remove the check as it doesn't make any sense. Change-Id: I348e7847ae3a50badc22693439614f813462445a Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5384 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
* cbfstool: elfparsing: check segment and section regionsAaron Durbin2014-03-131-2/+16
| | | | | | | | | | | | While parsing the section and program headers ensure the locations of their contents are within the elf file proper. Change-Id: I856f7de45f82ac15977abc06e51bedb51c58dde1 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5372 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Marc Jones <marc.jones@se-eng.com>
* cbfstool: elfheaders: use proper parameters to calloc()Aaron Durbin2014-03-131-2/+2
| | | | | | | | | | | | | | Though the result doesn't matter much, the callers of calloc() should order the parameters correctly. i.e. the first paramter is the number of elements in an array and the second is the size of each element. Change-Id: Ic7c2910d623d96f380feb4e5f6fa432376f49e9b Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5371 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Marc Jones <marc.jones@se-eng.com>
* cbfstool: add eflparsing.hAaron Durbin2014-03-138-15/+35
| | | | | | | | | | | | | | elfparsing.h serves as the header to working with the elf parser. Additionally, only include what is needed by the other files. Many had no reason to be including elf.h aside from fixing compilation problems when including cbfs.h. Change-Id: I9eb5f09f3122aa18beeca52d2e4dc2102d70fb9d Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5370 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Marc Jones <marc.jones@se-eng.com>
* cbfstool: move iself() to eflheaders.cAaron Durbin2014-03-133-9/+7
| | | | | | | | | | | | The only user of iself() was in elfheaders.c. Move it there, and make it local to the compilation unit. Change-Id: I0d919ce372f6e2fce75885fb4fcba20d985979b3 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5369 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Marc Jones <marc.jones@se-eng.com>
* cbfstool: elfheaders: use common checks and buffer helpersAaron Durbin2014-03-131-68/+79
| | | | | | | | | | | | | | The elfheaders code was manipulating struct buffers. Use the introduced buffer helper functions. Additionally fix up offset and size checks for the program headers and section headers by using common code paths. Change-Id: I279c77f77aaa1860a0be43fb111df890dd1d84d5 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5368 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Marc Jones <marc.jones@se-eng.com>
* Revert "boardstatus/towiki: Declare southbridge=northbridge=cpu on SOCs"Alexandru Gagniuc2014-03-121-23/+1
| | | | | | | | | | | | | | | | This reverts commit b845636ce67f6e7c96bf3fb3008738f596a5d5ce. This commit changed the board status script to describe all boards in terms of x86 terminology, such as CPU->southbridge->northbridge. This terminology does not apply to a number of SoCs, in which the buses are not connected via successive bridges, and as such it is misleading and misguided to describe ideas of southbridge and northbridge for these devices. Change-Id: I98ba24ee00b816bf20d507c6d313ec2946acaedf Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5177 Tested-by: build bot (Jenkins)
* cbfstool: add struct buffer helper routinesAaron Durbin2014-03-111-0/+43
| | | | | | | | | | | | There are some open-coded manipulation of the struct buffer innards in the elf parsing code. Add helper functions to avoid reaching into the struct itself. Change-Id: I0d5300afa1a3549f87f588f976184e880d071682 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5367 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* cbfstool: add bputs() to store a byte stream to a bufferAaron Durbin2014-03-112-2/+10
| | | | | | | | | | | | There was already a bgets() function which operates on a buffer to copy a byte stream. Provide bputs() to store a byte stream to a buffer, thus making the API symmetrical. Change-Id: I6166f6b68eacb822da38c9da61a3e44f4c67136d Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5366 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* cbfstool: add get8/put8 variants to xdr structuresAaron Durbin2014-03-112-4/+6
| | | | | | | | | | | | In order to provide consistent usage provide the get8() and put8() callbacks to xdr operations. That way no futzing needs to be done to handle 8-bit reads and writes. Change-Id: I1233d25df67134dc5c3bbd1a84206be77f0da417 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5365 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* cbfstool: move verbose to common.cAaron Durbin2014-03-112-1/+1
| | | | | | | | | | | | In order for multiple tools to use the common code found in common.c place the verbose variable within common.c's compilation unit. Change-Id: I71660a5fd4d186ddee81b0da8b57ce2abddf178a Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5364 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* lbtdump: Dump forwarded tables.Vladimir Serbinenko2014-03-091-5/+50
| | | | | | | | | | | | | Recent coreboot puts real tables in high memory and only pointer is remaining at traditional location. This patch makes lbtdump work with recent coreboot. Change-Id: I1c4945909da16c0ec81e59c2d94d9a7d27e2aba5 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/4830 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
* utils/romcc.c: Fix spurious unsigned integer comparisons.Edward O'Callaghan2014-03-081-5/+5
| | | | | | | | | | | Clang warns about comparisons of unsigned integers with being below zero. Remove spurious logic checks that are always false. Change-Id: I70c4d5331df81e48bf7ef27ff98400c4218f7edc Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/5275 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
* cbfstool/lzma: Remove dead code under #ifdefsAlexandru Gagniuc2014-03-023-129/+2
| | | | | | | | | | | | | | Remove a bunch of dead code which depends either on commented out #defines, or compiler definitions. Use this opportunity to remove the need for "-D_7ZIP_ST" in the compiler flags. Change-Id: Ib6629002be7bf4cee6d95d7baa724893b5e8ba32 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5083 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
* util/ifdtool: cleanup some magic numbersChris Douglass2014-02-281-15/+17
| | | | | | | | | | | | There are five firmware regions that are (currently) defined. This was assumed throughout the ifdtool code with many literal 4s and 5s. This patch changes them to refer to a new #define NUM_REGIONS. Change-Id: I523d3763942f875025ebc4b9ba8b2ccf1db5b2f5 Signed-off-by: Christopher Douglass <cdouglass.orion@gmail.com> Reviewed-on: http://review.coreboot.org/5313 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* util/ifdtool: add option to change flash layoutChris Douglass2014-02-281-4/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new option "--newlayout <file>" will read <file> in flashrom's layout format and copy flash regions from the current flash image file to a new flash image file. If a region grows, the padding is added at the beginning of the target region in the new file so that the data is "right-aligned" to the end of the region. If a region shrinks, a warning is given and the tail end of existing data is copied to the target region in the new file. Regions of zero or negative size are ignored. (In the example below 00fff000:00000fff regions are an artifact of the address encoding in the register fields.) Example Usage: Given a flash image for a board with a Sandy Bridge processor and Intel 6-Series chipset in the file vpx7654.bin ifdtool --layout layout.txt vpx7564.bin will yield the file layout.txt: 00000000:00000fff fd 00180000:003fffff bios 00001000:0017ffff me 00fff000:00000fff gbe 00fff000:00000fff pd Notice that the "bios" portion extends to the end of the 4MB flash. It may be edited to extend the bios portion to consume to the extent of an 8MB flash. like layout2.txt: 00000000:00000fff fd 00180000:007fffff bios 00001000:0017ffff me 00fff000:00000fff gbe 00fff000:00000fff pd ifdtool --newlayout layout.txt vpx7654.bin will create a file vpx7654.bin.new that is 8MB. Change-Id: I0e0925a725c40fa44d8c4b6e86552028779d0523 Signed-off-by: Christopher Douglass <cdouglass.orion@gmail.com> Reviewed-on: http://review.coreboot.org/5312 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* util/ifdtool: add option to dump flashrom layoutChris Douglass2014-02-282-13/+90
| | | | | | | | | | | | | | | | | | | | | | | | Dump the Intel Flash Descriptor map in the format expected by flashrom's "layout" option. Example usage: Given a 4MB flash image vpx7654.bin that was generated by Intel's FITC tool for a 6-Series chipset... ./ifdtool --layout l.txt vpx7654.bin cat l.txt 00000000:00000fff fd 00180000:003fffff bios 00001000:0017ffff me 00fff000:00000fff gbe 00fff000:00000fff pd Change-Id: Ib740178ed6935b5f6e1dba1be674303f9f980429 Signed-off-by: Christopher Douglass <cdouglass.orion@gmail.com> Reviewed-on: http://review.coreboot.org/5306 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* boardstatus/towiki: Skip OVERRIDE_FANCTLVladimir Serbinenko2014-02-281-1/+1
| | | | | | | | Change-Id: I4c5f69db198c8aa4757c82856fb04aa5ee16879f Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/5123 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
* boardstatus/towiki: Skip comments after options.Vladimir Serbinenko2014-02-281-1/+1
| | | | | | | | | Change-Id: Id1213f4a44cd3a7a698b761d4942707d7dc1dee6 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/5122 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
* boardstatus/to-wiki.sh: Accept Kconfig with non-tab separators.Vladimir Serbinenko2014-02-281-2/+2
| | | | | | | | | Change-Id: I3812c6bd6fb11d9e98ef60afb205782f2b1f0e44 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/5069 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
* crossgcc: Update IASL to latest version (20140114)Alexandru Gagniuc2014-02-141-3/+3
| | | | | | | | | Change-Id: I2450cad4a43907b8ca6d8f4d35932d7f451f71ea Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5116 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Idwer Vollering <vidwer@gmail.com>
* utils/crossgcc: Refactor Makefiles for separate arm/i386.Edward O'Callaghan2014-02-121-4/+9
| | | | | | | | | | | Refactor Makefile build system as decompartmentalise armv7a and i386 targets from crossgcc. Change-Id: If93f62050810ba594c9925a9eb8ba9d04bc76459 Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/4008 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
* cbfstool/lzma: Remove code which depends on commented out definesAlexandru Gagniuc2014-02-113-21/+3
| | | | | | | | | | | | | These options seem to control the behavior of the encoder/decoder, with comments citing a trade-off between memory usage and performance. I removed these in a separate patch to make reverting in the future easier, if we find these options are useful. Change-Id: I24cb7101b89e60f4fb96777e3681c03d2a62e3d5 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5084 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
* cbfstool: Deserialize CBFS master header when reading imageAlexandru Gagniuc2014-02-113-31/+58
| | | | | | | | | | | | | | | Rather than using [hn]to[nh] whenever accessing a member of the CBFS header, deserialize the header when opening the CBFS image. The header is no longer a pointer inside the CBFS buffer, but a separate struct, a copy of the original header in a host-friendly format. This kills more of the ntohl usage. Change-Id: I5f8a5818b9d5a2d1152b1906249c4a5847d02bac Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5121 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
* cbfstool/lzma: Remove LITTLE_ENDIAN_AND_UNALIGNED_ACCESS_OKAlexandru Gagniuc2014-02-101-16/+0
| | | | | | | | | | | This was designed as a micro-optimization for x86, but it is only used once. Let the compiler decide if optimizing this is worth the effort. Change-Id: I5939efa34f0e9d16643893ca04675247842e7db5 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5085 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
* cbfstool: Fix LzmaEnc.c and build with -WshadowAlexandru Gagniuc2014-02-102-14/+8
| | | | | | | | | | | | | | | LzmaEnc.c was full of shadow definitions. Luckily, shadow definitions were not used after the scope in which they were redefined, so it is possible to just remove them. Tested by successfully booting qemu i440fx to grub2 payload. Change-Id: I01d44db59882114ffe64434b655b931f3beec8e2 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5082 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
* cbfstool: Fix build errors when building with clangAlexandru Gagniuc2014-02-102-2/+2
| | | | | | | | | | | | Now that we can set CC to an arbitrary compiler, fix issues that clang finds. Luckily, there were only two trivial errors. Change-Id: I0fd1f0f263a8ab7004f39cd36ed42d1a1cba5c04 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5081 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
* boardstatus/towiki: Fix 1st gen i3/i5/i7 codenameVladimir Serbinenko2014-02-071-1/+1
| | | | | | | | | | It was a typo. Change-Id: I82964b5ed7e7749ba141aeb3ee8dc4c107bcd7a9 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/5127 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@google.com>
* boardstatus/towiki: Declare southbridge=northbridge=cpu on SOCsVladimir Serbinenko2014-02-071-1/+23
| | | | | | | | Change-Id: I3a38ca834606bb53e6f82cbe79c3a99288429aee Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/5124 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@google.com>
* Add an xdr function for the cbfs_file headerRonald G. Minnich2014-02-055-4/+37
| | | | | | | | | | And use it in fit.c and remove one more use of htonl. Change-Id: Ibf18dcc0a7f08d75c2374115de0db7a4bf64ec1e Signed-off-by: Ronald G. Minnich <rminnich@google.com> Reviewed-on: http://review.coreboot.org/5120 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
* Change the linux payload generator to use the standard header generatorRonald G. Minnich2014-02-053-29/+33
| | | | | | | | | | | | | When I changed mkpayload, I did not realize we had a duplicate block of code in the linux payload code. Have it use the same header generator as the standard payload code does. Change-Id: Ie39540089ce89b704290c89127da4c7b051ecb0e Signed-off-by: Ronald G. Minnich <rminnich@google.com> Reviewed-on: http://review.coreboot.org/5115 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
* cbfstool: Eliminate global variable "arch"Alexandru Gagniuc2014-02-047-18/+20
| | | | | | | | | | | | | Now that unused functions have been removed, the global "arch" is only used in very few places. We can pack "arch" in the "param" structure and pass it down to where it is actually used. Change-Id: I255d1e2bc6b5ead91b6b4e94a0202523c4ab53dc Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5105 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
* cbfstool: Remove more unused functions from common.cAlexandru Gagniuc2014-02-043-604/+1
| | | | | | | | | | | | | | A lot of the early functions have been re-implemented in a context- centric mode, rather than relying on global variables. Removing these has the nice side-effect of allowing us to remove more global variables. Change-Id: Iee716ef38729705432dd10d12758c886d38701a8 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5104 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
* cbfstool: Hide cbfstool_offset from the global namespaceAlexandru Gagniuc2014-02-042-12/+11
| | | | | | | | | | | | | This is part of a larger effort to reduce global variable usage in cbfstool. cbfstool_offset is particularly easy to hide since it's only used in common.c . Change-Id: Ic45349b5148d4407f31e12682ea0ad4b68136711 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5102 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
* cbfstool: remove unused function create_cbfs_image()Alexandru Gagniuc2014-02-032-123/+0
| | | | | | | | | | | It's not used anymore. Instead, we have the better replacements cbfs_image_create() and cbfs_image_from_file(). Change-Id: I7835f339805f6b41527fe3550028b29f79e35d13 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5103 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
* cbfstool: add code to serialize the header using the new xdr functionsRonald G. Minnich2014-02-022-13/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds a header serialization function. Programmers can thus just set up a header as needed, without worrying about forgetting if and how to use the [hn]to[hn]* functions. In the long term, we will work to remove swab.h, i.e. we need to get to the point where programmers don't have to try to remember [hn]to[nh]* and where it goes. To date, even the best programmers we have have made an error with those functions, and those errors have persisted for 6 or 7 years now. It's very easy to make that mistake. BUG=None TEST=Build a peppy image and verify that it's bit for bit the same. All chromebooks use this code and build and boot correctly. BRANCH=None Change-Id: I0f9b8e7cac5f52d0ea330ba948650fa0803aa0d5 Signed-off-by: Ronald G. Minnich <rminnich@google.com> Reviewed-on: https://chromium-review.googlesource.com/181552 Reviewed-by: Ronald Minnich <rminnich@chromium.org> Commit-Queue: Ronald Minnich <rminnich@chromium.org> Tested-by: Ronald Minnich <rminnich@chromium.org> Reviewed-on: http://review.coreboot.org/5100 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
OpenPOWER on IntegriCloud