summaryrefslogtreecommitdiff
path: root/common/main.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-04-19 12:42:35 -0700
committerRandall Spangler <rspangler@chromium.org>2012-04-19 13:08:58 -0700
commitf4e772708bde3e4e1d184190a7f0be2417d2029a (patch)
tree4b668c02a9a6dca2704e6d0a8b3cb8e5c9e95b76 /common/main.c
parentd5d2159c6d215b3a0feca42d961985cd37603ca8 (diff)
downloadchrome-ec-f4e772708bde3e4e1d184190a7f0be2417d2029a.tar.gz
Added HOOK_INIT for driver module inits
This covers modules which need to initialize before task_start(), but don't particularly care in what order they're initialized. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=if it boots, it works Change-Id: I69829aac8d1c3c14ee04916a794b84bbf03a09eb
Diffstat (limited to 'common/main.c')
-rw-r--r--common/main.c54
1 files changed, 6 insertions, 48 deletions
diff --git a/common/main.c b/common/main.c
index 606a04d830..ce3d6fad68 100644
--- a/common/main.c
+++ b/common/main.c
@@ -5,36 +5,20 @@
* Main routine for Chrome EC
*/
-#include "adc.h"
-#include "charger.h"
-#include "chip_temp_sensor.h"
#include "clock.h"
#include "config.h"
-#include "console.h"
#include "eeprom.h"
#include "eoption.h"
#include "flash.h"
#include "gpio.h"
-#include "i2c.h"
+#include "hooks.h"
#include "jtag.h"
#include "keyboard.h"
#include "keyboard_scan.h"
-#include "lpc.h"
-#include "memory_commands.h"
-#include "onewire.h"
-#include "peci.h"
-#include "port80.h"
-#include "power_button.h"
-#include "powerdemo.h"
-#include "pwm.h"
-#include "spi.h"
#include "system.h"
#include "task.h"
-#include "temp_sensor.h"
-#include "tmp006.h"
#include "timer.h"
#include "uart.h"
-#include "usb_charge.h"
#include "vboot.h"
#include "watchdog.h"
@@ -114,38 +98,12 @@ int main(void)
* RO image and once in the RW image. */
vboot_init();
- /* Initialize driver modules. These can occur in any order. State
- * machines are initialized in their task functions, not here. */
+ /* TODO: reduce core clock now that vboot is done */
- gpio_init();
-
-#ifdef CONFIG_LPC
- lpc_init();
-#endif
-#ifdef CONFIG_SPI
- spi_init();
-#endif
-#ifdef CONFIG_PWM
- pwm_init();
-#endif
-#ifdef CONFIG_I2C
- i2c_init();
-#endif
-#ifdef CONFIG_TASK_POWERBTN
- power_button_init();
-#endif
-#ifdef CONFIG_ADC
- adc_init();
-#endif
-#ifdef CONFIG_ONEWIRE
- onewire_init();
-#endif
-#ifdef CONFIG_PECI
- peci_init();
-#endif
-#ifdef CONFIG_USB_CHARGE
- usb_charge_init();
-#endif
+ /* Initialize other driver modules. These can occur in any order.
+ * Non-driver modules with tasks do their inits from their task
+ * functions, not here. */
+ hook_notify(HOOK_INIT, 0);
/* Print the init time and reset cause. Init time isn't completely
* accurate because it can't take into account the time for the first