aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSubrata Banik <subratabanik@google.com>2024-02-26 12:09:14 +0530
committerSubrata Banik <subratabanik@google.com>2024-03-05 10:17:08 +0000
commitcac81cd120e30915ad322e03f3bb8f468e9851cb (patch)
tree1d301b6abbbe825681be0161f50e9253b2648665 /src
parentdc073ca75c105b6c471954aff0c913797467ff26 (diff)
vc/google/chromeos: Implement dynamic ChromeOS boot logo selection
* Introduces logic to display context-specific boot splash logos. * Logo selection considers: * Chromebook-Plus hardware compliance (using factory_config). * VPD-based product segmentation (soft-branded vs. regular chromebook). * Default Chromebook logo as fallback for regular Chromebook. This patch fixes the problem where existing logic was unable to pick correct ChromeOS boot splash logo based on the product segmentation. Relation between product segment and boot splash screen: 1. Chromebook-Plus Hard-branded device: Renders "cb_plus_logo.bmp" logo 2. Chromebook-Plus Soft-branded device: Renders "cb_plus_logo.bmp" logo 3. Regular Chromebook device: Renders "cb_logo.bmp" BUG=b:324107408 TEST=Verified logo selection based on compliance and product requirements. Change-Id: I9bb1e868764738333977bd8c990bea4253c9d37b Signed-off-by: Subrata Banik <subratabanik@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80738 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Dinesh Gehlot <digehlot@google.com> Reviewed-by: Eric Lai <ericllai@google.com> Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/vendorcode/google/chromeos/chromeos.h19
-rw-r--r--src/vendorcode/google/chromeos/splash.c4
-rw-r--r--src/vendorcode/google/chromeos/tpm_factory_config.c28
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;
}