coreboot/src/lib
Vadim Bendebury c79ef1c545 Generalize revision number calculation function
Some platforms use tertiary interpretation of GPIO input state to
increase number of distinct values represented by a limited number of
GPIOs. The three states are

- external pull down (interpreted as 0)
- external pull up (1)
- not connected (2)

This has been required by Nvidia devices so far, but Exynos and
Ipq8086 platforms need this too.

This patch moves the function reading the tertiary state into the
library and exposes the necessary GPIO API functions in a new include
file. The functions are still supposed to be provided by platform
specific modules.

The function interpreting the GPIO states has been modified to allow
to interpret the state either as a true tertiary number or as a set
two bit fields.

Since linker garbage collection is not happening when building x86
targets, a new configuration option is being added to include the new
module only when needed.

BUG=chrome-os-partner:30489
TEST=verified that nyan_big still reports proper revision ID.

Change-Id: I243c9f43c82bd4a41de2154bbdbd07df0a241046
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209673
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-07-30 23:40:53 +00:00
..
cbfs.c vboot2: implement select_firmware for pre-romstage verification 2014-06-30 18:45:09 +00:00
cbfs_core.c cbfs: add cbfs_read() 2014-06-28 02:52:11 +00:00
cbfs_spi.c Provide a common CBFS wrapper for SPI storage 2014-05-06 05:54:36 +00:00
cbmem.c aarch64: Fix 64-bit pointer related casts 2014-02-24 19:19:38 +00:00
cbmem_console.c cbmem console: Make cbmem console usable on ARM. 2014-04-10 04:19:07 +00:00
cbmem_info.c cbmem: use a single id to name mapping table 2014-05-14 22:53:16 +00:00
clog2.c printk_foo -> printk(BIOS_FOO, ...) 2010-03-22 11:42:32 +00:00
compute_ip_checksum.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
coreboot_table.c vboot2: translate shared data to hand off to depthcharge 2014-07-23 02:29:26 +00:00
debug.c Myles suspected this hangs certain machines, so back it out. 2010-04-15 12:43:07 +00:00
delay.c - Major cleanup of the bootpath 2003-07-19 04:28:22 +00:00
dynamic_cbmem.c cbmem: Fix 64-bit pointer related casts in dynamic_cbmem.c 2014-03-14 03:44:40 +00:00
edid.c edid: initialize has_valid_detailed_blocks as 1 2014-04-21 12:51:09 +00:00
fallback_boot.c Make set_boot_successful depend on PC80_SYSTEM 2012-11-30 21:33:35 +01:00
gcc.c Unify assembler function handling 2012-12-06 23:13:17 +01:00
gcov-glue.c BACKPORT: coverage: use boot state callbacks 2013-05-01 14:30:01 -07:00
gcov-io.c Implement GCC code coverage analysis 2013-01-12 19:09:55 +01:00
gcov-io.h Implement GCC code coverage analysis 2013-01-12 19:09:55 +01:00
gcov-iov.h Implement GCC code coverage analysis 2013-01-12 19:09:55 +01:00
generic_dump_spd.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
generic_sdram.c Remove duplicate line from pci_ids.h. 2010-10-07 23:02:06 +00:00
hardwaremain.c implement a simple payload chooser for coreboot. 2013-12-23 07:57:10 +00:00
hexdump.c Add simple hexdump function 2013-07-30 15:25:06 -07:00
jpeg.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
jpeg.h Random cosmetic fixes (trivial). 2010-02-22 16:41:49 +00:00
libgcov.c Update gcov patch in documentation 2013-01-19 01:00:50 +01:00
lzma.c Add and consistently use wrapper macro for romstage static variables 2014-06-09 22:21:10 +00:00
lzmadecode.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
lzmadecode.h Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
Makefile.inc Generalize revision number calculation function 2014-07-30 23:40:53 +00:00
malloc.c SMM: Add support for malloc in SMM if using TSEG 2012-07-24 23:44:19 +02:00
memchr.c Add an implementation for the memchr library function 2012-03-09 20:00:53 +01:00
memcmp.c - Initial checkin of the freebios2 tree 2003-04-22 19:02:15 +00:00
memcpy.c fix compiler warnings (trivial) 2009-01-20 21:40:16 +00:00
memmove.c tidy 2004-03-13 03:40:29 +00:00
memrange.c coreboot memrange: Changes to memrange lib 2014-07-22 01:23:24 +00:00
memset.c fix compiler warnings (trivial) 2009-01-20 21:40:16 +00:00
ne2k.c x86: Unify arch/io.h and arch/romcc_io.h 2013-03-22 00:00:09 +01:00
nrv2b.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
ns8390.h Add support for the console over Ethernet (through PCI NE2000). 2010-07-16 20:02:09 +00:00
primitive_memtest.c Primitive memory test 2014-07-03 02:56:56 +00:00
ramstage_cache.c ramstage_cache: allow ramstage usage add valid helper 2013-12-13 00:07:08 +00:00
ramtest.c Replace ramtest pattern to assist in DIMM configuration 2012-03-25 20:17:51 +02:00
reg_script.c baytrail: add more iosf access functions 2013-12-12 19:47:21 +00:00
rmodule.c rmodule: Correct the typecast with proper parenthesis 2014-07-23 23:14:18 +00:00
rmodule.ld coreboot: Rename coreboot_ram stage to ramstage 2014-05-07 23:30:23 +00:00
selfboot.c Print segment clean up information only when required. 2014-05-14 20:49:25 +00:00
stack.c stack check: cosmetics 2013-11-15 03:54:51 +00:00
thread.c Possible thread stack implementation. 2013-08-23 10:38:10 -07:00
timer_queue.c BACKPORT: coreboot: add timer queue implementation 2013-05-01 14:30:57 -07:00
timestamp.c Add and consistently use wrapper macro for romstage static variables 2014-06-09 22:21:10 +00:00
tlcl.c vboot2: read secdata and nvdata 2014-07-23 02:29:18 +00:00
tlcl_internal.h vboot2: read secdata and nvdata 2014-07-23 02:29:18 +00:00
tlcl_structures.h vboot2: copy tlcl from vboot_reference as a preparation for vboot2 integration 2014-07-08 23:29:11 +00:00
tpm_error_messages.h vboot2: copy tlcl from vboot_reference as a preparation for vboot2 integration 2014-07-08 23:29:11 +00:00
trace.c GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
tristate_gpios.c Generalize revision number calculation function 2014-07-30 23:40:53 +00:00
uart8250.c UART 8250: Unconditionally provide register constants and use UART8250 prefix. 2013-10-02 09:18:38 +00:00
uart8250mem.c UART 8250: Unconditionally provide register constants and use UART8250 prefix. 2013-10-02 09:18:38 +00:00
usbdebug.c USBDEBUG: retry harder for slow devices 2012-07-30 20:54:24 +02:00
version.c coreboot: Introduce stage-specific architecture for coreboot 2014-05-09 04:41:47 +00:00
xmodem.c GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00