summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-08-07 15:28:47 -0700
committerChromeBot <chrome-bot@google.com>2013-08-08 13:51:31 -0700
commit01630180bb331be647f4062ff02280bd476a9b4d (patch)
tree923cd39a3d478ae02d6c39fb847a7d8961d2c988
parentef8637938e2e971ebdc80d8bb16ddddec983624c (diff)
downloadchrome-ec-01630180bb331be647f4062ff02280bd476a9b4d.tar.gz
Put knowledge of task-config dependency in config.h
Rather than have every board check for tasks before declaring their config macros, have config.h know what configs are invalid without their corresponding tasks. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms and pass unit tests Change-Id: Iecf6eb44782e15565eaaf6d69c6288ee8d2e4c4c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65010 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r--board/bolt/board.h4
-rw-r--r--board/daisy/board.h2
-rw-r--r--board/falco/board.h4
-rw-r--r--board/kirby/board.h2
-rw-r--r--board/link/board.h4
-rw-r--r--board/peppy/board.h4
-rw-r--r--board/pit/board.h4
-rw-r--r--board/puppy/board.h4
-rw-r--r--board/slippy/board.h4
-rw-r--r--board/snow/board.h2
-rw-r--r--board/spring/board.h2
-rw-r--r--board/wolf/board.h4
-rw-r--r--include/config.h42
13 files changed, 41 insertions, 41 deletions
diff --git a/board/bolt/board.h b/board/bolt/board.h
index c646456a95..d91df7f98c 100644
--- a/board/bolt/board.h
+++ b/board/bolt/board.h
@@ -15,15 +15,11 @@
#define CONFIG_TASK_PROFILING
/* Optional features */
-#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_X86
-#endif
#define CONFIG_CUSTOM_KEYSCAN
#define CONFIG_EXTPOWER_GPIO
#define CONFIG_KEYBOARD_BOARD_CONFIG
-#ifdef HAS_TASK_KEYPROTO
#define CONFIG_KEYBOARD_PROTOCOL_8042
-#endif
#define CONFIG_LED_DRIVER_DS2413
#define CONFIG_ONEWIRE
#define CONFIG_POWER_BUTTON
diff --git a/board/daisy/board.h b/board/daisy/board.h
index f5fbf656a0..b46e6172ae 100644
--- a/board/daisy/board.h
+++ b/board/daisy/board.h
@@ -14,9 +14,7 @@
/* Optional features */
#define CONFIG_BATTERY_SMART
#define CONFIG_CHARGER_TPS65090
-#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_GAIA
-#endif
#define CONFIG_I2C
#define CONFIG_KEYBOARD_PROTOCOL_MKBP
#define CONFIG_KEYBOARD_SUPPRESS_NOISE
diff --git a/board/falco/board.h b/board/falco/board.h
index c0b9f656cc..3591f7b0c4 100644
--- a/board/falco/board.h
+++ b/board/falco/board.h
@@ -15,16 +15,12 @@
#define CONFIG_CHARGER
#define CONFIG_CHARGER_BQ24738
#define CONFIG_CHARGER_DISCHARGE_ON_AC
-#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_HASWELL
#define CONFIG_CHIPSET_X86
-#endif
#define CONFIG_EXTPOWER_FALCO
#define CONFIG_EXTPOWER_GPIO
#define CONFIG_KEYBOARD_BOARD_CONFIG
-#ifdef HAS_TASK_KEYPROTO
#define CONFIG_KEYBOARD_PROTOCOL_8042
-#endif
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_X86
#define CONFIG_PWM_FAN
diff --git a/board/kirby/board.h b/board/kirby/board.h
index 2ac8ba6d8b..6eb58e5588 100644
--- a/board/kirby/board.h
+++ b/board/kirby/board.h
@@ -9,9 +9,7 @@
#define __BOARD_H
/* Optional features */
-#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_GAIA
-#endif
/* #define CONFIG_EXTPOWER_USB */
#define CONFIG_HOST_COMMAND_STATUS
#define CONFIG_I2C
diff --git a/board/link/board.h b/board/link/board.h
index c81db98525..fe1f0c1c2d 100644
--- a/board/link/board.h
+++ b/board/link/board.h
@@ -14,16 +14,12 @@
#define CONFIG_BOARD_VERSION
#define CONFIG_CHARGER
#define CONFIG_CHARGER_BQ24725
-#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_IVYBRIDGE
#define CONFIG_CHIPSET_X86
-#endif
#define CONFIG_EXTPOWER_GPIO
#define CONFIG_I2C_PASSTHRU_RESTRICTED
#define CONFIG_KEYBOARD_BOARD_CONFIG
-#ifdef HAS_TASK_KEYPROTO
#define CONFIG_KEYBOARD_PROTOCOL_8042
-#endif
#define CONFIG_LED_DRIVER_DS2413
#define CONFIG_ONEWIRE
#define CONFIG_POWER_BUTTON
diff --git a/board/peppy/board.h b/board/peppy/board.h
index db323df3e5..2e4f392842 100644
--- a/board/peppy/board.h
+++ b/board/peppy/board.h
@@ -16,15 +16,11 @@
#define CONFIG_CHARGER
#define CONFIG_CHARGER_BQ24707A
#define CONFIG_CHARGER_DISCHARGE_ON_AC
-#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_HASWELL
#define CONFIG_CHIPSET_X86
-#endif
#define CONFIG_EXTPOWER_GPIO
#define CONFIG_KEYBOARD_BOARD_CONFIG
-#ifdef HAS_TASK_KEYPROTO
#define CONFIG_KEYBOARD_PROTOCOL_8042
-#endif
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_X86
#define CONFIG_PWM_FAN
diff --git a/board/pit/board.h b/board/pit/board.h
index 046849cdc6..9f700a48dc 100644
--- a/board/pit/board.h
+++ b/board/pit/board.h
@@ -11,12 +11,8 @@
/* Optional features */
#define CONFIG_BATTERY_BQ20Z453
#define CONFIG_BATTERY_SMART
-#ifdef HAS_TASK_CHARGER
#define CONFIG_CHARGER_TPS65090
-#endif
-#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_GAIA
-#endif
#define CONFIG_CMD_PMU
#define CONFIG_EXTPOWER_GPIO
#define CONFIG_HOST_COMMAND_STATUS
diff --git a/board/puppy/board.h b/board/puppy/board.h
index 8a17472d8c..d6f6de4480 100644
--- a/board/puppy/board.h
+++ b/board/puppy/board.h
@@ -11,12 +11,8 @@
/* Optional features */
#define CONFIG_BATTERY_BQ20Z453
#define CONFIG_BATTERY_SMART
-#ifdef HAS_TASK_CHARGER
#define CONFIG_CHARGER_TPS65090
-#endif
-#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_GAIA
-#endif
#define CONFIG_CMD_PMU
#define CONFIG_EXTPOWER_GPIO
#define CONFIG_HOST_COMMAND_STATUS
diff --git a/board/slippy/board.h b/board/slippy/board.h
index aa0cf467e7..6d048503fe 100644
--- a/board/slippy/board.h
+++ b/board/slippy/board.h
@@ -16,15 +16,11 @@
#define CONFIG_CHARGER
#define CONFIG_CHARGER_BQ24707A
#define CONFIG_CHARGER_DISCHARGE_ON_AC
-#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_HASWELL
#define CONFIG_CHIPSET_X86
-#endif
#define CONFIG_EXTPOWER_GPIO
#define CONFIG_KEYBOARD_BOARD_CONFIG
-#ifdef HAS_TASK_KEYPROTO
#define CONFIG_KEYBOARD_PROTOCOL_8042
-#endif
#define CONFIG_LED_SLIPPY
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_X86
diff --git a/board/snow/board.h b/board/snow/board.h
index 1b97b05ebb..2c56d9d02a 100644
--- a/board/snow/board.h
+++ b/board/snow/board.h
@@ -19,9 +19,7 @@
#define CONFIG_BATTERY_SMART
#define CONFIG_BOARD_PRE_INIT
#define CONFIG_CHARGER_TPS65090
-#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_GAIA
-#endif
#define CONFIG_CMD_PMU
#define CONFIG_HOST_COMMAND_STATUS
#define CONFIG_I2C
diff --git a/board/spring/board.h b/board/spring/board.h
index 6fe6858908..2046ed9fd9 100644
--- a/board/spring/board.h
+++ b/board/spring/board.h
@@ -20,9 +20,7 @@
#define CONFIG_BATTERY_SMART
#define CONFIG_BOARD_PRE_INIT
#define CONFIG_CHARGER_TPS65090
-#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_GAIA
-#endif
#define CONFIG_CMD_PMU
#define CONFIG_CONSOLE_RESTRICTED_INPUT
#define CONFIG_EXTPOWER_USB
diff --git a/board/wolf/board.h b/board/wolf/board.h
index 7ade111cf0..ef04274398 100644
--- a/board/wolf/board.h
+++ b/board/wolf/board.h
@@ -10,15 +10,11 @@
/* Optional features */
#define CONFIG_BACKLIGHT_X86
-#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_HASWELL
#define CONFIG_CHIPSET_X86
-#endif
#define CONFIG_EXTPOWER_GPIO
#define CONFIG_KEYBOARD_BOARD_CONFIG
-#ifdef HAS_TASK_KEYPROTO
#define CONFIG_KEYBOARD_PROTOCOL_8042
-#endif
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_X86
#define CONFIG_PWM_FAN
diff --git a/include/config.h b/include/config.h
index 483a7e16b7..a5141db45b 100644
--- a/include/config.h
+++ b/include/config.h
@@ -97,7 +97,7 @@
#undef CONFIG_CHARGER_BQ24715
#undef CONFIG_CHARGER_BQ24725
#undef CONFIG_CHARGER_BQ24738
-#undef CONFIG_CHARGER_TPS65090
+#undef CONFIG_CHARGER_TPS65090 /* Note: does not use CONFIG_CHARGER */
/*
* Board specific charging current limit, in mA. If defined, the charge state
@@ -606,6 +606,7 @@
*/
#undef CONFIG_WP_ACTIVE_HIGH
+/*****************************************************************************/
/*
* Include board and core configs, since those hold the CONFIG_ constants for a
* given configuration. This guarantees they get included everywhere, and
@@ -617,6 +618,45 @@
*/
#include "config_chip.h"
#include "board.h"
+
+/*****************************************************************************/
+/*
+ * Handle task-dependent configs.
+ *
+ * This prevent sub-modules from being compiled when the task and parent module
+ * are not present.
+ */
+
+#ifndef HAS_TASK_CHARGER
+#undef CONFIG_CHARGER
+#undef CONFIG_CHARGER_BQ24707A
+#undef CONFIG_CHARGER_BQ24715
+#undef CONFIG_CHARGER_BQ24725
+#undef CONFIG_CHARGER_BQ24738
+#undef CONFIG_CHARGER_TPS65090
+#endif
+
+#ifndef HAS_TASK_CHIPSET
+#undef CONFIG_CHIPSET_GAIA
+#undef CONFIG_CHIPSET_HASWELL
+#undef CONFIG_CHIPSET_IVYBRIDGE
+#undef CONFIG_CHIPSET_X86
+#endif
+
+#ifndef HAS_TASK_KEYPROTO
+#undef CONFIG_KEYBOARD_PROTOCOL_8042
+/*
+ * Note that we don't undef CONFIG_KEYBOARD_PROTOCOL_MKBP, because it doesn't
+ * have its own task.
+ */
+#endif
+
+/*****************************************************************************/
+/*
+ * Apply test config overrides last, since tests need to override some of the
+ * config flags in non-standard ways to mock only parts of the system.
+ */
#include "test_config.h"
+
#endif /* __CROS_EC_CONFIG_H */