coreboot/src/lib
Julius Werner 2fa9545ac4 gpio: Remove non-ternary tristate mode, make ternaries easier
The function to read board IDs from tristate GPIOs currently supports
two output modes: a normal base-3 integer, or a custom format where
every two bits represent one tristate pin. Each board decides which
representation to use on its own, which is inconsistent and provides
another possible gotcha to trip over when reading unfamiliar code.

The two-bits-per-pin format creates the additional problem that a
complete list of IDs (such as some boards use to build board-ID tables)
necessarily has "holes" in them (since 0b11 does not correspond to a
possible pin state), which makes them extremely tricky to write, read
and expand. It's also very unintuitive in my opinion, although it was
intended to make it easier to read individual pin states from a hex
representation.

This patch switches all boards over to base-3 and removes the other
format to improve consistency. The tristate reading function will just
print the pin states as they are read to make it easier to debug them,
and we add a new BASE3() macro that can generate ternary numbers from
pin states. Also change the order of all static initializers of board ID
pin lists to write the most significant bit first, hoping that this can
help clear up confusion about the endianness of the pins.

CQ-DEPEND=CL:219902
BUG=None
TEST=Booted on a Nyan_Blaze (with board ID 1, unfortunately the only one
I have). Compiled on Daisy, Peach_Pit, Nyan, Nyan_Big, Nyan_Blaze, Rush,
Rush_Ryu, Storm, Veryon_Pinky and Falco for good measure.

Change-Id: I6133cdaf01ed6590ae07e88d9e85a33dc013211a
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/219901
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-10-23 01:41:42 +00:00
..
bootblock.ld New mechanism to define SRAM/memory map with automatic bounds checking 2014-10-03 09:09:36 +00:00
cbfs.c cbfs: Enforce media->map() result checking, improve error messages 2014-10-14 23:59:08 +00:00
cbfs_core.c cbfs: change 1 message level to WARNING if cbfs can't find specific data 2014-09-11 20:00:41 +00:00
cbfs_spi.c New mechanism to define SRAM/memory map with automatic bounds checking 2014-10-03 09:09:36 +00:00
cbmem.c aarch64: Fix 64-bit pointer related casts 2014-02-24 19:19:38 +00:00
cbmem_console.c New mechanism to define SRAM/memory map with automatic bounds checking 2014-10-03 09:09:36 +00:00
cbmem_info.c cbmem: use a single id to name mapping table 2014-05-14 22:53:16 +00:00
clog2.c
compute_ip_checksum.c
coreboot_table.c chromeos: move VPD MAC address retrieval function 2014-10-21 00:45:10 +00:00
debug.c
delay.c
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
generic_sdram.c
hardwaremain.c ramstage: remove rela_time use 2014-09-27 02:37:16 +00:00
hexdump.c Add simple hexdump function 2013-07-30 15:25:06 -07:00
jpeg.c
jpeg.h
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
lzmadecode.h
Makefile.inc verstage should include the CBFS SPI wrapper, when configured 2014-10-17 03:25:20 +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
memcpy.c
memmove.c
memrange.c coreboot memrange: Changes to memrange lib 2014-07-22 01:23:24 +00:00
memset.c
ne2k.c x86: Unify arch/io.h and arch/romcc_io.h 2013-03-22 00:00:09 +01:00
nrv2b.c
ns8390.h
primitive_memtest.c Primitive memory test 2014-07-03 02:56:56 +00:00
ramstage.ld New mechanism to define SRAM/memory map with automatic bounds checking 2014-10-03 09:09:36 +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: Change all SoC headers to <soc/headername.h> system 2014-10-22 04:06:10 +00:00
rmodule.c rmodule: Correct the typecast with proper parenthesis 2014-07-23 23:14:18 +00:00
rmodule.ld New mechanism to define SRAM/memory map with automatic bounds checking 2014-10-03 09:09:36 +00:00
romstage.ld New mechanism to define SRAM/memory map with automatic bounds checking 2014-10-03 09:09:36 +00:00
selfboot.c New mechanism to define SRAM/memory map with automatic bounds checking 2014-10-03 09:09:36 +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.c timer: generic udelay() 2014-09-29 08:42:38 +00: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 gpio: Remove non-ternary tristate mode, make ternaries easier 2014-10-23 01:41:42 +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