lib: Add boot mode information to coreboot tables
This change introduces `LB_TAG_BOOT_MODE` to the coreboot tables to convey platform boot information to the payload. The new `lb_boot_mode` struct uses `enum boot_mode_t` to specify whether the device is booting in `normal mode`, `low-battery mode` or `off-mode charging`. This is crucial for platforms where the Application Processor (AP) manages the charging solution, as it provides the necessary context for the payload's charger driver. By passing this data through the coreboot table, we avoid redundant implementation and ensure consistent battery and charging information is available across both coreboot and the payload. A new weak function, `lb_add_boot_mode`, is also introduced. This function can be overridden by platforms that require this data to add the boot mode information to the coreboot table. TEST=Able to build and boot google/quenbi. Change-Id: I5aea72c02b4d6c856e2504f4007de584c59ee89f Signed-off-by: Subrata Banik <subratabanik@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/88992 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
parent
c73f30e74b
commit
a45c8441af
3 changed files with 31 additions and 0 deletions
|
|
@ -96,6 +96,7 @@ enum {
|
|||
LB_TAG_OPTION_ENUM = 0x00ca,
|
||||
LB_TAG_OPTION_DEFAULTS = 0x00cb,
|
||||
LB_TAG_OPTION_CHECKSUM = 0x00cc,
|
||||
LB_TAG_BOOT_MODE = 0x00cd,
|
||||
};
|
||||
|
||||
/* All table entry base addresses and sizes must be 4-byte aligned. */
|
||||
|
|
@ -621,4 +622,22 @@ struct lb_cfr {
|
|||
/* struct lb_cfr_option_form forms[] */
|
||||
};
|
||||
|
||||
enum boot_mode_t {
|
||||
LB_BOOT_MODE_NORMAL,
|
||||
LB_BOOT_MODE_LOW_BATTERY,
|
||||
LB_BOOT_MODE_OFFMODE_CHARGING,
|
||||
};
|
||||
|
||||
/*
|
||||
* Boot Mode: Pass the platform boot mode information to payload about
|
||||
* booting in low-battery mode or off-mode charging. These information
|
||||
* is useful for payload to implement charger driver.
|
||||
*/
|
||||
struct lb_boot_mode {
|
||||
uint32_t tag;
|
||||
uint32_t size;
|
||||
|
||||
enum boot_mode_t boot_mode;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue