coreboot-kgpe-d16/payloads/libpayload
Tristan Shieh a76e6542d1 mediatek: Use the 64-bit timer
GPT4 is a 32-bit timer and the counter of GPT4 will overflow in about
330 seconds (0xffffffff / 13MHz). Timer and delay functions will not
work properly if the counter overflows. To fix that we should use the
64-bit timer (GPT6).

BUG=b:80501386
BRANCH=none
Test=emerge-elm coreboot; emerge-kukui coreboot

Change-Id: I9f080e47253a1b1bab4636a45cb86c8666a25302
Signed-off-by: Tristan Shieh <tristan.shieh@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32245
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: You-Cheng Syu <youcheng@google.com>
2019-04-17 04:32:26 +00:00
..
arch libpayload: Align main() data types 2019-04-05 22:37:19 +00:00
bin
configs libpayload: qcs405: Add new Configs 2019-03-18 18:18:42 +00:00
crypto payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
curses payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
drivers mediatek: Use the 64-bit timer 2019-04-17 04:32:26 +00:00
gdb libpayload: gdb: Factor out gdb_handle_reentrant_exception() from arm32 2018-10-12 20:17:40 +00:00
include libpayload: Deduplicate strtol and strtoull 2019-04-10 10:44:31 +00:00
libc libpayload: Deduplicate strtol and strtoull 2019-04-10 10:44:31 +00:00
libcbfs payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
liblz4 Rename __attribute__((packed)) --> __packed 2017-07-13 19:45:59 +00:00
liblzma
libpci libpayload: Add pci_free_dev() and some boilerplate 2017-12-07 21:51:24 +00:00
sample
tests
Doxyfile payloads: Remove/fix trailing whitespace 2018-09-04 12:38:40 +00:00
Kconfig libpayload: Fix CONFIG_LP_DEBUG_MALLOC for 64-bit archs 2019-04-10 10:42:45 +00:00
LICENSES
LICENSE_GPL
Makefile libpayload: Make libpayload compile using gnu11 2018-07-16 07:44:03 +00:00
Makefile.inc copy & update test routines from what-jenkins-does 2017-08-11 15:24:56 +00:00
README Use git HTTP URLs without `/p` in it 2018-04-17 10:38:06 +00:00

README

-------------------------------------------------------------------------------
libpayload README
-------------------------------------------------------------------------------

libpayload is a minimal library to support standalone payloads
that can be booted with firmware like coreboot. It handles the setup
code, and provides common C library symbols such as malloc() and printf().

Note: This is _not_ a standard library for use with an operating system,
rather it's only useful for coreboot payload development!
See https://www.coreboot.org for details on coreboot.


Installation
------------

 $ git clone https://review.coreboot.org/coreboot.git

 $ cd coreboot/payloads/libpayload

 $ make menuconfig

 $ make

 $ sudo make install (optional, will install into /opt per default)

As libpayload is for 32bit x86 systems only, you might have to install the
32bit libgcc version, otherwise your payloads will fail to compile.
On Debian systems you'd do 'apt-get install gcc-multilib' for example.


Usage
-----

Here's an example of a very simple payload (hello.c) and how to build it:

 #include <libpayload.h>

 int main(void)
 {
     printf("Hello, world!\n");
     return 0;
 }

Building the payload using the 'lpgcc' compiler wrapper:

 $ lpgcc -o hello.elf hello.c

Please see the sample/ directory for details.


Website and Mailing List
------------------------

The main website is https://www.coreboot.org/Libpayload.

For additional information, patches, and discussions, please join the
coreboot mailing list at https://www.coreboot.org/Mailinglist, where most
libpayload developers are subscribed.


Copyright and License
---------------------

See LICENSES.