summaryrefslogtreecommitdiff
path: root/src/mainboard/google/zork
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/zork')
-rw-r--r--src/mainboard/google/zork/Kconfig28
-rw-r--r--src/mainboard/google/zork/variants/baseboard/helpers.c25
-rw-r--r--src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h4
3 files changed, 57 insertions, 0 deletions
diff --git a/src/mainboard/google/zork/Kconfig b/src/mainboard/google/zork/Kconfig
index 6160021cba..bf2fe2e36b 100644
--- a/src/mainboard/google/zork/Kconfig
+++ b/src/mainboard/google/zork/Kconfig
@@ -169,6 +169,34 @@ config VARIANT_SUPPORTS_PRE_V3_SCHEMATICS
longer has to support pre-v3 schematics, `default y` entry
for it can be dropped.
+config VARIANT_SUPPORTS_PRE_V3_6_SCHEMATICS
+ bool
+ default y if BOARD_GOOGLE_TREMBYLE
+ default y if BOARD_GOOGLE_EZKINIL
+ default y if BOARD_GOOGLE_MORPHIUS
+ default y if BOARD_GOOGLE_BERKNIP
+ default y if BOARD_GOOGLE_DALBOZ
+ default y if BOARD_GOOGLE_WOOMAX
+ default y if BOARD_GOOGLE_VILBOZ
+ default y if BOARD_GOOGLE_DIRINBOZ
+ default n
+
+config VARIANT_MIN_BOARD_ID_V3_6_SCHEMATICS
+ int
+ depends on VARIANT_SUPPORTS_PRE_V3_6_SCHEMATICS
+ default 4 if BOARD_GOOGLE_TREMBYLE
+ default 3 if BOARD_GOOGLE_EZKINIL
+ default 4 if BOARD_GOOGLE_MORPHIUS
+ default 3 if BOARD_GOOGLE_BERKNIP
+ default 3 if BOARD_GOOGLE_DALBOZ
+ default 2 if BOARD_GOOGLE_WOOMAX
+ default 2 if BOARD_GOOGLE_VILBOZ
+ default 2 if BOARD_GOOGLE_DIRINBOZ
+ default 256
+ help
+ Minimum board version where the variant starts supporting
+ v3.6+ version of reference schematics.
+
config VARIANT_MIN_BOARD_ID_V3_SCHEMATICS
int
depends on VARIANT_SUPPORTS_PRE_V3_SCHEMATICS
diff --git a/src/mainboard/google/zork/variants/baseboard/helpers.c b/src/mainboard/google/zork/variants/baseboard/helpers.c
index 0a1cf5ccd1..7dc9fd3bd1 100644
--- a/src/mainboard/google/zork/variants/baseboard/helpers.c
+++ b/src/mainboard/google/zork/variants/baseboard/helpers.c
@@ -130,6 +130,31 @@ bool variant_uses_v3_schematics(void)
return true;
}
+bool variant_uses_v3_6_schematics(void)
+{
+ uint32_t board_version;
+
+ if (!CONFIG(VARIANT_SUPPORTS_PRE_V3_6_SCHEMATICS))
+ return true;
+
+ if (google_chromeec_cbi_get_board_version(&board_version))
+ return false;
+
+ if ((int)board_version < CONFIG_VARIANT_MIN_BOARD_ID_V3_6_SCHEMATICS)
+ return false;
+
+ return true;
+}
+
+/*
+ * pre-v3.6, CODEC_GPI was used as headphone jack interrupt.
+ * Starting v3.6 this was changed to a separate GPIO.
+ */
+bool variant_uses_codec_gpi(void)
+{
+ return !variant_uses_v3_6_schematics();
+}
+
bool variant_has_active_low_wifi_power(void)
{
uint32_t board_version;
diff --git a/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h
index 6b9bbfd3bc..8770944993 100644
--- a/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h
@@ -66,6 +66,10 @@ int boot_is_factory_unprovisioned(void);
/* Return true if variant uses v3 version of reference schematics. */
bool variant_uses_v3_schematics(void);
+/* Return true if variant uses v3.6 version of reference schematics. */
+bool variant_uses_v3_6_schematics(void);
+/* Return true if variant uses CODEC_GPI pin for headphone jack interrupt. */
+bool variant_uses_codec_gpi(void);
/* Return true if variant has active low power enable fow WiFi. */
bool variant_has_active_low_wifi_power(void);