diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-09-20 14:00:45 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-09-23 21:26:29 +0000 |
commit | 29ee9c6d48910c8ce327ac1ccee18eaca9036eb1 (patch) | |
tree | 4cf80eba8c079749ac138d4caf58bebf7897ee26 /include | |
parent | 6277f7e336f0dc96b676905a4c420f9d53951603 (diff) | |
download | chrome-ec-29ee9c6d48910c8ce327ac1ccee18eaca9036eb1.tar.gz |
Support compiling with chipset task disabled
For bringup, we need to be able to compile a binary with the chipset
task disabled. Chipset functions should be stubbed to do nothing in
that case.
BUG=chrome-os-partner:22820
BRANCH=none
TEST=compile falco, pit, link with chipset task commented out in ec.tasklist
Change-Id: I73a4e09effb049f19b1a128e643b267d6469037b
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170221
Diffstat (limited to 'include')
-rw-r--r-- | include/chipset.h | 29 | ||||
-rw-r--r-- | include/chipset_haswell.h | 4 | ||||
-rw-r--r-- | include/chipset_ivybridge.h | 4 | ||||
-rw-r--r-- | include/chipset_x86_common.h | 4 |
4 files changed, 31 insertions, 10 deletions
diff --git a/include/chipset.h b/include/chipset.h index 932f1aec3e..ddf4eb3db0 100644 --- a/include/chipset.h +++ b/include/chipset.h @@ -35,6 +35,7 @@ enum chipset_state_mask { }; #ifdef HAS_TASK_CHIPSET + /** * Check if chipset is in a given state. * @@ -44,14 +45,7 @@ enum chipset_state_mask { * mask. */ int chipset_in_state(int state_mask); -#else -static inline int chipset_in_state(int state_mask) -{ - return 0; -} -#endif -#ifdef HAS_TASK_CHIPSET /** * Ask the chipset to exit the hard off state. * @@ -59,9 +53,6 @@ static inline int chipset_in_state(int state_mask) * state to begin with. */ void chipset_exit_hard_off(void); -#else -static inline void chipset_exit_hard_off(void) { } -#endif /* This is a private chipset-specific implementation for use only by * throttle_ap() . Don't call this directly! @@ -84,4 +75,22 @@ void chipset_force_shutdown(void); */ void chipset_reset(int cold_reset); +#else /* !HAS_TASK_CHIPSET */ +/* + * Allow other modules to compile if the chipset module is disabled. This is + * commonly done during early stages of board bringup. + */ + +static inline int chipset_in_state(int state_mask) +{ + return 0; +} + +static inline void chipset_exit_hard_off(void) { } +static inline void chipset_throttle_cpu(int throttle) { } +static inline void chipset_force_shutdown(void) { } +static inline void chipset_reset(int cold_reset) { } + +#endif /* !HAS_TASK_CHIPSET */ + #endif /* __CROS_EC_CHIPSET_H */ diff --git a/include/chipset_haswell.h b/include/chipset_haswell.h index ef61922008..5a4eaf9dc6 100644 --- a/include/chipset_haswell.h +++ b/include/chipset_haswell.h @@ -11,6 +11,10 @@ /** * Interrupt handler for Haswell-specific GPIOs. */ +#ifdef CONFIG_CHIPSET_HASWELL void haswell_interrupt(enum gpio_signal signal); +#else +#define haswell_interrupt NULL +#endif #endif diff --git a/include/chipset_ivybridge.h b/include/chipset_ivybridge.h index d88566948c..af752a9f97 100644 --- a/include/chipset_ivybridge.h +++ b/include/chipset_ivybridge.h @@ -11,6 +11,10 @@ /** * Interrupt handler for Ivy Bridge-specific GPIOs. */ +#ifdef CONFIG_CHIPSET_IVYBRIDGE void ivybridge_interrupt(enum gpio_signal signal); +#else +#define ivybridge_interrupt NULL +#endif #endif diff --git a/include/chipset_x86_common.h b/include/chipset_x86_common.h index a23b11661f..21576f1899 100644 --- a/include/chipset_x86_common.h +++ b/include/chipset_x86_common.h @@ -89,6 +89,10 @@ enum x86_state x86_handle_state(enum x86_state state); /** * Interrupt handler for x86 chipset GPIOs. */ +#ifdef CONFIG_CHIPSET_X86 void x86_interrupt(enum gpio_signal signal); +#else +#define x86_interrupt NULL +#endif #endif /* __CROS_EC_CHIPSET_X86_COMMON_H */ |