diff options
-rw-r--r-- | chip/stm32/build.mk | 7 | ||||
-rw-r--r-- | common/build.mk | 10 | ||||
-rw-r--r-- | core/cortex-m/build.mk | 4 | ||||
-rw-r--r-- | core/cortex-m/init.S | 4 | ||||
-rw-r--r-- | core/cortex-m/task.c | 2 | ||||
-rw-r--r-- | core/cortex-m0/build.mk | 4 | ||||
-rw-r--r-- | core/cortex-m0/init.S | 4 | ||||
-rw-r--r-- | core/cortex-m0/task.c | 2 | ||||
-rw-r--r-- | include/config.h | 12 | ||||
-rw-r--r-- | include/hooks.h | 6 | ||||
-rw-r--r-- | include/task.h | 4 |
11 files changed, 49 insertions, 10 deletions
diff --git a/chip/stm32/build.mk b/chip/stm32/build.mk index 2b0477518c..a4ce0f4bda 100644 --- a/chip/stm32/build.mk +++ b/chip/stm32/build.mk @@ -25,11 +25,14 @@ I2C_FAMILY=$(subst stm32f0,stm32l,$(CHIP_FAMILY)) # Select between 16-bit and 32-bit timer for clock source TIMER_TYPE=$(if $(CONFIG_STM_HWTIMER32),32,) -chip-y=dma.o hwtimer$(TIMER_TYPE).o system.o uart.o -chip-y+=jtag-$(CHIP_FAMILY).o clock-$(CHIP_FAMILY).o gpio-$(CHIP_FAMILY).o +chip-y=dma.o system.o +chip-y+=jtag-$(CHIP_FAMILY).o clock-$(CHIP_FAMILY).o chip-$(CONFIG_SPI)+=spi.o +chip-$(CONFIG_COMMON_GPIO)+=gpio-$(CHIP_FAMILY).o +chip-$(CONFIG_COMMON_TIMER)+=hwtimer$(TIMER_TYPE).o chip-$(CONFIG_I2C)+=i2c-$(I2C_FAMILY).o chip-$(CONFIG_WATCHDOG)+=watchdog.o +chip-$(HAS_TASK_CONSOLE)+=uart.o chip-$(HAS_TASK_KEYSCAN)+=keyboard_raw.o chip-$(HAS_TASK_POWERLED)+=power_led.o chip-$(CONFIG_FLASH)+=flash-$(FLASH_FAMILY).o diff --git a/common/build.mk b/common/build.mk index e2697c8c1c..cab075503a 100644 --- a/common/build.mk +++ b/common/build.mk @@ -6,9 +6,8 @@ # Common files build # -common-y=main.o util.o console_output.o uart_buffering.o -common-y+=memory_commands.o shared_mem.o system.o hooks.o -common-y+=gpio.o version.o printf.o queue.o +common-y=util.o +common-y+=version.o printf.o queue.o common-$(CONFIG_ACCEL_CALIBRATE)+=motion_calibrate.o common-$(CONFIG_ADC)+=adc.o @@ -30,7 +29,9 @@ common-$(CONFIG_CHARGER_V2)+=charge_state_v2.o # for ARM, not the charger driver for the tps65090. Rename. common-$(CONFIG_CHARGER_TPS65090)+=pmu_tps65090_charger.o common-$(CONFIG_CMD_I2CWEDGE)+=i2c_wedge.o +common-$(CONFIG_COMMON_GPIO)+=gpio.o common-$(CONFIG_COMMON_PANIC_OUTPUT)+=panic_output.o +common-$(CONFIG_COMMON_RUNTIME)+=hooks.o main.o system.o shared_mem.o common-$(CONFIG_COMMON_TIMER)+=timer.o common-$(CONFIG_PMU_POWERINFO)+=pmu_tps65090_powerinfo.o common-$(CONFIG_PMU_TPS65090)+=pmu_tps65090.o @@ -64,7 +65,8 @@ common-$(CONFIG_USB_PORT_POWER_SMART)+=usb_port_power_smart.o common-$(CONFIG_VBOOT_HASH)+=sha256.o vboot_hash.o common-$(CONFIG_WIRELESS)+=wireless.o common-$(HAS_TASK_CHIPSET)+=chipset.o throttle_ap.o -common-$(HAS_TASK_CONSOLE)+=console.o +common-$(HAS_TASK_CONSOLE)+=console.o console_output.o uart_buffering.o +common-$(HAS_TASK_CONSOLE)+=memory_commands.o common-$(HAS_TASK_HOSTCMD)+=acpi.o host_command.o host_event_commands.o common-$(HAS_TASK_KEYSCAN)+=keyboard_scan.o common-$(HAS_TASK_LIGHTBAR)+=lightbar.o diff --git a/core/cortex-m/build.mk b/core/cortex-m/build.mk index 741ec005cc..5306865984 100644 --- a/core/cortex-m/build.mk +++ b/core/cortex-m/build.mk @@ -17,6 +17,8 @@ CFLAGS_CPU+=-mthumb -Os -mno-sched-prolog CFLAGS_CPU+=-mno-unaligned-access CFLAGS_CPU+=$(CFLAGS_FPU-y) -core-y=cpu.o init.o panic.o switch.o task.o +core-y=cpu.o init.o +core-$(CONFIG_COMMON_PANIC_OUTPUT)+=panic.o +core-$(CONFIG_COMMON_RUNTIME)+=switch.o task.o core-$(CONFIG_WATCHDOG)+=watchdog.o core-$(CONFIG_MPU)+=mpu.o diff --git a/core/cortex-m/init.S b/core/cortex-m/init.S index 78c2307545..00072c7f0f 100644 --- a/core/cortex-m/init.S +++ b/core/cortex-m/init.S @@ -374,8 +374,12 @@ fini_loop: /* Default exception handler */ .thumb_func default_handler: +#ifdef CONFIG_COMMON_PANIC_OUTPUT b exception_panic +#endif + b reset +.align 2 _bss_start: .long __bss_start _bss_end: diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c index c0cbc84d59..5e309ef4cb 100644 --- a/core/cortex-m/task.c +++ b/core/cortex-m/task.c @@ -330,7 +330,7 @@ static uint32_t __wait_evt(int timeout_us, task_id_t resched) task_ *tsk = current_task; task_id_t me = tsk - tasks; uint32_t evt; - int ret; + int ret __attribute__((unused)); ASSERT(!in_interrupt_context()); diff --git a/core/cortex-m0/build.mk b/core/cortex-m0/build.mk index 6ee39c5669..9b5d63bb4d 100644 --- a/core/cortex-m0/build.mk +++ b/core/cortex-m0/build.mk @@ -13,5 +13,7 @@ CROSS_COMPILE?=arm-none-eabi- CFLAGS_CPU+=-mthumb -Os -mno-sched-prolog CFLAGS_CPU+=-mno-unaligned-access -core-y=cpu.o init.o panic.o switch.o task.o thumb_case.o div.o +core-y=cpu.o init.o thumb_case.o div.o +core-$(CONFIG_COMMON_PANIC_OUTPUT)+=panic.o +core-$(CONFIG_COMMON_RUNTIME)+=switch.o task.o core-$(CONFIG_WATCHDOG)+=watchdog.o diff --git a/core/cortex-m0/init.S b/core/cortex-m0/init.S index f868435157..98bdb89e19 100644 --- a/core/cortex-m0/init.S +++ b/core/cortex-m0/init.S @@ -133,8 +133,12 @@ fini_loop: /* Default exception handler */ .thumb_func default_handler: +#ifdef CONFIG_COMMON_PANIC_OUTPUT b exception_panic +#endif + b reset +.align 2 _bss_start: .long __bss_start _bss_end: diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c index 5072a9741e..b067e25f62 100644 --- a/core/cortex-m0/task.c +++ b/core/cortex-m0/task.c @@ -318,7 +318,7 @@ static uint32_t __wait_evt(int timeout_us, task_id_t resched) task_ *tsk = current_task; task_id_t me = tsk - tasks; uint32_t evt; - int ret; + int ret __attribute__((unused)); ASSERT(!in_interrupt_context()); diff --git a/include/config.h b/include/config.h index a80d256db6..8cfbb38a80 100644 --- a/include/config.h +++ b/include/config.h @@ -267,6 +267,18 @@ /* Provide common core code to output panic information without interrupts. */ #define CONFIG_COMMON_PANIC_OUTPUT +/* + * Provide the default GPIO abstraction layer. + * You want this unless you are doing a really tiny firmware. + */ +#define CONFIG_COMMON_GPIO + +/* + * Provide common runtime layer code (tasks, hooks ...) + * You want this unless you are doing a really tiny firmware. + */ +#define CONFIG_COMMON_RUNTIME + /* Provide common core code to handle the operating system timers. */ #define CONFIG_COMMON_TIMER diff --git a/include/hooks.h b/include/hooks.h index fb3e6c236b..944d44bd06 100644 --- a/include/hooks.h +++ b/include/hooks.h @@ -192,6 +192,7 @@ void hook_notify(enum hook_type type); */ int hook_call_deferred(void (*routine)(void), int us); +#ifdef CONFIG_COMMON_RUNTIME /** * Register a hook routine. * @@ -248,4 +249,9 @@ struct deferred_data { __attribute__((section(".rodata.deferred"))) \ = {routine} +#else /* CONFIG_COMMON_RUNTIME */ +#define DECLARE_HOOK(t, func, p) void unused_hook_##func(void) { func(); } +#define DECLARE_DEFERRED(func) void unused_deferred_##func(void) { func(); } +#endif /* CONFIG_COMMON_RUNTIME */ + #endif /* __CROS_EC_HOOKS_H */ diff --git a/include/task.h b/include/task.h index 4cbd60b857..723c6f0ad6 100644 --- a/include/task.h +++ b/include/task.h @@ -205,6 +205,10 @@ struct irq_priority { * Implement the DECLARE_IRQ(irq, routine, priority) macro which is * a core specific helper macro to declare an interrupt handler "routine". */ +#ifdef CONFIG_COMMON_RUNTIME #include "irq_handler.h" +#else +#define DECLARE_IRQ(irq, routine, priority) +#endif #endif /* __CROS_EC_TASK_H */ |