Make more features optional

Preparatory work to introduce a second SoC : 2nd series 3/4

Some modules won't be used on other designs, make them optional.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=None
TEST=run the EC firmware on BDS and check that the commands from the
optional features are still available and working.

Change-Id: I979864ed94dc4da90c1010bd2e4589d84bc2d046
This commit is contained in:
Vincent Palatin
2012-01-26 01:05:45 +00:00
parent 1008124533
commit 1f00fc154a
4 changed files with 28 additions and 6 deletions

View File

@@ -8,7 +8,11 @@
# LM4 SoC has a Cortex-M4 ARM core
CORE:=cortex-m
chip-y=pwm.o i2c.o adc.o jtag.o
chip-y+=clock.o gpio.o system.o lpc.o uart.o power_button.o
chip-y+=flash.o watchdog.o eeprom.o temp_sensor.o hwtimer.o
chip-y=i2c.o adc.o jtag.o
chip-y+=clock.o gpio.o system.o uart.o power_button.o
chip-y+=watchdog.o eeprom.o hwtimer.o
chip-$(CONFIG_FLASH)+=flash.o
chip-$(CONFIG_LPC)+=lpc.o
chip-$(CONFIG_PWM)+=pwm.o
chip-$(CONFIG_TEMP_SENSOR)+=temp_sensor.o
chip-$(CONFIG_TASK_KEYSCAN)+=keyboard_scan.o

View File

@@ -31,5 +31,11 @@
/* build with assertions and debug messages */
#define CONFIG_DEBUG
/* Optional features */
#define CONFIG_FLASH
#define CONFIG_LPC
#define CONFIG_PWM
#define CONFIG_TEMP_SENSOR
/* Compile for running from RAM instead of flash */
/* #define COMPILE_FOR_RAM */

View File

@@ -5,9 +5,12 @@
# Common files build
#
common-y=main.o util.o console.o vboot.o pwm_commands.o
common-y+=flash_commands.o port80.o
common-y+=memory_commands.o shared_mem.o temp_sensor_commands.o usb_charge.o
common-y=main.o util.o console.o vboot.o
common-y+=memory_commands.o shared_mem.o usb_charge.o
common-$(CONFIG_LPC)+=port80.o
common-$(CONFIG_TASK_HOSTCMD)+=host_command.o
common-$(CONFIG_TASK_I8042CMD)+=i8042.o keyboard.o
common-$(CONFIG_TASK_X86POWER)+=x86_power.o
common-$(CONFIG_FLASH)+=flash_commands.o
common-$(CONFIG_PWM)+=pwm_commands.o
common-$(CONFIG_TEMP_SENSOR)+=temp_sensor_commands.o

View File

@@ -6,6 +6,7 @@
*/
#include "adc.h"
#include "config.h"
#include "clock.h"
#include "console.h"
#include "eeprom.h"
@@ -60,13 +61,21 @@ int main(void)
timer_init();
uart_init();
system_init();
#ifdef CONFIG_FLASH
flash_init();
#endif
eeprom_init();
#ifdef CONFIG_LPC
port_80_init();
lpc_init();
#endif
#ifdef CONFIG_PWM
pwm_init();
#endif
i2c_init();
#ifdef CONFIG_TEMP_SENSOR
temp_sensor_init();
#endif
power_button_init();
adc_init();
usb_charge_init();