diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vendorcode/google/chromeos/chromeos.h | 19 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/splash.c | 4 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/tpm_factory_config.c | 28 |
3 files changed, 37 insertions, 14 deletions
diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h index a4315c360f..540f3635aa 100644 --- a/src/vendorcode/google/chromeos/chromeos.h +++ b/src/vendorcode/google/chromeos/chromeos.h @@ -35,17 +35,28 @@ void chromeos_set_ramoops(void *ram_oops, size_t size); */ uint64_t chromeos_get_factory_config(void); /* - * Determines whether a ChromeOS device is branded as a Chromebook Plus + * Determines whether a ChromeOS device is branded as a Chromebook-Plus * based on specific bit flags: * * - Bit 4 (0x10): Indicates whether the device chassis has the * "chromebook-plus" branding. - * - Bits 3-0 (0x1): Must be 0x1 to signify compliance with Chromebook Plus + * - Bits 3-0 (0x1): Must be 0x1 to signify compliance with Chromebook-Plus * hardware specifications. * - * To be considered a Chromebook Plus, either of these conditions needs to be met. + * To be considered a Chromebook-Plus, both of these conditions need to be met. */ -bool chromeos_device_branded_plus(void); +bool chromeos_device_branded_plus_hard(void); + +/* + * Determines whether a ChromeOS device is soft-branded as a Chromebook-Plus + * after meeting below conditions: + * + * - Device is compliant to the Chromebook-Plus Hardware Specification. + * - Business decision makes this device qualified as Chromebook-Plus. + * + * To be considered a soft-branded Chromebook-Plus, both of these conditions need to be met. + */ +bool chromeos_device_branded_plus_soft(void); /* * Declaration for mainboards to use to generate ACPI-specific ChromeOS needs. diff --git a/src/vendorcode/google/chromeos/splash.c b/src/vendorcode/google/chromeos/splash.c index 3532fb8f5a..f63f52615c 100644 --- a/src/vendorcode/google/chromeos/splash.c +++ b/src/vendorcode/google/chromeos/splash.c @@ -5,7 +5,9 @@ const char *bmp_logo_filename(void) { - if (chromeos_device_branded_plus()) + if (chromeos_device_branded_plus_hard()) + return "cb_plus_logo.bmp"; + else if (chromeos_device_branded_plus_soft()) return "cb_plus_logo.bmp"; else return "cb_logo.bmp"; diff --git a/src/vendorcode/google/chromeos/tpm_factory_config.c b/src/vendorcode/google/chromeos/tpm_factory_config.c index 44fb9f0fef..5ce08626d9 100644 --- a/src/vendorcode/google/chromeos/tpm_factory_config.c +++ b/src/vendorcode/google/chromeos/tpm_factory_config.c @@ -2,13 +2,12 @@ #include <assert.h> #include <console/console.h> +#include <drivers/vpd/vpd.h> #include <security/tpm/tss.h> #include <types.h> #include <vendorcode/google/chromeos/chromeos.h> #define CHROMEBOOK_PLUS_HARD_BRANDED BIT(4) -#define CHROMEBOOK_PLUS_SOFT_BRANDED BIT(0) -#define CHROMEBOOK_PLUS_DEVICE (CHROMEBOOK_PLUS_HARD_BRANDED | CHROMEBOOK_PLUS_SOFT_BRANDED) uint64_t chromeos_get_factory_config(void) { @@ -39,22 +38,33 @@ uint64_t chromeos_get_factory_config(void) } /* - * Determines whether a ChromeOS device is branded as a Chromebook Plus + * Determines whether a ChromeOS device is branded as a Chromebook-Plus * based on specific bit flags: * * - Bit 4 (0x10): Indicates whether the device chassis has the * "chromebook-plus" branding. - * - Bits 3-0 (0x1): Must be 0x1 to signify compliance with Chromebook Plus - * hardware specifications. - * - * To be considered a Chromebook Plus, either of these conditions needs to be met. */ -bool chromeos_device_branded_plus(void) +bool chromeos_device_branded_plus_hard(void) { uint64_t factory_config = chromeos_get_factory_config(); if (factory_config == UNDEFINED_FACTORY_CONFIG) return false; - return factory_config & CHROMEBOOK_PLUS_DEVICE; + return (factory_config & CHROMEBOOK_PLUS_HARD_BRANDED) == CHROMEBOOK_PLUS_HARD_BRANDED; +} + +/* + * Use 'feature_level' populated by ChromeOS libsegmentation library to know if the device + * is a chromebook plus or not. + * + * Note: After powerwash or dev/normal mode switch, the splash screen may be incorrect + * on first boot until VPD is updated. + */ +bool chromeos_device_branded_plus_soft(void) +{ + if (vpd_get_feature_level() > 1) + return true; + + return false; } |