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
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.
TEST=verified that nyan_big still reports proper revision ID.
Original-Signed-off-by: Vadim Bendebury <firstname.lastname@example.org>
Original-Reviewed-by: Aaron Durbin <email@example.com>
(cherry picked from commit c79ef1c545d073eaad69e6c8c629f9656b8c2f3e)
Signed-off-by: Marc Jones <firstname.lastname@example.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <email@example.com>
diff --git a/src/Kconfig b/src/Kconfig
index 26141fe..25184eb 100644
@@ -1122,6 +1122,13 @@
If enabled, the code coverage hooks in coreboot will output some
information about the coverage data that is dumped.
+ bool "Interpret board ID GPIOs as tertiary inputs"
+ default n
+ Consider each GPIO as being in one of three states: pulled down (0),
+ pulled up (1), or not connected (2)
# These probably belong somewhere else, but they are needed somewhere.
@@ -1184,4 +1191,4 @@
Internal option that sets the maximum number of bootblock executions allowed
with the normal image enabled before assuming the normal image is defective
- and switching to the fallback image.
\ No newline at end of file
+ and switching to the fallback image.