mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-14 16:46:23 +00:00
chipset: Add callback for chipset pre-initialization
This change adds a callback for chipset_pre_init_callback which is made by x86 common power state machine when in G3S5 state. Until now, there was a hook CHIPSET_PRE_INIT_CALLBACK that was notified by chipset task when in G3S5 state. However, there are at least following reasons why this should be a callback and not a hook notification: 1. The initialization that is done as part of pre-init could be essential for the power state machine to make progress. Though the chipset task goes to sleep waiting for power signals after the hook notification, pre-initialization can all be done as part of a callback since it is mostly board-specific code that is doing work to initialize PMIC. 2. Typically, boards use I2C transactions to setup PMIC on getting chipset pre-init notification. However, since i2c transfers are not encouraged in hook task, they have to be deferred anyways. 3. Since the initialization is being done as part of hook task, use of any constructs e.g. pwr_5v_en_req which allows multiple consumers to enable/disable power rails will use task id for hook task. Instead it is better to provide correct information about the task by letting chipset task perform this request. Thus, this change adds a callback chipset_pre_init_callback in G3S5 state for x86 power state machine. This callback is guarded by CONFIG_CHIPSET_HAS_PRE_INIT_CALLBACK. The hook notification is left as is for now until all x86 boards are moved over to using the newly added callback. BUG=b:78259506 BRANCH=None TEST=None Change-Id: I2e1d73e5308759fef41680ae715ef71268b61780 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1018733 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
ff9248fbaa
commit
e54c3e1728
@@ -87,6 +87,11 @@ void power_interrupt(enum gpio_signal signal);
|
||||
*/
|
||||
void chipset_handle_espi_reset_assert(void);
|
||||
|
||||
/**
|
||||
* Perform chipset pre-initialization work within the context of chipset task.
|
||||
*/
|
||||
void chipset_pre_init_callback(void);
|
||||
|
||||
#else /* !HAS_TASK_CHIPSET */
|
||||
|
||||
/* When no chipset is present, assume it is always off. */
|
||||
|
||||
@@ -750,6 +750,9 @@
|
||||
/* Support PMIC reset(using LDO_EN) in chipset */
|
||||
#undef CONFIG_CHIPSET_HAS_PLATFORM_PMIC_RESET
|
||||
|
||||
/* Board requires chipset pre-init callback */
|
||||
#undef CONFIG_CHIPSET_HAS_PRE_INIT_CALLBACK
|
||||
|
||||
/* Redefine when we need a different power-on sequence on the same chipset. */
|
||||
#define CONFIG_CHIPSET_POWER_SEQ_VERSION 0
|
||||
|
||||
@@ -3533,7 +3536,6 @@
|
||||
#define CONFIG_CHIPSET_APL_GLK
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* Apply test config overrides last, since tests need to override some of the
|
||||
|
||||
@@ -308,6 +308,14 @@ enum power_state common_intel_x86_power_handle_state(enum power_state state)
|
||||
msleep(200);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CHIPSET_HAS_PRE_INIT_CALLBACK
|
||||
/*
|
||||
* Callback to do pre-initialization within the context of
|
||||
* chipset task.
|
||||
*/
|
||||
chipset_pre_init_callback();
|
||||
#endif
|
||||
|
||||
/* Call hooks to initialize PMIC */
|
||||
hook_notify(HOOK_CHIPSET_PRE_INIT);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user