diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2012-01-25 21:47:20 +0000 |
---|---|---|
committer | Vincent Palatin <vpalatin@chromium.org> | 2012-01-25 22:50:07 +0000 |
commit | cf9fcef328900ae4460755cca01ec46e98b01732 (patch) | |
tree | 19e56762b6daa2b3abb2a2d2235d72dd417b3ed3 | |
parent | 645dad5d3f658d7c5e0d54453964e91afe7b43c0 (diff) | |
download | chrome-ec-cf9fcef328900ae4460755cca01ec46e98b01732.tar.gz |
Move OS files to a CPU specific directory
Preparatory work to introduce a second SoC : 3/5
We split the drivers files which contain SoC specific drivers from the
OS files which only depend the actual CPU core.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=None
TEST=run EC firmware on BDS and test a few commands on the console.
Change-Id: I598f8b23e074da9bd6b0e2ce6689c1075fe854f0
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | Makefile.rules | 2 | ||||
-rw-r--r-- | Makefile.toolchain | 2 | ||||
-rw-r--r-- | chip/lm4/build.mk | 6 | ||||
-rw-r--r-- | core/cortex-m/build.mk | 11 | ||||
-rw-r--r-- | core/cortex-m/ec.lds.S (renamed from chip/lm4/ec.lds.S) | 2 | ||||
-rw-r--r-- | core/cortex-m/init.S (renamed from chip/lm4/init.S) | 0 | ||||
-rw-r--r-- | core/cortex-m/panic.S (renamed from chip/lm4/panic.S) | 0 | ||||
-rw-r--r-- | core/cortex-m/switch.S (renamed from chip/lm4/switch.S) | 0 | ||||
-rw-r--r-- | core/cortex-m/task.c (renamed from chip/lm4/task.c) | 0 | ||||
-rw-r--r-- | core/cortex-m/timer.c (renamed from chip/lm4/timer.c) | 0 |
11 files changed, 21 insertions, 8 deletions
@@ -28,6 +28,7 @@ CPPFLAGS+=$(foreach t,$(_tsk_cfg),-D$(t)) # Get build configuration from sub-directories include board/$(BOARD)/build.mk include chip/$(CHIP)/build.mk +include core/$(CORE)/build.mk include common/build.mk include test/build.mk include util/build.mk @@ -35,11 +36,12 @@ include util/build.mk objs_from_dir=$(foreach obj,$(2), $(out)/$(1)/$(obj)) # Get all sources to build -all-y=$(call objs_from_dir,chip/$(CHIP),$(chip-y)) +all-y=$(call objs_from_dir,core/$(CORE),$(core-y)) +all-y+=$(call objs_from_dir,chip/$(CHIP),$(chip-y)) all-y+=$(call objs_from_dir,board/$(BOARD),$(board-y)) all-y+=$(call objs_from_dir,common,$(common-y)) all-y+=$(call objs_from_dir,test,$($(PROJECT)-y)) -dirs=chip/$(CHIP) board/$(BOARD) common test util +dirs=core/$(CORE) chip/$(CHIP) board/$(BOARD) common test util includes=include $(dirs) include Makefile.rules diff --git a/Makefile.rules b/Makefile.rules index 096c886304..31b0e5d70a 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -59,7 +59,7 @@ qemu-tests: $(qemu-test-targets) $(out)/firmware_image.lds: common/firmware_image.lds.S $(call quiet,lds,LDS ) -$(out)/%.lds: chip/$(CHIP)/ec.lds.S +$(out)/%.lds: core/$(CORE)/ec.lds.S $(call quiet,lds,LDS ) $(out)/%.bin: $(out)/%.obj diff --git a/Makefile.toolchain b/Makefile.toolchain index e3d59ea15e..6f75b65a45 100644 --- a/Makefile.toolchain +++ b/Makefile.toolchain @@ -25,7 +25,7 @@ CFLAGS_WARN=-Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ CFLAGS_DEBUG= -g CFLAGS_INCLUDE=$(foreach i,$(includes),-I$(i) ) CFLAGS_DEFINE=-DOUTDIR=$(out) -DCHIP=$(CHIP) -DTASKFILE=$(PROJECT).tasklist \ - -DBOARD=$(BOARD) -DBOARD_$(BOARD) + -DBOARD=$(BOARD) -DBOARD_$(BOARD) -DCORE=$(CORE) CPPFLAGS=$(CFLAGS_DEFINE) $(CFLAGS_INCLUDE) CFLAGS=$(CPPFLAGS) $(CFLAGS_CPU) $(CFLAGS_DEBUG) $(CFLAGS_WARN) BUILD_CFLAGS=$(CPPFLAGS) -O3 $(CFLAGS_DEBUG) $(CFLAGS_WARN) diff --git a/chip/lm4/build.mk b/chip/lm4/build.mk index a7fb4e740b..b69b2d7d9a 100644 --- a/chip/lm4/build.mk +++ b/chip/lm4/build.mk @@ -5,10 +5,10 @@ # LM4 chip specific files build # -# CPU specific compilation flags -CFLAGS_CPU=-mcpu=cortex-m4 -mthumb -Os -mno-sched-prolog +# LM4 SoC has a Cortex-M4 ARM core +CORE:=cortex-m -chip-y=init.o panic.o switch.o task.o timer.o pwm.o i2c.o adc.o jtag.o +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-$(CONFIG_TASK_KEYSCAN)+=keyboard_scan.o diff --git a/core/cortex-m/build.mk b/core/cortex-m/build.mk new file mode 100644 index 0000000000..8da6792154 --- /dev/null +++ b/core/cortex-m/build.mk @@ -0,0 +1,11 @@ +# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# Cortex-M4 core OS files build +# + +# CPU specific compilation flags +CFLAGS_CPU=-mcpu=cortex-m4 -mthumb -Os -mno-sched-prolog + +core-y=init.o panic.o switch.o task.o timer.o diff --git a/chip/lm4/ec.lds.S b/core/cortex-m/ec.lds.S index b64dea8398..35006ae77f 100644 --- a/chip/lm4/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -18,7 +18,7 @@ MEMORY SECTIONS { .text : { - OUTDIR/chip/CHIP/init.o (.text) + OUTDIR/core/CORE/init.o (.text) *(.text*) #ifdef COMPILE_FOR_RAM } > IRAM diff --git a/chip/lm4/init.S b/core/cortex-m/init.S index 6e3f3489e6..6e3f3489e6 100644 --- a/chip/lm4/init.S +++ b/core/cortex-m/init.S diff --git a/chip/lm4/panic.S b/core/cortex-m/panic.S index 4c87cac511..4c87cac511 100644 --- a/chip/lm4/panic.S +++ b/core/cortex-m/panic.S diff --git a/chip/lm4/switch.S b/core/cortex-m/switch.S index 4d974251cd..4d974251cd 100644 --- a/chip/lm4/switch.S +++ b/core/cortex-m/switch.S diff --git a/chip/lm4/task.c b/core/cortex-m/task.c index 2e0821e80f..2e0821e80f 100644 --- a/chip/lm4/task.c +++ b/core/cortex-m/task.c diff --git a/chip/lm4/timer.c b/core/cortex-m/timer.c index 56b67a9d2f..56b67a9d2f 100644 --- a/chip/lm4/timer.c +++ b/core/cortex-m/timer.c |