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 <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91474
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Subrata Banik 2026-02-28 16:10:48 +05:30
commit 270e84e59f
2 changed files with 14 additions and 10 deletions

View file

@ -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;
}

View file

@ -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.