From 270e84e59fee87c0054645c6aab606254147f06c Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Sat, 28 Feb 2026 16:10:48 +0530 Subject: [PATCH] vc/chromeos: Provide inline fallbacks for Chromebook Plus branding Currently, mainboards that do not support Google TPM must manually define stubs for chromeos_device_branded_plus_hard() and chromeos_device_branded_plus_soft() to satisfy the linker. Move these stubs into vendorcode/google/chromeos/chromeos.h as static inline functions when CONFIG(TPM_GOOGLE) is disabled. This reduces code duplication and allows the removal of redundant stub definitions in the ptlrvp mainboard. Change-Id: If270d4815c687a409fec7058c224f987f9e2741a Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/91474 Reviewed-by: Kapil Porwal Tested-by: build bot (Jenkins) --- src/mainboard/intel/ptlrvp/intel.c | 10 ---------- src/vendorcode/google/chromeos/chromeos.h | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/mainboard/intel/ptlrvp/intel.c b/src/mainboard/intel/ptlrvp/intel.c index 600d1b3bb7..5e0358ec86 100644 --- a/src/mainboard/intel/ptlrvp/intel.c +++ b/src/mainboard/intel/ptlrvp/intel.c @@ -23,13 +23,3 @@ int get_recovery_mode_switch(void) { return 0; } - -bool chromeos_device_branded_plus_hard(void) -{ - return false; -} - -bool chromeos_device_branded_plus_soft(void) -{ - return false; -} diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h index 540f3635aa..d8f7e6117c 100644 --- a/src/vendorcode/google/chromeos/chromeos.h +++ b/src/vendorcode/google/chromeos/chromeos.h @@ -34,6 +34,8 @@ void chromeos_set_ramoops(void *ram_oops, size_t size); * Return "UNDEFINED_FACTORY_CONFIG" in case of error. */ uint64_t chromeos_get_factory_config(void); + +#if CONFIG(TPM_GOOGLE) /* * Determines whether a ChromeOS device is branded as a Chromebook-Plus * based on specific bit flags: @@ -57,6 +59,18 @@ bool chromeos_device_branded_plus_hard(void); * To be considered a soft-branded Chromebook-Plus, both of these conditions need to be met. */ bool chromeos_device_branded_plus_soft(void); +#else +/* Inline fallback for platforms without Google TPM */ +static inline bool chromeos_device_branded_plus_hard(void) +{ + return false; +} + +static inline bool chromeos_device_branded_plus_soft(void) +{ + return false; +} +#endif /* * Declaration for mainboards to use to generate ACPI-specific ChromeOS needs.