summaryrefslogtreecommitdiff
path: root/payloads
AgeCommit message (Collapse)Author
2013-03-22libpayload: Add comments on virtual pointers in lib_sysinfoNico Huber
After another incident related to virtual pointers in lib_sysinfo (and resulting confusion), I decided to put some comments on the matter into the code. Remember, we decided to always use virtual pointers in lib_sysinfo, but it's not always obvious from the code, that they are. See also: 425973c libpayload: Always use virtual pointers in struct sysinfo_t 593f577 libpayload: Fix use of virtual pointers in sysinfo Change-Id: I886c3b1d182cba07f1aab1667e702e2868ad4b68 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/2878 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2013-03-22libpayload: initial test case + tiny "framework"Patrick Georgi
This adds a test case for using CBFS images that reside in RAM and a Makefile to run it (and maybe other tests in the future). The test concerns an issue in libcbfs when using x86 style CBFS images in non-canonical locations (eg. when loading CBFS images for processing). Use with "make run" inside the tests directory. Change-Id: I1af3792a1451728ff9594ba7f0410027cdecb59d Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/2623 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2013-03-21cbfs: Change false ERROR print to a WARNING.Shawn Nematbakhsh
Change "ERROR" to "WARNING" -- not finding the indicated file is usually not a fatal error. Change-Id: I0600964360ee27484c393125823e833f29aaa7e7 Signed-off-by: Shawn Nematbakhsh <shawnn@google.com> Reviewed-on: http://review.coreboot.org/2833 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-18libpayload: Fix the config file dependency in the Makefile templateGabe Black
The template had a dependency on config.h which was correct for coreboot, where this build system originally came from, but not for libpayload which uses the differently named libpayload-config.h, presumably to avoid colliding with a config.h used by the actual payload. Because libpayload-config.h is now effectively a dependency of everything, it doesn't have to be added piecemeal in Makefile.inc. Change-Id: I01f20d363cb1393fa1cdcf0dc916670db90294e9 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2763 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-18libpayload: Make keycode constants available outside of curses.h.Gabe Black
And include the new, split out version in drivers/keyboard.c and drivers/usb/usbhid.c. Those files were including curses.h just for those definitions, but the include path was only fixed up to to point to the libpayload versions of those files if one of the variants of curses was compiled in. If neither was, gcc would fall back to the system version of that header which is wrong. Change-Id: I8c2ee0baf5f0702bd8c713c8dd4613a4bb269ce5 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2762 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-14libpayload: add support for vboot_handoffAaron Durbin
The vboot_handoff structure needs to be parsed from the coreboot tables. Add a placeholder in sysinfo as well as the ability to parse the coreboot table entry concering the vboot_handoff structure. Built with unified boot loader and ebuild changes. Can find and use the VbInitParams for doing kernel selection. Change-Id: If40a863b4a445fa5f7814325add03355fd0ac647 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/2720 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-14libpayload: Turn the endian conversion macros into functions.Gabe Black
In their current macro form, any arguments that are expressions will be evaluated multiple times. That can cause problems if they have side effects, and might not even compile if the overall expression is ambiguous, for instance if you pass in foo++. Built with code that previously wouldn't compile because the macros expanded to ambiguous expressions. Change-Id: I378c04d7aff5b4ad40581930ce90e49ba7df1d3e Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2719 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-14libpayload: Generalize and redistribute timekeeping codeGabe Black
The timekeeping code in libpayload was dependent on rdtsc, and when it was split up by arch, that code was duplicated even though it was mostly the same. This change factors out actually reading the count from the timer and the speed of the timer and puts the definitions of ndelay, udelay, mdelay and delay into generic code. Then, in x86, the timer_hz and timer_get_raw_value functions which used to be in depthcharge were moved over to libpayload's arch/x86/timer.c. In ARM where there isn't a single, canonical timer, those functions are omitted with the intention that they'll be implemented by a specific timer driver chosen elsewhere. Change-Id: I9c919bed712ace941f417c1d58679d667b2d8269 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2717 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-14libpayload: Put dump_td/dump_ed in ohci.c behind #ifdef USB_DEBUGGabe Black
This function is static and not used in that file. To avoid the compiler complaining about that fact, put the two functions and the call to dump_ed (currently #if 0) behind #ifdef USB_DEBUG Change-Id: Ic373313b5fff81f09800f286b32238350ab699c6 Signed-off-by: Gabe Black <gabeblack@google.com> Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/2716 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-14libpayload: Don't declare the loop counter within the for loopGabe Black
'for' loop initial declarations are only allowed in C99 mode I didn't realize we don't enable 14 year old features when building libpayload, and I must have accidentally not rebuilt everything when making my final tweaks to my earlier change. Change-Id: I6caeeffad177b6d61fa30175f767e85084c061f4 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2718 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins)
2013-03-13libpayload: Don't do unaligned accesses during LZMA decompressionGabe Black
Use memcpy to access a uint32_t that's inherently unaligned due to the layout of the LZMA header format. Built and booted on Daisy and saw a data abort go away. Built and booted into developer mode on Link and verified that bitmaps were decompressed/displayed correctly. Change-Id: Id3ae746c04d23bcb0345cb71797bfa219479cc8f Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2670 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: Add size_t and ssize_t types for ARM and x86Gabe Black
Some new TPM drivers in depthcharge require that type. I added it to arch/types.h which seemed appropriate, but I'm not sure that's exactly the right header to use, or in other words if you'd get that type from libpayload the same way you'd get it if you were building a standard Linux program. Also, I attempted to determine what underlying types gcc would use, and while I think I picked the right ones I'm not 100% certain of that either. Change-Id: Ic5c0b4173c8565ede3bfce8870976d596d69e51d Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2669 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: Move over to the payload's stack during startupGabe Black
Don't keep using the coreboot stack on ARMv7. Change-Id: I734c5d77f8584e30ee0c720d41e21e3040f56db4 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2668 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: ARCH-$(CONFIG_ARCH_ARMV7) was defined twice, make one POWERPCGabe Black
Change-Id: Ia85a7cd6a0b85119cce6b2f9c42a7fc31ffd9f97 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2654 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: Add usb_generic_(create|remove) functions for unrecognized devicesGabe Black
It might be useful to provide a USB driver in the payload itself instead of in libpayload. For example there are multiple payloads being built and linked against the same libpayload, and they might not need or even want to have the same set of drivers installed. This change adds two new functions, usb_generic_create and usb_generic_remove, which behave like the usbdisk_create and usbdisk_remove functions which are defined for USB mass storage devices. If a USB device isn't recognized and claimed by one of the built in USB class drivers (currently hub, hid, and msc) and the create function is defined, then it will be called to give the payload a chance to use the device. Once it's removed, if usb_generic_remove is defined it will be called, effectively giving the payload notice. Built and booted depthcharge on Link. Built depthcharge for Daisy. Built a netbooting payload, called usb_poll() with those functions implemented, and verified that they were called and that the devices they were told about were reasonable and the same as what was reported by lsusb in the booted system. Change-Id: Ief7c0a513b60849fbf2986ef4ae5c9e7825fef16 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2666 Tested-by: build bot (Jenkins) Reviewed-by: Kimarie Hoot <kimarie.hoot@se-eng.com> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: Split EHCI bulk transfers on packet boundaries over qTDsJulius Werner
EHCI controllers see transfers as a queue of transfer descriptors (qTDs), each of which can represent an aligned area of up to 20KB. Each qTD is processed separately, which means that a single USB packet cannot span multiple qTDs. While this should not be a problem according to the specification, some USB storage devices seem to get confused when a packet in the middle of a transfer is smaller than the maximum packet size (512 bytes) due to falling on a qTD boundary. This patch aligns the total transfer length per qTD to 512 bytes to avoid that problem (any excess bytes will simply roll over to the next qTD). Change-Id: I0b5db07507699a3861b30c1a5ee774c45dda7fdd Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: http://review.coreboot.org/2651 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: add support for 64-bit EHCI controllersVincent Palatin
Initialize the high part of the address and use 64-bit compatible descriptors. (waste a few bytes on 32-bit but should be harmless) Read USB stick on a SandyBridge system which has 64-bit EHCI. Change-Id: I59cc842459acecdde8f8bdd4795ebfeccb842c8f Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2650 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Kimarie Hoot <kimarie.hoot@se-eng.com> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: Stub out time keeping functions for ARM as wellGabe Black
These were currently stubbed out for PowerPC but not for ARM. Change-Id: I08f45174877bf5751d972078b8c53d82898b7f2b Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2655 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: If no video drivers initialize in video_init, return 1.Gabe Black
Change-Id: I56f810dfa6654ac1e9d1696ad15e7f1b8bfe59bd Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2652 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2013-03-13libpayload: If there's no IO address space, don't try to use it for serialGabe Black
Change-Id: I01b1fa42139af925716cd5d57f96dc24da6df5a7 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2660 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: If there's no IO space, complain if the serial claims to use itGabe Black
Change-Id: I36c750d520ff034c9ca9b9af46bd99bd49af7355 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2659 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: Consolidate io vs. mem mapped serial into accessor functionsGabe Black
This way we won't have two copies of the hardware init function, and three copies of the putchar, havechar, and getchar functions. Change-Id: Ifda7fec5d582244b0e163ee93ffeedeb28ce48da Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2657 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: Make whether or not there's an IO address space configurableGabe Black
Default it to no to be consistent with the other architecture wide options (endianness), and turn it on explicitly for x86 and PowerPC. Change-Id: Idda26d580156bbbf08ea11b28abe75cfa6b594b2 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2658 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: Start using only internal and compiler headers.Ronald G. Minnich
When building other payloads with lpgcc the -nostdinc flag was injected into CFLAGS, but when building libpayload itself some headers were being used from the host system. This change puts -nostdinc into the Makefile and xcompile script, fixes up one include path in include/inttypes.h, adds the compiler provided include directory to the include search path, and deletes the two now redundant stdint.h files. BUG=None TEST=With this and other changes, built libpayload and depthcharge for Daisy, Link, and Fox. BRANCH=None Change-Id: Ia7817fceab5297cd82ccc0d392330de0df61980e Signed-off-by: Gabe Black <gabeblack@google.com> Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2710 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2013-03-13libpayload: Add more parenthesis to the endian conversion macrosGabe Black
There weren't enough parenthesis in the macros so operations might only apply to the last part of an expression passed in as an argument. Change-Id: I5afb406f9409986e45bbbc598bcbd0dd8507ed35 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2665 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2013-03-13libpayload: Make the source for lzma decompression constGabe Black
Change-Id: I9a16331dedc97f17af94bf2cf535a9c93d1729a0 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2667 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com> Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2013-03-13libpayloads: Provide BSD/glibc style endian functions.Hung-Te Lin
The functions in endian.h (betoh{l,w,ll} and others) were named differently from the well-known BSD/glibc style endian functions (ex, betoh{16,32,64}). We should provide the BSD/glibc style functions to prevent confusion. Change-Id: Ia3bee481ba7989ac25b79ddb89bc6819d52fd8c3 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: http://review.coreboot.org/2705 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-12libpayload: Remove unnecessary include of arch/msr.hGabe Black
The functions defined in that header aren't used anywhere in the actual code, and that include breaks things on ARM. Built for ARM with COREBOOT_VIDEO_CONSOLE turned on and saw compiler errors go away. Change-Id: I56d6fe5e00c8fccda6e31ef8752326bd36398e74 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2656 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2013-03-12libpayload: In the USBMSC read_capacity function, make buf an array of u32.Gabe Black
That way when it's treated as a u32 when its value is extracted for numblocks and blocksize below, it doesn't make the compiler unhappy, and it ensures that the buffer will be properly aligned on architectures where that sort of thing matters. Built and saw warnings about type punning go away. Change-Id: I254e0b5e70847112d660675b7df0ac9cb52e4051 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2653 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2013-03-12libpayload: Fix reading x86 CBFS images from RAMPatrick Georgi
Three issues: 1. the hardcoded dereferenced pointer at 0xfffffffc 2. "RAM media" has no idea about ROM relative addresses 3. off-by-one in RAM media: it's legal to request 4 bytes from 0xfffffffc Change-Id: I671ac12d412c71dc8e8e6114f2ea13f58dd99c1d Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/2624 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2013-03-04libpayload: Turn on thumb interworking in libpayload.Gabe Black
Things work better with it turned on, and the overhead should be negligable. Built and booted into depthcharge on Snow. Verified that calling between various bits of thumb and ARM code worked correctly. Change-Id: I08d1006e113d2cca08634bf19240aca138a449d9 Signed-off-by: Gabe Black <gabeblack@google.com> Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2567 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2013-03-04libpayload: Catch exceptions and print out an error message.Ronald G. Minnich
Give some indication what happened instead of just crashing. As part of setup, cause an exception and make sure that we get the right one, and that we recover correctly. Hence we have some assurance that if they really happen we can handle them. Built and booted into test payload on Snow. Saw the built in test function worked correctly. Artificially added code which got an exception and saw that the error information prints correctly. Change-Id: I2e0d022f090ee422fb988074fbb197afa2485caa Signed-off-by: Gabe Black <gabeblack@google.com> Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2569 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins)
2013-03-04bump SeaBIOS to 1.7.2.1Idwer Vollering
Update coreboot to use SeaBIOS' tag rel-1.7.2.1 Change-Id: I01969407964a7cf64f7c4800b59c6aed845b24f9 Signed-off-by: Idwer Vollering <vidwer@gmail.com> Reviewed-on: http://review.coreboot.org/2575 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2013-03-01libpayload: Mark "halt" as a function.Gabe Black
The linker uses that info so interworking can work correctly. Built and booted into depthcharge on Snow and saw interworking start to work correctly. Change-Id: I0ac54f1c424ec70f8244edf6541a10b089ce47b4 Signed-off-by: Gabe Black <gabeblack@google.com> Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2568 Tested-by: build bot (Jenkins)
2013-03-01GPLv2 notice: Unify all files to just use one space in »MA 02110-1301«Paul Menzel
In the file `COPYING` in the coreboot repository and upstream [1] just one space is used. The following command was used to convert all files. $ git grep -l 'MA 02' | xargs sed -i 's/MA 02/MA 02/' [1] http://www.gnu.org/licenses/gpl-2.0.txt Change-Id: Ic956dab2820a9e2ccb7841cab66966ba168f305f Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: http://review.coreboot.org/2490 Tested-by: build bot (Jenkins) Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2013-02-28libpayload: Check for completion more often in ehci_set_periodic_schedule.Gabe Black
This function was using mdelay in a loop to check for the completion of an USB controller operation. Since we're busy waiting anyway, we might as well wait only 1 us before checking again and potentially seeing the completion 999 us earlier than we would otherwise. Change-Id: I177b303c5503a0078c608d5f945c395691d4bd8a Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2522 Tested-by: build bot (Jenkins) Reviewed-by: Dave Frodin <dave.frodin@se-eng.com> Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2013-02-26libpayload: Add a pointer for user data on the USB MSC data structure.Gabe Black
This is so the user of libpayload can attach data to the device which it can retrieve when the device is referred to later, for instance in usbdisk_remove. Otherwise, there's no direct connection from the usbdev_t structure to any bookkeeping in the host firmware. Change-Id: I36fe693b0dcd2098e359c26744e376e73bd3a723 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2513 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.huber@secunet.com>
2013-02-26libpayload: Correct a constant used for scanning for USB controllers.Gabe Black
When checking to see if a PCI device exists at a particular bus/dev/func, libpayload was checking the vendor and device id fields together against a 16 bit 0xffff. The two fields together are 32 bits, however, so the check was never true, and all dev/func combinations on a particular bus would be checked. That was slightly wasteful, but had relatively small impact. Change-Id: Iad537295c33083243940b18e7a99af92857e1ef2 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2521 Tested-by: build bot (Jenkins) Reviewed-by: Dave Frodin <dave.frodin@se-eng.com> Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2013-02-26libpayload: Change the measurement interval for get_cpu_speed to 2 ms.Gabe Black
The interval used to be about 55 ms which is excessively long. Coreboot only waits for 2 ms and gets a reasonable answer. That should be good enough for us as well. Change-Id: I4d4e8b25b6ba540c9e9839ed0bbaa1f04f67cce1 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2520 Tested-by: build bot (Jenkins) Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2013-02-22libpayload: cbfs: Fix CBFS max size calculation.Hung-Te Lin
Cherry-picking CBFS fix from http://review.coreboot.org/#/c/2292/ For x86, the old CBFS search behavior was to bypass bootblock and we should keep that. This will speed up searching if a file does not exist in CBFS. For arm, the size in header is correct now so we can remove the hack by CONFIG_ROM_SIZE. Change-Id: I286ecda73bd781550e03b0b817ed3fb567d6b8d7 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: http://review.coreboot.org/2458 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2013-02-20libpayload: Fix license headersStefan Reinauer
Not only were these files checked in with the Chromium OS Authors copyright, but in addition they were wrongly licensed as GPL. Switch to 3-clause BSD (and, since we're changing it, fix copyright, too) Change-Id: I3656c1f4304d53e343d89bb7c909fd4b929249f4 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/2456 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-02-19libpayload: libcbfs: Fix legacy CBFS API, typosPatrick Georgi
get_cbfs_header expects CBFS_HEADER_INVALID_ADDRESS (0xffffffff) instead of NULL when something is wrong. Also, fix typo. Change-Id: Ibe56c9eab3b9fdfc6d0b14bc848ca75f3a4fc2f1 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/2455 Tested-by: build bot (Jenkins) Reviewed-by: Peter Stuge <peter@stuge.se>
2013-02-16libpayload: only compile drivers/serial.c on machines that use it.Ronald G. Minnich
Create a new serial console variable, X86_SERIAL_CONSOLE which is only enabled when SERIAL_CONSOLE and ARCH_X86 are defined. Builds for x86 and ARM. Change-Id: I607253c418de015975a839e3c33577842885ec0c Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2412 Tested-by: build bot (Jenkins) Reviewed-by: Gabe Black <gabeblack@chromium.org>
2013-02-15libpayload: Use the same type for 32 bit data in readl as in uint32_t.Ronald G. Minnich
The compiler gets mad when the types are equivalent size but not necessarily interchangeable because of strict aliasing checks. Since uint32_t is likely to be used when trying to read 32 bit data, it makes sense for them to be the compatible. Signed-off-by: Gabe Black <gabeblack@google.com> Change-Id: If73d794866055dc026fc06d6268e692adac0f835 Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2411 Tested-by: build bot (Jenkins) Reviewed-by: Gabe Black <gabeblack@chromium.org>
2013-02-15libpayload: fix compiler flagsRonald G. Minnich
lpgcc was unconditionally setting -m32. Most of the flags it sets in the common case are right, however: no need to duplicate them everywhere, and we only want to change the common ones in one place, so it would be a shame to duplicate _CFLAGS all over the place. So add another variable, _ARCHEXTRA, which can be used to add special flags to _CFLAGS. We onlu use it at present for the x86; this may change. This allows us to get through compiling on arm and x86. Change-Id: I12f1620982c4ee10f76b3953e4225f13db31531e Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2399 Tested-by: build bot (Jenkins) Reviewed-by: Gabe Black <gabeblack@chromium.org>
2013-02-15libpayload: get time to compile cross-archRonald G. Minnich
Get rid of the nest of includes, and make separate sections for each architecture. Also gets rid of the "there's X86 and there's everything else" structure of this file. Change-Id: I4232f50f048fa05e911e5de3aa9ec1530931b461 Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2397 Tested-by: build bot (Jenkins) Reviewed-by: Gabe Black <gabeblack@chromium.org>
2013-02-15libpayload: make functions static that are unused outside memory.cRonald G. Minnich
The default_ functions in memory.c are only used to initialize a weak variable. They should not be used outside memory.c. Make them invisible. Remove the declaration from libpayload.h. For real this time. Change-Id: Id54c1fd172c78748f01a958ce4065dd0eb53bbc3 Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2394 Tested-by: build bot (Jenkins) Reviewed-by: Gabe Black <gabeblack@chromium.org>
2013-02-15libpayload: Use an appropriate range of memory when looking for cb tables.Ronald G. Minnich
These live at the bottom of memory on x86, but that's IO mapped on the exynos. The particular range used will likely need to be configurable, but this will make it work in one more case than it used to. Change-Id: I4d4963b9732cf538d00f8effb4398f30cbbde6aa Signed-off-by: Gabe Black <gabeblack@google.com> Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2410 Tested-by: build bot (Jenkins) Reviewed-by: Gabe Black <gabeblack@chromium.org> Reviewed-by: David Hendricks <dhendrix@chromium.org>
2013-02-15libpayload: add a ldscript for armRonald G. Minnich
I think this needs to be its own ldscript. I'm pretty sure this one is going to need some work however. Is libpayload PIC? That would be best if so. Change-Id: I44578d70dfa72de527af8901a86583c2a60130ec Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2398 Reviewed-by: David Hendricks <dhendrix@chromium.org> Tested-by: build bot (Jenkins)
2013-02-14libpayload; put the ldscript into an arch-dependent directory pathRonald G. Minnich
Since it's utterly architecture-dependent, put it in arch/x86. Avoid the temptation to make yet another directory with just one file in it. Fix the makefile to pick up the proper arch-dependent script. Change-Id: I21ea02551a97bdcbc38419714f3b38cf8335c178 Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2389 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks <dhendrix@chromium.org>
2013-02-12libpayload: New CBFS to support multiple firmware media sources.Hung-Te Lin
Upgrade CBFS in libpayload to use new media-based implementation from coreboot ( http://review.coreboot.org/#/c/2182/ ). Old CBFS functions (cbfs_find, cbfs_find_file, get_cbfs_header) are still supported, although the recommended way is to use new CBFS API. To migrate your existing x86 payload source: - Change cbfs_find to cbfs_get_file - Change cbfs_find_file to cbfs_get_file_content - Prefix every CBFS call with a CBFS_DEFAULT_MEDIA argument. Ex, char *jpeg_data = cbfs_find_file("splash.jpg", CBFS_TYPE_BOOTSPLASH); => char *jpeg_data = cbfs_get_file_content( CBFS_DEFAULT_MEDIA, "splash.jpg", CBFS_TYPE_BOOTSPLASH); The legacy setup_cbfs_from_{ram,flash} is also supported, although the better equivalent is to make a new media instance: struct cbfs_media ram_media; init_cbfs_ram_media(&ram_media, start, size); char *data = cbfs_get_file_content(&ram_media, "myfile", my_type); Verified by being successfully linked with filo. Change-Id: If797bc7e3ba975d7e3be905c59424f7a93b8ce11 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: http://review.coreboot.org/2191 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2013-02-01Fix libpayload xcompile xgcc pathMarc Jones
The libpaylaod xcompile script path to xgcc should look for coreboot/util, not libpayload/util. Change-Id: I565801549cdcdfcf55ecef1b543a982f969f435b Signed-off-by: Marc Jones <marc.jones@se-eng.com> Reviewed-on: http://review.coreboot.org/2261 Tested-by: build bot (Jenkins) Reviewed-by: Steven Sherk <steven.sherk@se-eng.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2013-02-01libpayload: add EHCI QH/qTD debuggingAnton Kochkov
Improve USB debugging for EHCI by adding dump_qh and enhacing dump_td to dump all queue chain and information. Change-Id: Ia8ecf19c6dac085cf9558bdf659a5e74ce332714 Signed-off-by: Anton Kochkov <anton.kochkov@gmail.com> Reviewed-on: http://review.coreboot.org/2053 Tested-by: build bot (Jenkins) Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Nico Huber <nico.huber@secunet.com>
2013-01-30libpayload: Update README with Git repository URL and directory locationPaul Menzel
Change-Id: I3e068f5e6c1eb875df0885c0ce43a03082be31a5 Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: http://review.coreboot.org/2228 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-01-30Project PIANO aka tianocorebootStefan Reinauer
This is a Tiano Core loader payload based on libpayload. It will load a Tiano Core DXE core from an UEFI firmware volume stored in CBFS. Currently Tiano Core dies because it does not find all the UEFI services it needs: coreboot-4.0-3316-gc5c9ff8-dirty Mon Jan 28 15:37:12 PST 2013 starting... [..] Tiano Core Loader v1.0 Copyright (C) 2013 Google Inc. All rights reserved. Memory Map (5 entries): 1. 0000000000000000 - 0000000000000fff [10] 2. 0000000000001000 - 000000000009ffff [01] 3. 00000000000c0000 - 0000000003ebffff [01] 4. 0000000003ec0000 - 0000000003ffffff [10] 5. 00000000ff800000 - 00000000ffffffff [02] DXE code: 03e80000 DXE stack: 03e60000 HOB list: 03d5c000 Found UEFI firmware volume. GUID: 8c8ce578-8a3d-4f1c-9935-896185c32dd3 length: 0x0000000000260000 Found DXE core at 0xffc14e0c Section 0: .text size=000158a0 rva=00000240 in file=000158a0/00000240 flags=60000020 Section 1: .data size=00006820 rva=00015ae0 in file=00006820/00015ae0 flags=c0000040 Section 2: .reloc size=000010a0 rva=0001c300 in file=000010a0/0001c300 flags=42000040 Jumping to DXE core at 0x3e80000 InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B 3E96708 HOBLIST address in DXE = 0x3E56010 Memory Allocation 0x00000003 0x3E80000 - 0x3EBFFFF FV Hob 0xFFC14D78 - 0xFFE74D77 InstallProtocolInterface: D8117CFE-94A6-11D4-9A3A-0090273FC14D 3E95EA0 InstallProtocolInterface: EE4E5898-3914-4259-9D6E-DC7BD79403CF 3E9630C Security Arch Protocol not present!! CPU Arch Protocol not present!! Metronome Arch Protocol not present!! Timer Arch Protocol not present!! Bds Arch Protocol not present!! Watchdog Timer Arch Protocol not present!! Runtime Arch Protocol not present!! Variable Arch Protocol not present!! Variable Write Arch Protocol not present!! Capsule Arch Protocol not present!! Monotonic Counter Arch Protocol not present!! Reset Arch Protocol not present!! Real Time Clock Arch Protocol not present!! ASSERT_EFI_ERROR (Status = Not Found) ASSERT /home/reinauer/svn/Tiano/edk2/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c(461): !EFI_ERROR (Status) Change-Id: I14068e9a28ff67ab1bf03105d56dab2e8be7b230 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/2154 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-01-25libpayload: use $(DOTCONFIG) instead of .configStefan Reinauer
When overriding the DOTCONFIG variable, make install will fail in libpayload. Change-Id: I332be3a4ca2620a32a6f5fbe683e6c71f0d6a9e9 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/2178 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2013-01-15libpayload: Style fixesStefan Reinauer
Change-Id: Ic3164fbffd8da6bd9d506d80e425ad89efc0f1af Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/2144 Tested-by: build bot (Jenkins) Reviewed-by: Dave Frodin <dave.frodin@se-eng.com> Reviewed-by: Martin Roth <martin.roth@se-eng.com> Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2013-01-04Change "VERSION*" to more determined name "CBFS_HEADER_VERSION*".Hung-Te Lin
The 'VERSION' in CBFS header file is confusing and may conflict when being used in libpayload. Change-Id: I24cce0cd73540e38d96f222df0a65414b16f6260 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: http://review.coreboot.org/2098 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks <dhendrix@chromium.org>
2012-12-20PDcurses: Delete automatically created (and unused) filesStefan Reinauer
Change-Id: Iefe0872d36c3a5d8ef42e62325838b7f09b389d2 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/2034 Reviewed-by: David Hendricks <dhendrix@chromium.org> Tested-by: build bot (Jenkins)
2012-12-20libpayload: Another usb fixPatrick Georgi
Change-Id: I91b18fadbf17562f8b48e233631653f2a18c037c Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/2063 Tested-by: build bot (Jenkins) Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2012-12-19libpayload: fix USBPatrick Georgi
A "far" modifier sneaked into the USB driver, but gcc doesn't understand it. Change-Id: I5c67bd55eabce467e1aa107c95c1db2518af7b0e Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/2059 Tested-by: build bot (Jenkins) Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2012-12-19libpayload: improved UHCI TD debuggingAnton Kochkov
Improved USB debugging for EHCI by enhacing dump_td to dump all chain information Change-Id: I8c667b43e09c39ff12aafbd779474efd652bd80f Signed-off-by: Anton Kochkov <anton.kochkov@gmail.com> Reviewed-on: http://review.coreboot.org/2054 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.huber@secunet.com>
2012-12-19libpayload: improving OHCI TD/ED debuggingAnton Kochkov
Improving USB debugging for OHCI by enhacing dump_td and adding dump_ed function to dump all chain information Change-Id: Ia8b2a9b53e79b1f280fd12ea0d9233fc875e0b57 Signed-off-by: Anton Kochkov <anton.kochkov@gmail.com> Reviewed-on: http://review.coreboot.org/2056 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.huber@secunet.com>
2012-12-18libpayload: Check if serial console h/w is present before usingDave Frodin
The serial_io_havechar() and serial_io_getchar() functions will always see keystrokes available if the serial hardware isn't actually there. We will still output chars to non-existant hardware to allow virtual hardware to capture them. Change-Id: I04e85157b6b7a185448abab352b5417a798a397a Signed-off-by: Dave Frodin <dave.frodin@se-eng.com> Reviewed-on: http://review.coreboot.org/2040 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2012-12-18libpayload: Use usb_debug() to show USB messagesDave Frodin
Previously printf()'s were used to show USB messages which results in lots of USB information being shown when it isn't needed. This will now use the usb_debug() printing funtion that already exists in usb.h. Change-Id: I2199814de3327417417eb2e26a660f4a5557cb9f Signed-off-by: Dave Frodin <dave.frodin@se-eng.com> Reviewed-on: http://review.coreboot.org/2044 Tested-by: build bot (Jenkins) Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2012-12-18libpayload: Update configs/defconfig fileDave Frodin
Several settings have been added to the config without any changes to the default settings file. Change-Id: Iaf9259d77fb3c4645fc68bc0108de79c0298f0a1 Signed-off-by: Dave Frodin <dave.frodin@se-eng.com> Reviewed-on: http://review.coreboot.org/2039 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-12-14libpayload: add kconfig.hStefan Reinauer
This implements the linux kernel's macros to handle boolean CONFIG_ variables more easily. Change-Id: I595f9db652d019fe72e231111258ec609bec9d4e Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/2036 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-12-14libpayload: Initial ARMv7 portStefan Reinauer
This compiles, but it's not tested yet. Change-Id: I2f73a814649aa36c39af3e77cefd8a968671f5c0 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/2035 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-12-14libpayload: rename i386 to x86Stefan Reinauer
Change-Id: Ia9170bd3d04e76dbf9321ca7ea4be23b5e468d21 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/2033 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-12-13coreinfo: Build libpayload from coreinfo makefileMarc Jones
Build libpayload and install it in the coreinfo directory. Allows coreinfo to be built with a single make command. Change-Id: I56982265555aae16e482b0a0040989c1f5317423 Signed-off-by: Marc Jones <marc.jones@se-eng.com> Reviewed-on: http://review.coreboot.org/1995 Tested-by: build bot (Jenkins) Reviewed-by: Dave Frodin <dave.frodin@se-eng.com> Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2012-12-13libpayload: increase the default heap sizeDave Frodin
Coreinfo uses the default heap size and will blow up if the USB keyboard is used. Change-Id: I2ffae330ec34167b2ccfbd4c428e3e8306230f44 Signed-off-by: Dave Frodin <dave.frodin@se-eng.com> Reviewed-on: http://review.coreboot.org/1980 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-12-12coreinfo: changes to get the USB keyboard workingDave Frodin
A call to usb_initialize() was needed. Also needed to set several curses flags. One to prevent keystrokes echoing to the display, and one to allow extended keystrokes (like the KEY_F(n)) to be seen when calling getch(); Change-Id: I495b42055a54603e4efb92b2845051434d88432d Signed-off-by: Dave Frodin <dave.frodin@se-eng.com> Reviewed-on: http://review.coreboot.org/1983 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-12-10libpayload: Fix use of virtual pointers in sysinfoNico Huber
In I4c456f5, I falsely identified struct cb_string.string as a pointer which it is not. So we don't need phys_to_virt() here. Change-Id: I3e2b6226ae2b0672dfc6e0fa4f6990e14e1b7089 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1987 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-12-10libpayload: Fix renaming of REG_CLASS_DEV to REG_SUBCLASSNico Huber
REG_CLASS_DEV was renamed to REG_SUBCLASS. Change-Id: I4af476b953b544f680337d815889564f016563eb Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1986 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-12-08coreinfo: Make better calls to libpayload build scriptsMarc Jones
Set LPGCC and LPAS so that CC and AS are maintained. Clean up the makefile order to check for .config to be easier to read. Use objcopy instead of strip and keep the debug symbols file. Change-Id: I95d6b7a0e3a99a142d3fd6e2ecc61de1d4412402 Signed-off-by: Marc Jones <marc.jones@se-eng.com> Reviewed-on: http://review.coreboot.org/1994 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-12-08Clean up libpayload lpgcc and lpas scripts.Marc Jones
lpgcc and lpas are called by payload Makefiles to properly build and link with libpayload. Made lpas use the proper crosscompile AS, as lpgcc does with CC. Added V=1 support to help users debug the build. Fix basename $CC and $AS expansion. Change-Id: Ia4dc8ba53ba7565521a79f1520155f3307b09f85 Signed-off-by: Marc Jones <marc.jones@se-eng.com> Reviewed-on: http://review.coreboot.org/1993 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-12-07coreinfo: change the foreground/background colorsDave Frodin
The default curses library changed from tinycurses to PDCurses. PDCurses fails to fill the entire active screen with the assigned background colors when it writes 'blank' chars. This will allow the menues to look better until I resolve that. Change-Id: I70b5331d16dd0abaa1f0b02b725571844b7ac15e Signed-off-by: Dave Frodin <dave.frodin@se-eng.com> Reviewed-on: http://review.coreboot.org/1984 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Marc Jones <marcj303@gmail.com>
2012-12-07libpayload: Don't let USB/PC/serial keyboards overwrite each otherDave Frodin
Change-Id: I75c0066cf737e0cecac056487215622e2b3d4467 Signed-off-by: Dave Frodin <dave.frodin@se-eng.com> Reviewed-on: http://review.coreboot.org/1981 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-11-30Change TARGET_I386 to ARCH_X86David Hendricks
This renames TARGET_I386 to ARCH_X86 to make it more uniform with other parts of the codebase, e.g. cbfs_core.h from cbfstool. Change-Id: I1babcc941245ed1dde0478a21828766759373a42 Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/1961 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Dave Frodin <dave.frodin@se-eng.com>
2012-11-30fix #if for target architecture in libpayloadDavid Hendricks
This bug was introduced when we copied cbfs_core.h from cbfsutil to libpayload. Change-Id: I9b5d00d0dbdb969644ce46ad6ac2a84b366b5cd7 Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/1958 Reviewed-by: Dave Frodin <dave.frodin@se-eng.com> Tested-by: build bot (Jenkins)
2012-11-30libpayload: Remove unused FLAG_USED from memory allocatorNico Huber
The FLAG_USED bit in the memory allocator's header type was never read. This removes it to save one bit for the region size so we can have heaps of up to 32MiB. Change-Id: Ibd78e67d79e872d6df426516667c795fd52326d5 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1942 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-11-30libpayload: Fix lookup by label in CMOS layoutsNico Huber
The condition to compare the labels was twisted. Change-Id: I34a665aa87e2ff0480eda0f249bbbea8a8fe68d8 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1941 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-11-30Add multi-architecture support to cbfstoolDavid Hendricks
This is an initial re-factoring of CBFS code to enable multiple architectures. To achieve a clean solution, an additional field describing the architecture has to be added to the master header. Hence we also increase the version number in the master header. Change-Id: Icda681673221f8c27efbc46f16c2c5682b16a265 Signed-off-by: Stefan Reinauer <reinauer@google.com> Signed-off-by: Hung-Te Lin <hungte@chromium.org> Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/1944 Tested-by: build bot (Jenkins)
2012-11-27libpayload: Add _ and + to USB HID keymapPatrick Georgi
Slightly more complete keymap Change-Id: I4fef6b8f75ab07cb20a3a8ccd7eaad81c9fe719f Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/1922 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-11-24libpayload: Fix interrupt-queue cleanup for OHCINico Huber
We have to free TDs more carefully if they have been processed by the controller yet. The current code tries to force the controller to post them back to the done queue, but that seems wrong. We can't be sure, when they get written back. This resulted in leaking TDs with an invalid reference to a freed interrupt queue. The new approach: Mark the interrupt queue to be destroyed and handle the freeing later, when the controller posted the last TD to the done queue. Change-Id: I79d80a9dc89e1ca79dc125c4bbccbf23664227b3 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1905 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-11-24libpayload: Rework connection state detection for OHCINico Huber
The connection state detection in the OHCI root hub driver was broken if you used more than one device per root hub. Change-Id: Ica5c735426beac45ef6f591ce68a72d8283a00f5 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1904 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-11-24libpayload: Handle errors in UHCI interrupt queuesNico Huber
If somethings goes wrong during an interrupt transfer, drop the transfer. Change-Id: I450c08a7a0bf23fbee74237e0355d4a726ace114 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1901 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins)
2012-11-24libpayload: Handle underruns in UHCI interrupt queuesNico Huber
If usb_poll() isn't called fast enough, the UHCI controller marks an underrun interrupt queue as done (terminating the queue at the head). We can recover from this situation, when usb_poll() gets called again, and the queue is processed. Change-Id: Id56c9df44d6dbd53cd30ad89dfb5bf5977799829 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1898 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-11-24libpayload: Implement correct interrupt-queue linking for UHCINico Huber
The linking of interrupt queues into UHCI controller's framelist (in uhci_create_intr_queue()) was incomplete. The implementation of uhci_destroy_intr_queue() was even worse, looking like it wanted to clean up more than uhci_create_intr_queue() did. This patch follows the simple approach that we used for OHCI and EHCI: Each slot in the framelist holds only one interrupt queue. Therefore, we have to look for free slots each time we want to link an interrupt queue into the framelist. In return, we have a much simpler structured framelist. With this, USB devices using interrupt transfers (e.g. keyboards) can be detached cleanly from UHCI controllers. Also, more than one of such devices can be attached without further risk. Change-Id: I07b81a3b6f2cb3ff69515c973b3ae6321ad969aa Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1897 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-11-23libpayload: Make USB HID support multiple keyboardsNico Huber
The USB HID driver had some static variables with keyboard state. This moves them to the driver's instance, so multiple attached keyboards don't effect each other. Change-Id: I3f1ccfdea95062b443cebe510abf2f72fdeb1916 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1907 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins)
2012-11-23libpayload: ehci: Prevent some race conditionsNico Huber
Prevent race conditions, when an interrupt-queue underrun occurred and the controller is currently working on our queue head or a transfer is still in progress. Change-Id: Ia14f80a08071306ee5d1349780be081bfacb206a Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1902 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins)
2012-11-23libpayload: Detach devices behind removed USB hubsNico Huber
When a USB hub got removed, we should also remove all devices that were attached to it. Change-Id: I73c0da1b7570f1af9726925ca222781b3d752557 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1903 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins)
2012-11-23libpayload: More compliant error recovery in USB MSCNico Huber
If an endpoint gets stalled by an MSC device, after successful transmission of a command (CBW), we should still ask for the status (CSW). Otherwise, the driver and the device get desynchronized on the command tags. Change-Id: I53167f22c43b3a237cb4539b3affe37799378b93 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1900 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins)
2012-11-23libpayload: Reduce error output from EHCINico Huber
Stalled transfers are not fatal, so don't spew on the console on every tiny failure. Change-Id: I175c1e83a6af09c1abbd43d045ed6dbf0c79f871 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1899 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins)
2012-11-23libpayload: Fix random warningsNico Huber
dump_td() is orphaned but looks useful => commented out. The delay identifier shadowed the global one => renamed to total_delay. Change-Id: I4f3766a07db9194b2552ebf9302bd7ef8a66371f Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1895 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins)
2012-11-23libpayload: ehci: Fix warnings about discarded volatileNico Huber
We can trust free() and memset() to work correctly on volatile references, so cast volatile pointers to (void *) when calling them. Change-Id: Ieff7f78133b72f303349cca0a0ca3bbf37ec52bb Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1896 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins)
2012-11-23libpayload: Fix some missing-prototype warningsNico Huber
usb_controller_initialize() is not declared in any header file nor called from outside of usbinit.c, so make it static. set_configuration() looks like beeing non-static on purpose (like the other helpers around it in usb.c), so put a prototype into usb.h. Change-Id: I08d93b3769d8398bb43462d9afdfeec81fef93ec Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1894 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-11-23libpayload: Fix memalign() for fragmented alignment regionsNico Huber
Found a bug in the memory allocator ;-) If the total free space in an alignment region is large enough for an allocation but fragmented, such that there is no contiguous, sufficient large, free space in the region, memalign() was looking at the same region again and again in an endless loop. The advancing to the next region was just missing. Change-Id: I3fad833804675ee495577ca2749b007f46b5ff69 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1906 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins)
2012-11-19Add nvramcuiPatrick Georgi
nvramcui is a small libpayload based utility that provides an interactive CMOS editor for pre-boot environments. Change-Id: I514b8a7682f89d242d1b31b6907cc6bff34da4bf Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/1871 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2012-11-15libpayload: Always use virtual pointers in struct sysinfo_tNico Huber
We had mixed virtual and physical pointers in struct sysinfo_t. Some being virtual by accident which led to problems when we tried to reinitialize lib_sysinfo after relocating FILO (to get intentionally virtual pointers valid again). I guess this didn't cause much trouble before, as lib_get_sysinfo() was always called with physical addresses being equal to their virtual counterparts. For FILO, two possibilities seem practical: Either, have all pointers in struct sysinfo_t physical, so relocation doesn't hurt. Or, have all pointers virtual and call lib_get_sysinfo() again after relocation. This patch goes the latter way, changing the following pointers for situations where virtual pointers differ from physical: .extra_version .build .compile_time .compile_by .compile_host .compile_domain .compiler .linker .assembler .cb_version .vdat_addr .tstamp_table .cbmem_cons .mrc_cache We could also just correct the accidentally virtual pointers. But, IMO, this would lower the risk of future confusion. Note 1: Looks like .version gets never set. Note 2: .option_table and .framebuffer were virtual pointers but treated like physical ones. Even in FILO, this led to no problems as they were set before relocation. Change-Id: I4c456f56f049d9f8fc40e62520b1d8ec3dad48f8 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/1855 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>