summaryrefslogtreecommitdiff
path: root/payloads
AgeCommit message (Collapse)Author
2015-11-05libpayload: Fix building dwc2 UDC driver with debug enabledPatrick Georgi
hexdump() now takes a pointer instead of an int-containing-an-address. BUG=none BRANCH=none TEST=building with USB_DEBUG works Change-Id: Idd0c43031a212c8f3b6489f533c488805d98d6a9 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 8660f6091bb124eeabe73302e8c7f1a8e46324f1 Original-Change-Id: I266efcb8b939d6da104ad05a3e79a78065c60beb Original-Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Reviewed-on: https://chromium-review.googlesource.com/308762 Original-Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Original-Tested-by: Patrick Georgi <pgeorgi@chromium.org> Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org> Original-Reviewed-by: yunzhi li <lyz@rock-chips.com> Reviewed-on: http://review.coreboot.org/12258 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-11-05libpayload: Allow non-default CBFS mediaPatrick Georgi
CBFS requests were always fulfilled using the CBFS specified in cbtables. That's a great policy when default requests are sought, but not so great when the user deliberately asked for something else. So check if they want default CBFS media information, otherwise ignore cbtables data. BUG=chromium:445938 BRANCH=none TEST=none Change-Id: I01b63049eebfba6f467808ac84ef77385840c204 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 621c916ab14c0de4bae3dde09c05060c4f3c63c5 Original-Change-Id: Ia4a8848fd7db9d9a2bf9f5c226566fe3936ff543 Original-Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Reviewed-on: https://chromium-review.googlesource.com/308520 Original-Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Original-Tested-by: Patrick Georgi <pgeorgi@chromium.org> Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/12232 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-10-31tree: drop last paragraph of GPL copyright headerPatrick Georgi
It encourages users from writing to the FSF without giving an address. Linux also prefers to drop that and their checkpatch.pl (that we imported) looks out for that. This is the result of util/scripts/no-fsf-addresses.sh with no further editing. Change-Id: Ie96faea295fe001911d77dbc51e9a6789558fbd6 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11888 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2015-10-29libpayload: usbmsc: Add small delay during initialization to fix CZ60Julius Werner
We found that some SanDisk Cruizer Glide CZ60 sticks (confirmed on 16GB and 64GB versions) have a problem responding to our first GET_MAX_LUNS request right after they received their SET_CONFIGURATION. They will continually return a NAK until the host gives up (which is 2 user-noticable seconds for us). Adding a small delay of about 15us seems to be enough to fix the issue, but let's do 50 to be save. Confirmed with both MT8173 and Intel LynxPoint XHCI controllers. BRANCH=None BUG=chrome-os-partner:45473 TEST=No notable delay before detecting stick on Oak and Falco. Change-Id: Ib03944d6484de0ccecbb9922d22666f54c9d53dd Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 589f19a901275fb8b00de4595763a7d577bed524 Original-Change-Id: I95c79fe40d3ad79f37ce2eb586836e5de55be454 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/308980 Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/12229 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-10-29libpayload: Fix building dwc2 UDC driverPatrick Georgi
Change Ie54699162 changed a structure's name and field names and we didn't notice. Adapt. BUG=none BRANCH=none TEST=building with UDC_DWC2 works Change-Id: I592ebc29b2a08a23e6dbc9d2186807cbbbbca330 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 3dda8ad5ffc36593d8b8fd6664a7f9b4816f0f93 Original-Change-Id: I4a065de0f4045a01bef1dc9fbb2e0578b5508518 Original-Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Reviewed-on: https://chromium-review.googlesource.com/308791 Original-Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Original-Tested-by: Patrick Georgi <pgeorgi@chromium.org> Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: http://review.coreboot.org/12228 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com>
2015-10-28cbfs: read cbfs offset and size from sysinfoDaisuke Nojiri
This change allows libpayload to read cbfs offset and size from sysinfo. Legacy way of locating cbfs reagion is still supported in case sysinfo doesn't store the offset and the size. BUG=none BRANCH=master TEST=tested on samus and smaug Change-Id: I86434fd249467e7c90d59d6b82f0e6c514bc2d05 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 548a74b7a0758c3f9ba6809425d0fb9c6a5e9d7c Original-Change-Id: I190d5545a65228483204bf1aa1cbf5a80db31ae0 Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/296993 Original-Commit-Ready: Daisuke Nojiri <dnojiri@google.com> Original-Tested-by: Daisuke Nojiri <dnojiri@google.com> Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11557 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-10-28cbgfx: Fix spelling of calculate_position()Jason A. Donenfeld
Change-Id: Ib0dc14b197091450596ad01a924539b0e69acd68 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-on: http://review.coreboot.org/12216 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com>
2015-10-27libpayload/libcbgfx: Add license headersPatrick Georgi
Change-Id: I09a9d9eef9d8fe45cdd4d68d29b8d662fe5956e1 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/12164 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-10-27cbgfx: remove load_bitmapDaisuke Nojiri
load_bitmap is no longer needed. BUG=none BRANCH=master TEST=Tested on Samus CQ-DEPEND=CL:305589 Change-Id: I4e598ade20a5d49850f9ad0f13681ea5d16cd8c7 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Commit-Id: 125bbc98195cbb8378ba0e4c7fece85ffca4cdfa Original-Change-Id: I64d685f7a6367b03455ae2a206b9936613614a24 Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/305517 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11930 Tested-by: build bot (Jenkins)
2015-10-27cbgfx: add get_image_dimensionDaisuke Nojiri
get_image_dimension returns the width or height of the image projected on canvas. This is necessary for example when two images of different lengths have to be placed side by side in the center of the canvas and the widths of the images must be adjusted according to the height. BUG=chromium:502066 BRANCH=tot TEST=Tested on Samus Change-Id: I119c83891f48046e888b6b526e63348e74f8b77c Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Commit-Id: d1a97f0492eb02f906feb5b879b7b43518dfa4d7 Original-Change-Id: Ie13f7994d639ea1556f73690b6b6b413ae64223c Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/304113 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11929 Tested-by: build bot (Jenkins)
2015-10-27cbgfx: make the code more descriptiveDaisuke Nojiri
This change makes the code in graphics.c more descriptive and readable. Especially, it makes expressions for scale calculation look what they are meant to do. It also includes: - Rename variables (struct fraction, dim_org, etc.) for more consistency - Add more input validation (div-by-zero, etc.) BUG=chromium:502066 BRANCH=master TEST=Tested on Samus CQ-DEPEND=CL:304860 Change-Id: I2694912bb7b6017d5655de2fd655b95432addb22 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Commit-Id: 0863dc3ee925d3a05c83c66397b19a57f5478ef3 Original-Change-Id: Id8e349b8e09082fb84c3e1a984617f916e16c518 Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/304861 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11928 Tested-by: build bot (Jenkins)
2015-10-27cbgfx: add pivot option to draw_bitmapDaisuke Nojiri
This change adds 'pivot' option to draw_bitmap. It controls the point of the image based on which the image is positioned. For example, if a pivot is set to the center of the image horizontally and vertically, the image is positioned using pos_rel as the center of the image. This feature is necessary, for example, to place a text image in the center of the screen because each image has a different width depending on the language. This change also makes draw_bitmap accept both horizontal and vertical size. If either of them is zero, the other non-zero value is used to derive the size to keep the aspect ratio. Specifying the height is necessary to keep font sizes the same when drawing text images of different lengths. draw_bitmap_direct is a variant of draw_bitmap and it draws an image using a native coordinate and the original size (as opposed to the location and the size relative to the canvas). CL:303074 has real use cases. BUG=none BRANCH=tot TEST=Tested on Samus Change-Id: I5fde69fcb5cc9dc53e827dd9fcf001a0a32748d4 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Commit-Id: 82a0a8b60808410652552ed3a888937724111584 Original-Change-Id: I0b0d9113ebecf14e8c70de7a3562b215f69f2d4c Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/302855 Reviewed-on: http://review.coreboot.org/11927 Tested-by: build bot (Jenkins)
2015-10-27cbgfx: use bilinear interpolation to scale bitmapDaisuke Nojiri
This change replaces the current scaling algorithm (nearest neighbor) used for bitmap rendering with the bilinear interpolation, which has much better reproduction. BUG=none BRANCH=tot TEST=Tested on Samus Change-Id: I02520883debb7db40ffc19d4480244e0acabc818 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Commit-Id: 764b383c1763a022728f2b2d9fb90e27c9e32e94 Original-Change-Id: I0ddd184343428904d04d8a76fe18a885529c7d3d Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/302195 Original-Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: http://review.coreboot.org/11926 Tested-by: build bot (Jenkins)
2015-10-27cbgfx: add load_bitmapDaisuke Nojiri
This change adds load_bitmap API, which loads a bitmap file from cbfs and returns a pointer to the image data. BUG=none BRANCH=tot TEST=Tested on Samus Change-Id: I7d7874f6f68c414dc877a012ad96c393e42dc35e Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Commit-Id: 9d33e713a0cf6bd1365418dad989e47e86db01e4 Original-Change-Id: Idbf9682c2fa9df3f0bd296ca47edd02cd09cfd01 Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/302194 Original-Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: http://review.coreboot.org/11925 Tested-by: build bot (Jenkins)
2015-10-27cbgfx: add clear_screenDaisuke Nojiri
clear_screen clears the screen with the specified color. BUG=none BRANCH=tot TEST=Tested on Samus Change-Id: I45e61c67485dbdbe15e2b602718232bc6382ad00 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Commit-Id: 1ab04e2cc8d3c3e36e4eb41d9e7b0fdc25595200 Original-Change-Id: I1b3890b9e8ca52e796f417b5f41d4fa02a97a255 Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/301451 Original-Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: http://review.coreboot.org/11924 Tested-by: build bot (Jenkins)
2015-10-27cbgfx: allow draw_bitmap to render outside canvasDaisuke Nojiri
This change allows draw_bitmap to draw an image outside the canvas with the original size if the scale parameter is zero. This is used for example when drawing a splash screen which has to be positioned at a pixel perfect location. BUG=none BRANCH=master TEST=Draw pictures and boxes on Samus and Ryu Change-Id: Ia2d8799184d1aa192e2c50850e248bee8f234006 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Commit-Id: 45d4717fe5c3e3554bd79b63ade490d88cf00bbe Original-Change-Id: I48aa21122cfc2ee43bcb1b8f87b00c66abdc230e Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/295961 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11923 Tested-by: build bot (Jenkins)
2015-10-27cbgfx: add draw_bitmapDaisuke Nojiri
draw_bitmap renders a bitmap image on screen with position and sizes scaled relative to the screen. images are scaled up or down by nearest neighbor interpolation. BUG=chrome-os-partner:43444 BRANCH=tot TEST=drew bitmap images on Samus Change-Id: Ib599acc85b25626a6aed1fa9884ecd8e169bb860 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: c910c9cdb7efc53aace067bd081aeefc07556811 Original-Reviewed-on: https://chromium-review.googlesource.com/290302 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Original-Change-Id: Ib599acc85b25626a6aed1fa9884ecd8e169bb860 Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/295532 Reviewed-on: http://review.coreboot.org/11584 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-10-27cbgfx: coreboot graphics libraryDaisuke Nojiri
This change introduces cbgfx, a graphics library, which provides APIs for drawing basic shapes, texts, graphic data, etc. on a screen. BUG=chrome-os-partner:43444 BRANCH=tot TEST=Drew boxes by draw command of depthcharge cli on Samus Change-Id: I6019e5998e65dca3ab4785a90669b5db02463d2e Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Original-Commit-Id: 5b3ebce8eae91be742e4f977d3407d24e1537580 Original-Reviewed-on: https://chromium-review.googlesource.com/290301 Original-Reviewed-by: Stefan Reinauer <reinauer@google.com> Original-Change-Id: I10db27715cb907bdc451a33ed99d257e3af241b7 Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/291065 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11408 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-10-27libpayload: usb: Retry get_descriptor() on failureShawn Nematbakhsh
Certain Lexar USB disks may fail during the first calls to get_descriptor(..., DT_CFG, ...) for unknown reasons. Therefore, make several attempts before giving up. BUG=chromium:466758 TEST=Manual on Samus. Go to recovery mode, verify that Lexar LJDS70 USB stick is bootable. BRANCH=None Change-Id: I476ac22f9c4f844c60ebc6e53af8c144d70bb9d4 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 93a0570b343479dd22506ad4d7961f0ea4251f8c Original-Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Original-Change-Id: Ie581c7c71c53816065c7f59202581888a79e445e Original-Reviewed-on: https://chromium-review.googlesource.com/302403 Original-Commit-Ready: Shawn N <shawnn@chromium.org> Original-Tested-by: Shawn N <shawnn@chromium.org> Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: http://review.coreboot.org/12133 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-10-20libpayload: Add ptrdiff_t typedefPatrick Georgi
vboot2 in payloads (eg depthcharge) needs it. Change-Id: I4e79ae29cc282c8680f21686befd35c4ff461b3a Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: http://review.coreboot.org/11922 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
2015-10-17coreinfo: reboot when finishedMaxime de Roucy
Behave as nvramcui. Avoid a "General Protection Fault Exception" when launched by SeaBIOS on pcengines APU1. Change-Id: I00b1f859f76e693e8d49a38c1e02f4f49add85b7 Signed-off-by: Maxime de Roucy <maxime.deroucy@gmail.com> Reviewed-on: http://review.coreboot.org/11731 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-10-17libpayload/Kconfig: Use official spelling for TinyCursesPaul Menzel
TinyCursess is officially spelled in CamelCase [1]. [1] https://github.com/tommyettinger/TinyCurses Change-Id: I7e0aa5af54140796a981c0f4c58950b25fdd67ba Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: http://review.coreboot.org/11727 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-10-17libpayload/configs: Add default configuration with TinyCurses enabledPaul Menzel
Change-Id: Ib057e2b5f15b8d5bcdf45666f8761614317d25ee Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: http://review.coreboot.org/11726 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-10-11libpayload: Add data structures for hashes in file attributesPatrick Georgi
Taken from cbfstool. Change-Id: I4387900517dbfb1aa51ae6f679e26d0cf5b2acf8 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: http://review.coreboot.org/11808 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-10-05libpayload: Check for CBFS_DEFAULT_MEDIA in cbfs_get_file_content()Nico Huber
The error-prone interface of cbfs_get_file_content() led to another possible NULL dereferencing. So check for CBFS_DEFAULT_MEDIA here like the other functions do. Change-Id: Ib8732160d389e9ecceb44f28be0e7de9a1d66e04 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/11796 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-10-02libpayload: Fix possible NULL deref in cbfs_get_file_content()Nico Huber
Change-Id: I2e10ccac3248717d90838ca721cc691de792b507 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/11780 Tested-by: build bot (Jenkins) Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2015-09-28arm64: mmu: Prevent CPU prefetch instructions from device memoryJimmy Huang
Set XN bit of block upper attribute to device memory in mmu. CPU may speculatively prefetch instructions from device memory, but the IO subsystem of some implementation may not support this operation. Set this attribute to device memory mmu entries can prevent CPU from prefetching device memory. BRANCH=none BUG=none TEST=build and booted to kernel on oak-rev3 with dcm enabled. Change-Id: I52ac7d7c84220624aaf6a48d64b9110d7afeb293 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 7b01a4157cb046a5e75ea7625060a602e7a63c3c Original-Change-Id: Id535e990a23b6c89123b5a4e64d7ed21eebed607 Original-Signed-off-by: Jimmy Huang <jimmy.huang@mediatek.com> Original-Reviewed-on: https://chromium-review.googlesource.com/302301 Original-Commit-Ready: Yidi Lin <yidi.lin@mediatek.com> Original-Tested-by: Yidi Lin <yidi.lin@mediatek.com> Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: http://review.coreboot.org/11722 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-28cbfs: fix debug messageDaisuke Nojiri
BUG=none BRANCH=tot TEST=built for Samus with debugging enabled Change-Id: I0b555d018f8c2eb1b51519a6227298c8d5d58a42 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 5908e4b8ffc66e6ecc7cae78cf10055fbd727c81 Original-Change-Id: Ifd049111fee540789dabb1d7653568b80405b77d Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/302131 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11713 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-17libpayload: provide cbfs_file_find_attr()Patrick Georgi
cbfs_file_find_attr(file, tag) finds the first attribute of file with the given tag. Change-Id: I78ee3b996b4b086605244c5d7d57ef7e3fc1db47 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11678 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
2015-09-17libpayload: allow compression at file header levelDaisuke Nojiri
Decompression is handled transparently within cbfs_get_file_content: const char *name = "foo.bmp"; void *dst = cbfs_get_file_content(media, name, type, NULL); To keep things consistent, a couple of API changes were necessary: - cbfs_get_file_content always returns a copy of the data, even for uncompressed files. It's the callers responsibility to free the memory. - same for cbfs_load_payload and cbfs_find_file. - cbfs_load_optionrom doesn't take a "dest" argument anymore but always returns a copy of the data, for compressed and uncompressed files. Like with cbfs_get_file_content, the caller is responsible to free it. It also decompresses based on extended file attributes instead of the cbfs_optionrom subheader that libpayload specified but that (AFAIK) nobody ever used, given that there's not even tooling for that. Change-Id: If959e3dff9b93c6ae45ec7358afcc7840bc17218 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10938 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
2015-09-17libpayload: rename cbfs variable from name to vardataDaisuke Nojiri
The dynamically sized region after struct cbfs_file doesn't contain only the file name anymore. Change-Id: I3241cb2f0cbec3fcf4d3c27d638e2847e43f4761 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11676 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-17libpayload: bring in file attribute support from cbfstoolPatrick Georgi
This comes from cbfstool (GPL) into libpayload (BSD-l), but I could have just as well written it in libpayload first. Change-Id: I86baefe5c299125a4733fa20523efd5d06de7182 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11675 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-09-17libpayload: usb: dwc2: check device connect state before enable channelYunzhi Li
If the device has already been disconnected then we shouldn't enable host channel to start any transfer, otherwise this channel goes into an odd state the channel is enabled but can not be disabled by set hcchar.chdis=1. So we need check the device connect status before enable channel. BRANCH=None BUG=chrome-os-partner:44534 TEST=None Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: ae3e690b2cd4a9ea8b5766ac873b0e00bf3a23de Original-Change-Id: Ib3ecf486649ca11b302144f9c00a5e88424e90fa Original-Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Original-Reviewed-on: https://chromium-review.googlesource.com/298402 Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Original-Commit-Queue: Lin Huang <hl@rock-chips.com> Original-Tested-by: Lin Huang <hl@rock-chips.com> Original-(cherry picked from commit ea96f947b5304fdde2e0991d23febaeba209dde1) Original-Reviewed-on: https://chromium-review.googlesource.com/299398 Original-Commit-Ready: David Hendricks <dhendrix@chromium.org> Original-Tested-by: David Hendricks <dhendrix@chromium.org> Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> Change-Id: Idf48ffbc4c2794900e09dec6b2e34e33b21f87b4 Reviewed-on: http://review.coreboot.org/11662 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-17libpayload: usb: dwc2: fix hub hot-plug bugYunzhi Li
When disconnect is detected in dwc2_split_transfer() the split configuration registers should be cleared before return. BRANCH=None BUG=chrome-os-partner:44534 TEST=On Jerry, usb hot plug works with devices behind hubs Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 37594d8b4490b6d393d19d17d8e497db7de8817d Original-Change-Id: Ie1eecec067305874513c6ceb95df4240dc393cd6 Original-Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Original-Reviewed-on: https://chromium-review.googlesource.com/295625 Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Original-Commit-Queue: Lin Huang <hl@rock-chips.com> Original-Tested-by: Lin Huang <hl@rock-chips.com> Original-(cherry picked from commit d543e14cdc73bd549dd553c8d1d07672a1307981) Original-Reviewed-on: https://chromium-review.googlesource.com/299700 Original-Commit-Ready: David Hendricks <dhendrix@chromium.org> Original-Tested-by: David Hendricks <dhendrix@chromium.org> Change-Id: Ib4604097743f2f9d763b29ee27f3bc1788a85a62 Reviewed-on: http://review.coreboot.org/11661 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-10libpayload: Revive ffs()Nico Huber
Revive ffs() in a more fancy way (that is more likely to be accepted). We dropped it in 7a8a4ab lib: Unify log2() and related functions but there is at least one user: flashrom. Change-Id: I4e3fc15816b778e640bceea0d89cd9624d271c2e Signed-off-by: Nico Huber <nico.huber@secunet.com> Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: http://review.coreboot.org/11591 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-09-10libpayload: Fix merge of PL011 UART supportNico Huber
Wished I hadn't seen that. Git saw the conflict (file was gone), both committer and reviewer thought it would be a good idea to re-add it as dead code (see 558e9b5: libpayload: Add minimal support for PL011 UART). Change-Id: Ifea8113fbc59e0463eaedb86b976f54ec11113a9 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/11604 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-09-10libpayload: Add missing autoconf dependencyNico Huber
With new version of kconfig we have to trigger [silent]oldconfig each time .config changed. We missed that, because config.h had no dependen- cies. Change-Id: I9f0dd8adbc3aa434a18cb4815b1ccbd1f6e7847b Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/11603 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-09-08video_printf: align textDaisuke Nojiri
This change allows video_printf to left/center/right-align text depending on the enum value provided by the caller. This is useful especially because usually the length of formatted string is unknown before calling video_printf. BUG=none BRANCH=smaug TEST=drew fastboot screens on Smaug CQ-DEPEND=CL:296460 Reviewed-on: https://chromium-review.googlesource.com/292929 Reviewed-by: Aaron Durbin <adurbin@chromium.org> (cherry picked from commit 436f05f60c1b88626740a35913e3ad37b5c777a3) Change-Id: If1d50b7d8ddaa86eddc1618946756184cb87bfe1 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/295413 Reviewed-on: http://review.coreboot.org/11583 Tested-by: build bot (Jenkins)
2015-09-08video: add video_printfDaisuke Nojiri
video_printf prints strings on the screen with specified foreground and background color. BUG=none BRANCH=smaug TEST=verified messages printed on Smaug Change-Id: I619625f7d4c5bc19cd9de64a0ba07899cf9ba289 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Original-Commit-Id: e0ac4cb4c0d43b40f5c8f8f5a90eac45b0263b77 Original-Reviewed-on: https://chromium-review.googlesource.com/290130 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Original-(cherry picked from commit 75ea2c025d629c8fabc0cb859c4e8ab8ba6ce6e3) Original-Change-Id: Ief6d1fc820330b54f37ad9260cf3119853460b70 Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/290373 Reviewed-on: http://review.coreboot.org/11407 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-09-07Drop "See file CREDITS..." commentStefan Reinauer
coreboot has no CREDITS file. Change-Id: Iaa4686979ba1385b00ad1dbb6ea91e58f5014384 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/11514 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-05SeaBIOS: update stable release from 1.7.5 to 1.8.2Alexander Couzens
Several USB timing fixes for USB controllers on real hardware Initial support for USB3 hubs Initial support for SD cards (on QEMU only) Initial support for transitioning to 32bit mode using SMIs (on QEMU TCG only) SeaVGABIOS improvements: Added cursor emulation to coreboot native init vgabios (cbvga) Added support for read character calls when in graphics mode Change-Id: Ic99f11dea4c87dbf3e9de4ce7f14064d0a083101 Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Reviewed-on: http://review.coreboot.org/11479 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-08-30Kconfig: Remove EXPERT modeAlexandru Gagniuc
After much consideration, and many years of an EXPERT mode sitting almost completely unused, we've seen that it doesn't work for us. There is no standard on what constitutes EXPERT, and most of coreboot's options Kconfig are expert-level. We even joked that not selecting "EXPERT" should prevent coreboot from compiling: @echo $(shell whoami) is not permitted to compile coreboot Change-Id: Ic22dd54a48190b81d711625efb6b9f3078f41778 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/11365 Tested-by: build bot (Jenkins) Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
2015-08-28libpayload: x86: Add read/write{8,16,32} variants that match corebootDuncan Laurie
Add the now coreboot standard MMIO read/write accessors that were already defined for other architectures but not x86. This leaves the old read/write{b,w,l} variants in place as was done on the other architectures, presumably to support old payloads that have not been updated. BUG=chrome-os-partner:43072 BRANCH=none TEST=emerge-glados libpayload CQ-DEPEND=CL:294711 Change-Id: I5ae3d755adcef0f6ff27aaa7c35a5b12ddc32e22 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Original-Commit-Id: c09dd557050e3002fa5b8504980d72d4cb79a56c Original-Change-Id: I58d928338335d3fe4bb7fe2bdc9c2967d8689118 Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/294565 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11405 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
2015-08-28libpayload: usb: dwc2: Always return 'size' transferred bytes for OUTJulius Werner
Seems like our transferred bytes calculation for OUT transfers that span more than one packet had been wrong, and we just got lucky that we never noticed it before. The HCTSIZ.xfersize register field we're reading only counts bytes transferred by the last packet we sent. OUT endpoints cannot have short transfers -- every transfer should either finish all bytes we wanted to send or end in a proper error condition. Therefore, in the absence of an error we can just conclude that all input bytes have been transferred. BRANCH=veyron BUG=chrome-os-partner:35525 TEST=SMSC95xx netboot on Jerry now works. Change-Id: I57349e697c428df6b56e2f6f62e87652ef1e7a94 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Original-Commit-Id: 0abee13b6d89dec12c6fff581ece1836393c7703 Original-Change-Id: Id0a127e6919f5786ba05218277705dda1067b8c3 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/293956 Original-Reviewed-by: yunzhi li <lyz@rock-chips.com> Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/11404 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-28arm64: xcompile: Add support for A53 erratum 843419Julius Werner
This patch adds support to enable a linker workaround to a hardware erratum on some early Cortex-A53 revisions. Since the linker option was added very recently, we use xcompile to test whether the toolchain supports it first. It is also guarded by a Kconfig since only a few ARM64 SoCs will need this and it incurs a performance penalty. BRANCH=none BUG=none TEST=Turned it on or off for Smaug and confirmed that it (dis)appeared in verbose make output accordingly. Change-Id: I01c9642d3cf489134645f0db6f79f1c788ddb00d Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Original-Commit-Id: 57128785760c4dfa32d6e6d764756443a9323cb7 Original-Change-Id: Ia5dd124f484e38460d75fb864304e7e8b18d16b7 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/294745 Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11403 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
2015-08-19libpayload: Fix default_memmove() implementationNico Huber
If I wanted to fill the whole memory address space with one byte, I wouldn't try it that subtle. With size_t beeing unsigned the loop condition >= 0 was always true. Change-Id: Idee6a4901f6697093c88bda354b5e43066c0d948 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/11286 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
2015-08-19Store the payload config and revision in CBFSMartin Roth
Store the payload config and version files in CBFS if using a SeaBIOS or filo payload if INCLUDE_CONFIG_FILE is enabled. Change-Id: I0c1b4da8f6179b9cee06cecfa76bc631b43196e0 Signed-off-by: Martin Roth <gaumless@gmail.com> Reviewed-on: http://review.coreboot.org/10607 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins)
2015-08-19libpayload: usb: dwc2: fix usb plug/unplug bugYunzhi Li
Check device connect status while waiting for usb transfer complete Avoid coreboot get stuck when usb device unplugged BUG=chrome-os-partner:35525 TEST=None BRANCH=None Original-Change-Id: Id103501aa0d8b31b0b81bef773679c0fad79f689 Original-Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Original-Reviewed-on: https://chromium-review.googlesource.com/292630 Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Original-Commit-Queue: Lin Huang <hl@rock-chips.com> Original-Tested-by: Lin Huang <hl@rock-chips.com> Original-Reviewed-on: https://chromium-review.googlesource.com/292966 Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> Original-Tested-by: David Hendricks <dhendrix@chromium.org> Original-Commit-Queue: David Hendricks <dhendrix@chromium.org> Change-Id: I49396b74131dbfda505d9d3de5adbdc87eb92ce1 Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Reviewed-on: http://review.coreboot.org/11236 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-15seabios integration: deal with ccache woes some morePatrick Georgi
seabios integration interprets the CC variable with a special case when ccache is prepended to the compiler. Since the integration also tries to extract compiler flags (which I'm not sure we still add to CC _ever_), that also needs to look at only the part of the string that contains compiler and (maybe) flags, so skip the first word if it was determined to be the path to the ccache binary. Change-Id: I717863f456bf4fd6f08427d86633079ecda039df Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/11227 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-14libpayload: usb: xhci: Fix list of cleared port change bitsJulius Werner
The xhci_rh_port_status_changed() function tries to always clear all port status bits, even though most of them don't interest us. This is generally a smart thing to do since not clearing a status bit may cause the controller to not generate any more Port Status Change Events. However, the bitmask we currently use doesn't cover bit 23 (Port Config Error Change) and instead covers bit 16 (Port Link State Write Strobe) which is not really related to this and not a W1C bit. Probably a typo, so let's fix that. BRANCH=None BUG=None TEST=Plugged/unplugged a bunch of USB devices on an XHCI Falco. Original-Change-Id: Ia83f5b72cce094859c0f0e730752d7b5cfa6e1c6 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/291842 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Change-Id: I11f5fe38cb70055daf6e866a8ee84ca80488e3bf Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: http://review.coreboot.org/11194 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-14libpayload: Do not gate USB_DWC2 on USB_HIDDavid Hendricks
This forward-ports the change from CL:277155 since the Kconfig file was renamed from Config.in. BUG=chrome-os-partner:41416 BRANCH=none TEST=built and booted on Mickey, keyboard works at dev screen Original-Signed-off-by: David Hendricks <dhendrix@chromium.org> Original-Change-Id: Ibffa5188df51ecd7b8bdd631d4b767ec64130819 Original-Reviewed-on: https://chromium-review.googlesource.com/291138 Original-Commit-Ready: David Hendricks <dhendrix@chromium.org> Original-Tested-by: David Hendricks <dhendrix@chromium.org> Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Change-Id: Iebb1da6ec8c7886a6eb9ebcc67b59d617496c555 Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/11188 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks <dhendrix@google.com>
2015-08-14libpayload: usb: xhci: Count new Max Scratchpad Bufs bits from XHCI 1.1Julius Werner
The 1.1 revision of the XHCI specification added an extra 5 bits to the Max Scratchpad Bufs field of HCSPARAMS2 that newer controllers make use of. Not honoring these bits means we're not allocating as many scratchpad buffers as the controller expects, which means it will interpret some uninitialized values from the end of the pointer array as scratchpad buffer pointers, which obviously doesn't end well. Let's fix that. BRANCH=none BUG=chrome-os-partner:42279 TEST=Makes a USB-related memory corruption issue disappear. Original-Change-Id: I7c907492339262bda31cdd2b5c0b588de7df8544 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/291681 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Change-Id: Iba1007bfebffe1f564f78bb875fff9ba0fe11a38 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: http://review.coreboot.org/11189 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-14libpayload: usb: dwc2: fix short packet transferYunzhi Li
If short packet detected, stop this transfer and return the actual transferred size BUG=chrome-os-partner:42817 TEST=Netboot could run well BRANCH=None Original-Change-Id: Icb4317f48aa04ac15bb1886b81d2e3c472d123d0 Original-Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Original-Reviewed-on: https://chromium-review.googlesource.com/288215 Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Original-Commit-Queue: Lin Huang <hl@rock-chips.com> Original-Tested-by: Lin Huang <hl@rock-chips.com> Original-(cherry picked from commit d372343b4e3d664ce2d76dbf55a5061b5d496bba) Original-Reviewed-on: https://chromium-review.googlesource.com/291064 Original-Commit-Queue: Julius Werner <jwerner@chromium.org> Original-Tested-by: Julius Werner <jwerner@chromium.org> Change-Id: I43d9edffe2074c037f2df203621863e54d2597fa Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Reviewed-on: http://review.coreboot.org/11187 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-14libpayload: usb: Fixup wrong use of configChunfeng Yun
replace CONFIG_LP_XHCI_MTK_QUIRK by CONFIG_LP_USB_XHCI_MTK_QUIRK BRANCH=none BUG=none TEST=Rev0-oak Original-Change-Id: I68f58ed3b02caa7cef8f0f60a4a8f5e9755c97a7 Original-Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Original-Reviewed-on: https://chromium-review.googlesource.com/290522 Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Original-Commit-Queue: Yidi Lin <yidi.lin@mediatek.com> Original-Tested-by: Yidi Lin <yidi.lin@mediatek.com> Change-Id: I316712e99e0b44d292dab27cf66e26837dc2e957 Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Reviewed-on: http://review.coreboot.org/11179 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-14libpayload: xhci: Carry over fixes from Chromium treeJulius Werner
This patch re-adds a few fixes that originally went into the chromeos-2013.04 tree. I kinda seem to have slipped them into the backport of Nico's original XHCI patch (crosreview.com/168097) instead of making a new change, which was not very clever and caused them to be forgotten in the later upstreaming wave. Changing internal XHCI error numbers is just a cosmetic change to make them uniquely identifyable in debug output. Bumping the timeout to 3 seconds is an actually important fix since we have seen mass storage devices needing that much in the past. BRANCH=None BUG=None TEST=Diffed payloads/libpayload/drivers/usb between chromeos-2013.04 and chromeos-2015.07, confirmed that no serious differences remain. Original-Change-Id: I03d865dbe536072d23374a49a0136e9f28568f8e Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/290423 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Change-Id: I5d773d3a23683fb2164916cc046f4a711b8d259e Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: http://review.coreboot.org/11178 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-14cbfs: fix printf for 64bit architecturesDaisuke Nojiri
BUG=none BRANCH=smaug TEST=Built for Smaug Original-Change-Id: I7ff577f97252265ca6c96963ca44a6fbd0de9f7a Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/290049 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Original-(cherry picked from commit 9cff308653766ea81978214e99a3d740aff4dbbe) Original-Reviewed-on: https://chromium-review.googlesource.com/290116 Original-Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Change-Id: I5dcc17e0a42b46350fe6c398767f8155bdd0fd9d Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: http://review.coreboot.org/11177 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-13libpayload: usb: don't prematurely free the usb deviceAaron Durbin
Before the controller's destroy_device() could interrogate the usbdev_t object usb_detach_device() was freeing and NULLing out the pointer. That results in all callers who needed that object to start accessing random bits of memory. This eventually led into free()ing memory it shouldn't which corrupted the allocator's state. Eventually, all forward progress was lost by way of a single ended linked list turning into a circular list. The culprit seems to be a bad merge in commit e00ba21. BUG=chrome-os-partner:43419 BRANCH=None TEST=Can boot into OS now w/o "hanging" on glados. Original-Change-Id: I86dcaa1dbaf112ac6782e90dad40f0932f273a1f Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/290048 Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Change-Id: I9135eb0f798bf7dbeccc7a033c3f8471720a0de5 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11173 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-10libpayload: Kconfig include in lpgccPaul Kocialkowski
Payloads will include headers from libpayload, which depend on kconfig.h, so it has to be included in the command line produced by lpgcc. Change-Id: I3b55928babba2896a112f8c5fae46365cf71d308 Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: http://review.coreboot.org/11114 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-10seabios integration: fix interaction with ccachePatrick Georgi
SeaBIOS' build system doesn't like CC to be a compound command like "ccache gcc", so we strip things. Unfortunately with CCACHE enabled, we passed /usr/bin/ccache (or wherever it was found on the PATH). Instead use the second term in CCACHE mode. Change-Id: I905fcdc73d067e553e923e307fafceaacdefdc6c Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/11138 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-10libpayload: Fix compile error in time.c if nvram support is disabledPatrick Georgi
rdtsc() is only used for nvram access. Change-Id: I896116d6a5782e5e50aa3acfbe1831b080f55d34 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/11137 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-09payloads: Move payloads logic to payloads directoryStefan Reinauer
Change-Id: I6437e30da6ab675d32dc81c5d6d3fd9bcdc67f06 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10923 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-09libpayload: Use CONFIG_LP_CCACHE instead of CONFIG_CCACHEStefan Reinauer
CONFIG_CCACHE was obsoleted a long time ago for libpayload. Change-Id: Ib0a418d97f368439476e524b753160a6229bb9f6 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10710 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-09license headers: Drop FSF addresses againPatrick Georgi
Some FSF addresses found their way back into our tree. Change-Id: I34b465fc78734d818eca1d6962a1e62bf9d6e7f3 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/11145 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-09libpayload: lpgcc: CFLAGS and CMDLINE order inversionPaul Kocialkowski
When building an external payload with lpgcc, the provided cmdline needs to be included before libpayload-specific CFLAGS so that the include priority is the payload first. This way, a payload using e.g. Kconfig that declares a config.h will have its config.h included first, instead of libpayload's config.h. Change-Id: I19b8012623e04c92a427d74904aed7f3bf5f0996 Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: http://review.coreboot.org/11113 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-04libpayload: .xcompile target is an actual filePaul Kocialkowski
Marking .xcompile as PHONY implies triggering the xcompile script each time make is invoked. This is particularly problematic, especially when the script cannot find the crossgcc toolchains on its own and has to be fed XGCCPATH. Change-Id: Icb5ae82b210bca1ee9cf56d76130eefde481f81e Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: http://review.coreboot.org/11118 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-04libpayload: Veyron configs unificationPaul Kocialkowski
All the currently-provided configs for veyron boards are the same, so we might as well have a common one that can be used on all boards. Change-Id: I2e24f2d7a5206878381467b97f01d3e752a93289 Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: http://review.coreboot.org/11115 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-03libpayload: Allow for KBUILD_DEFCONFIG overridePaul Kocialkowski
In order to specify a defconfig to libpayload, one might want to declare KBUILD_DEFCONFIG in the make command line and run the defconfig target. Change-Id: I2ade6f4ff2f0b6478a0831158028ebc79b5daa81 Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: http://review.coreboot.org/11112 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-21libpayload: lz4: Add output overrun check to incompressible caseJulius Werner
The LZ4 decompressor currently doesn't check for output overruns before writing data in the case where a block had been incompressible (and included verbatim in the compression stream). This is extremely unlikely with the default 4MB blocks, but still a nice thing to fix. We'll still output as much data as we can before returning an error to support partial decompression use cases. This matches the behavior already in place for normal, LZ4-compressed blocks where the decompression function is already (supposed to be) doing complete bounds checking (although it is not guaranteed to output all valid bytes before aborting on an output overrun, and you should try to provide a few dozen bytes of extra buffer space beyond the parts you're interested in on partial decompression). BRANCH=None BUG=chrome-os-partner:32184 TEST=None Change-Id: I5e40c8cec8947ec0ec8f6d8c8fa2574cfb4dc958 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 636985334c9b3b93a12d4066d2829f1f999c9315 Original-Change-Id: Iecf44650aade60b9fa1b13e57da752fb482a3f3f Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/286240 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11016 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-07-18libpayload: usb: Add support for SuperSpeed hubsJulius Werner
This patch adds support for the SuperSpeed half of USB 3.0 hubs, which previously prevented SuperSpeed devices behind those hubs from working. BRANCH=None BUG=chrome-os-partner:39877 TEST=Played around with multiple hubs and devices on Oak and Falco, can no longer find a combination that doesn't work. Change-Id: I20815be95769e33d399b7ad91c3020687234e059 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 3db96ece20d2304e7f6f6aa333cf114037c48a3e Original-Change-Id: I2dd6c9c3607a24a7d78c308911e3d254d5f8d91d Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/284577 Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Original-Tested-by: chunfeng yun <chunfeng.yun@mediatek.com> Reviewed-on: http://review.coreboot.org/10958 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-18libpayload: usb: xhci: Prevent address reuseJulius Werner
We have been trying to avoid reassigning previously used USB addresses to different devices since CL:197420, because some devices seem to take issue with that. Unfortunately, that patch doesn't affect XHCI: those controllers insist on chosing addresses on their own. The only way to prevent them from reusing a previously assigned address is to not disable that slot at all. This patch implements address reuse avoidance on XHCI by not disabling slots when a device is detatched (which may occur both on physical detachment or if we simply couldn't find a driver for that device). Instead, we just release as many resources as we can for detached devices (by dropping all endpoint contexts) and defer the final cleanup until the point where the controller actually runs out of resources (a point that we probably don't often reach in most firmware scenarios). BRANCH=none BUG=chrome-os-partner:42181 TEST=Booted an Oak plugged into a Servo without having a driver for the SMSC network chip, observed that it could still enumerate the next device afterwards. Kept unplugging/replugging stuff until the cleanup triggered and made sure the controller still worked after that. Also played around a bit on a Falco without issues. Change-Id: Idfbab39abbc5bc5eff822bedf9c8d5bd4cad8cd2 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 88c6bcbc41156729c3c38937c8a4adebc66f1ccb Original-Change-Id: I0653a4f6a02c02498210a70ffdda9d986592813b Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/284175 Original-Tested-by: Nicolas Boichat <drinkcat@chromium.org> Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10957 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-16libpayload: usb: dwc2: support split transactionYunzhi Li
With split transaction, dwc2 host controller can handle full- and low-speed devices on hub in high-speed mode. This commit adds support for split control and interrupt transfers BUG=None TEST=Connect usb keyboard through hub, usb keyboard can work BRANCH=None Change-Id: If7a00db21c8ad4c635f39581382b877603075d1a Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 4fb514b7f7f7e414fa94bfce05420957b1c57019 Original-Change-Id: I07e64064c6182d33905ae4efb13712645de7cf93 Original-Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Original-Reviewed-on: https://chromium-review.googlesource.com/283282 Original-Tested-by: Lin Huang <hl@rock-chips.com> Original-Commit-Queue: Lin Huang <hl@rock-chips.com> Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: http://review.coreboot.org/10956 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-15libpayload: assume cbfs file alignment is 64 bytePatrick Georgi
Change-Id: I8dfd8fbd452ce92fbca2cf095bc5e43e4a26969d Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10920 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-07-14libpayload: store boot media information in sysinfoPatrick Georgi
Write boot media information in sysinfo, if it exists. This allows picking the right CBFS for further files in case there are several. Change-Id: I75a8ee6b93f349b9f2fab1e82826aba675949c0a Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10869 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
2015-07-14libpayload: Add support for handling fmapsPatrick Georgi
They will become more common soon, so better support them now. Change-Id: I2b16e1bb7707fe8410365877524ff359aeefc161 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10868 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-07-13coreinfo: Fix build output (cosmetical)Stefan Reinauer
This patch aligns the output of coreinfo with the output of libpayload, and switches from using $(Q) to .SILENT Change-Id: I6c3cdda7febc02bab9195fc98f46490c0d478a9a Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10744 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins)
2015-07-13libpayload: Fix arithmetic precedence in div_round_up()Julius Werner
Well, this is just embarrassing... BRANCH=None BUG=None TEST=None Change-Id: I7c443d2100b6861d736320ac14c1bd9965937a66 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 455e3784882ea1b76bcf8e17724869e37d9c629d Original-Change-Id: Ia33e98aeaa8e78e3e3d2c7547e673a623ea86ce2 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/284596 Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: http://review.coreboot.org/10879 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Martin Roth <gaumless@gmail.com>
2015-07-13coreinfo: fix compilationStefan Reinauer
- extra rule for config.h creation - include kconfig.h from libpayload - libpayload symbols are conflicting with gcc builtins (e.g. log2) - ALIGN() is already defined in libpayload these days - move libpayload build directory under build/ Change-Id: I2aefdde26853253d58f6cf6e186e784871c1cb5b Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10717 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-09libpayload: Have make install save .xcompile fileStefan Reinauer
Useful information, record it in the destination directory, together with .config. Change-Id: Icf3282f61f502b37f9f06d7d5a0a630f49c96ed2 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10864 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-09libpayload: Use top level xcompileStefan Reinauer
Instead of having a second copy that already within 2-3 days becamer quite outdated, use the same xcompile copy for coreboot and libpayload, as we do with Kconfig already. This requires a simple change to the top level xcompile to understand both CONFIG_COMPILER_GCC and CONFIG_LP_COMPILER_GCC (only one of them will occur at the same time) libpayload's .xcompile target was moved later so that it can make use of $(top) Change-Id: I44001067f551cd0776dd303cbaeaa40eb3d5c1db Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10863 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-09libpayload: Add LZ4 decompression algorithmJulius Werner
This patch adds support for the LZ4 decompression algorithm to libpayload. It's what all the cool kids are using for decompression these days and has many interesting advantages over LZMA (and everything else I know of): blazing fast decompression (20(!) times faster than LZMA, twice as fast as LZO on my Cortex-A72), no memory requirements on decompression, and possibly in-place decompression support. It pays for that with a lower compression ratio (about 50% larger compressed size than LZMA, 10% larger than LZO for an ARM64 Linux kernel binary), but the boot time math still works in its favor for our IO speeds. This patch only adds the raw decompression functions for use by external payloads, we can later try integrating them in CBFS. It copies the decompression code itself unmodified from the upstream LZ4 library at github.com/Cyan4973/lz4 which will hopefully make it easy to update. The frame format parsing is reimplemented since the upstream version looks unnecessarily complex and unreadable for our needs. BRANCH=smaug BUG=chrome-os-partner:32184 TEST=With other patches, booted ARM64 kernel that got compressed from 15M to 5.1M and decompresses in 44ms. Change-Id: I65bdc4b2b19bd51c7b7e17a4e4b79da301a2a014 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: f8a1fc996d5b0234d07f567fa8163d0f802d5144 Original-Change-Id: I15c0620da05561ade2552b15ffdf6bb3afd7eb26 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/282743 Original-Reviewed-by: Stefan Reinauer <reinauer@google.com> Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/10845 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-08libpayload: update defconfigsPatrick Georgi
That way they don't need an initial 'make oldconfig' pass to be useful again. Change-Id: I3724fffab24b69478b8077f34e9d787555fd157b Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10805 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-07payloads: Reorganize Makefile.incs for external payloadsStefan Reinauer
This is not going as far as I would like it to go, but some of the external payloads have to be fixed up first. Long term, I would like to directly add payloads/external/* to subdirs-y and remove one layer of indirection from the build process. For now, moving the payload Makefile targets into payloads/ is already a small improvement. Change-Id: Ie4eb492eb804e0aaaf1a4d90af2f876f27a32a75 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10829 Reviewed-by: Martin Roth <gaumless@gmail.com> Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-07payloads: Reorganize Kconfig for external payloadsStefan Reinauer
The integration of external payloads in coreboot is a bit messy. You have to change the to level Kconfig file for every payload (something that we recently fixed for mainboards and chipsets). This means that updating e.g. the SeaBIOS version requires a change outside of the SeaBIOS directory. With this patch you can create a new directory under payloads/external and place a Kconfig and Kconfig.name file in there, and the payload will automatically show up when you do "make menuconfig". Change-Id: I293abcb8eae581d4b3934e64897c0d339a27e7c1 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10828 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-06libpayload: don't overwrite CFLAGSPatrick Georgi
Makefile already sets it to contain the architecture specific flags, don't drop them, but add to that instead. Change-Id: I147e6480ab2b3c1ee4f4ace511197b4ba94280b8 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10804 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-06libpayload: architecture mapping is now done in xcompilePatrick Georgi
This helps the build system find i386 and mips compilers. Change-Id: I17d18019b556190f860d288e66f368f8d29ca24d Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10803 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-06libpayload: drop LIBGCC_FILE_NAME variablePatrick Georgi
It's unused. If we need something like that, .xcompile provides it, and in a cross-platform and clang-aware way. Change-Id: Ic1bdc2e3e252d612a5b99ad4e8caebc5158a485f Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10802 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-06libpayload: defer including .xcompilePatrick Georgi
It needs to come after DOTCONFIG so that the compiler decision can be made. Change-Id: I5c6730ac58ab8731f07bb7c5161b2d0a59588e28 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10801 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-06libpayload: Add compiler switchPatrick Georgi
clang is totally untested, but it mirrors coreboot now. Change-Id: I0e13ff8bba2007159a4a795ca07d187504b606b2 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10800 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-06libpayload: mark util/xcompile/xcompile executablePatrick Georgi
Change-Id: I97088df1550f580d4648c7cccbd81c696fcfe2dc Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10799 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-06cbfs: define libpayload_init_default_cbfs_media weaklyDaisuke Nojiri
To allow a payload to define its own libpayload_init_default_cbfs_media, default implementation needs to be defined weakly. BUG=none BRANCH=tot TEST=dumped a cbfs file from depthcharge cli on jerry Change-Id: Ice73ae5a63dfd49e79c0eeb92d4eade016d61c39 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 1f308177fffb0d525fdb50f8d024568bb9025352 Original-Change-Id: I4721139aea3169c62c10a2a26582bd9277e4cb83 Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/283061 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/10783 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-06sysinfo: remove unused tag for struct spi_flashDaisuke Nojiri
This will conflict with struct spi_flash defined in spi_flash.h BUG=none BRANCH=tot TEST=built libpayload for veyron jerry Change-Id: I7e1be28cf430021944fc96890082a0704d093e9f Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 0f0b8a7ec114046335fb1a51b6a92e10e5a16520 Original-Change-Id: I6d4f8a8e93aeb055f7dd6e5e8fd5e6c6153ab837 Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/282588 Original-Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: http://review.coreboot.org/10782 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-06update common base header filesDaisuke Nojiri
IS_ENABLED is defined in kconfig.h, thus, should be included in libpayload.h. BUG=none BRANCH=tot TEST=built coreboot/libpayload for veyron_jerry Change-Id: I9c5879b6125ac66a75a507ab07a6816ab54ed0ba Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 51dcd58a841009081fdefcadf9aa74286152dde6 Original-Change-Id: I30e6d87c9de827a214a6100449cd716e773c2ba3 Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/282587 Original-Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: http://review.coreboot.org/10781 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-06lzma: Return correct amount of decompressed bytesJulius Werner
The LZMA functions are supposed to return the decompressed size, but what they actually return is just an unaltered field from the LZMA header that is *supposed* to contain the decompressed size. Apparently some encoders just overshoot that for no good reason. This patch changes the code such that the actual amount of decompressed bytes is returned. BRANCH=smaug BUG=None TEST=Printed output bytes when decompressing kernels with LZMA in depthcharge, noted that amounts now make sense. Change-Id: Icdd8f782aa87841f770eff4c14a08973530c7446 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 24b2fa8c9a342ca4288dad1430c8965395f00263 Original-Change-Id: Ib4cf8673846aedd34656e594ce7b8ea875b56099 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/282742 Original-Reviewed-by: Stefan Reinauer <reinauer@google.com> Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10777 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-06libpayload: usb: dwc2: support interrupt transferYunzhi Li
dwc2 host core do not have a periodic schedule list, so try to send an interrupt packet in poll_intr_queue() function and use frame number read from usb core register to calculate time and schedule transfers. BUG=None TEST=Tested on RK3288 with two USB keyboards(connect to SoC without USB hub), both work correctly. BRANCH=None Change-Id: I16f7977c45a84b37c32b7c495ca78ad76be9f0ce Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 3d0206b86634bcfdbe03da3e2c8adf186470e157 Original-Change-Id: Ie54699162ef799f4d3d2a0abf850dbeb62417777 Original-Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Original-Reviewed-on: https://chromium-review.googlesource.com/280750 Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Original-Commit-Queue: Lin Huang <hl@rock-chips.com> Original-Tested-by: Lin Huang <hl@rock-chips.com> Reviewed-on: http://review.coreboot.org/10774 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-06libpayload: arm(64): add read8/16/32 and write8/16/32Daisuke Nojiri
This applys the same change made by https://chromium-review.googlesource.com/261692 to libpayload. BUG=none BRANCH=tot TEST=built for veyron_jerry, rush_ryu, samus Change-Id: I26dd66d79cd1559a7852b3c9d252420f2fed5fa0 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: d0d6f70aa805e18966e80618fbf9e9605274b030 Original-Change-Id: Ib0c199238f8fa58643d51782b17550dbd0d9ebd7 Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/282541 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/10773 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-06libpayload: udc: dwc2: support force_shutdown() routineYunzhi Li
Add force_shutdown() routine for dwc2 udc driver to support disconnect and reconnect case when fastboot receiving data. BUG=chrome-os-partner:41687 BRANCH=None TEST=None Change-Id: I9ec204d8b7088cfafd3164c9779a6fd85d379dba Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 9238f87c065ba8a57bfb4a7e65fd1821ff2922f9 Original-Change-Id: I1e584aaf19efa14409bdfa26039c27fa7034b5f0 Original-Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Original-Reviewed-on: https://chromium-review.googlesource.com/281130 Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Original-Tested-by: Lin Huang <hl@rock-chips.com> Original-Commit-Queue: Jeffy Chen <jeffy.chen@rock-chips.com> Reviewed-on: http://review.coreboot.org/10770 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-03SeaBIOS: Change clean to just 'rm -rf seabios/out'Martin Roth
When running 'make clean' if the seabios directory is present, we get warnings about not having IASL installed or that the C compiler can't be executed. It fails to actually run the clean because we're not correctly passing in the toolchain. Just do what the SeaBIOS clean does directly and delete the 'out' directory without actually calling the SeaBIOS clean. Here were the previous warnings: % make clean Unable to execute the C compiler (). Please install a working compiler and retry. Makefile:104: *** "Please upgrade the build environment". Stop. or % make clean The SeaBIOS project requires the 'iasl' package be installed. Many Linux distributions have this package. Try: sudo yum install iasl Or: sudo apt-get install iasl Please install iasl and retry. Makefile:106: *** "Please upgrade the build environment". Stop. Change-Id: Ice41376bc242f1f622d849e7628f8a9b6ef47404 Signed-off-by: Martin Roth <gaumless@gmail.com> Reviewed-on: http://review.coreboot.org/10655 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-03libpayload: update xcompile scriptPatrick Georgi
Copy from coreboot. at some point it probably should just reuse coreboot's version. Change-Id: Iee905a9060983ff85e2e70bde69a221c64a07cbc Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10756 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-01coreinfo: use coreboot's kconfigStefan Reinauer
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Change-Id: I99e612dca3c2e5678d43b3e85eaf2f51d8f693e7 Reviewed-on: http://review.coreboot.org/10715 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-01libpayload: always compile with -ffunction-sectionsStefan Reinauer
Always compile with -ffunction-sections and -fdata-sections This does not hurt, and it allows the linker to produce much smaller binaries in some circumstances. Change-Id: Ibf9f24c210d6d2ed40451b4cf0d68ce88220bc5f Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10750 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>