summaryrefslogtreecommitdiffstats
path: root/src/target
diff options
context:
space:
mode:
authorIngo Albrecht <prom@berlin.ccc.de>2010-04-11 08:04:20 +0200
committerIngo Albrecht <prom@berlin.ccc.de>2010-07-20 14:41:19 +0200
commit0068f87c1fa8e8ee788851b67f39dfd9ae307cb8 (patch)
tree7489a95e92bd7b8536be7fb2b78e8be20ae16eb0 /src/target
parent3936c397a7918fa8625355b5af39a371da6adc3a (diff)
firmware: linker script and startup code reorg.
Diffstat (limited to 'src/target')
-rw-r--r--src/target/firmware/Makefile43
-rw-r--r--src/target/firmware/Makefile.inc14
-rw-r--r--src/target/firmware/board/common/compal_osmoload.lds98
-rw-r--r--src/target/firmware/board/compal/ram.lds (renamed from src/target/firmware/board/common/compal_ramload.lds)7
-rw-r--r--src/target/firmware/board/compal/rffe_dualband.c (renamed from src/target/firmware/board/common/rffe_compal_dualband.c)0
-rw-r--r--src/target/firmware/board/compal/start.S (renamed from src/target/firmware/board/common/compal_ramload_start.S)0
-rw-r--r--src/target/firmware/board/compal_e88/loader.lds (renamed from src/target/firmware/board/common/compal_app.lds)0
7 files changed, 50 insertions, 112 deletions
diff --git a/src/target/firmware/Makefile b/src/target/firmware/Makefile
index 6e34c967..56c08273 100644
--- a/src/target/firmware/Makefile
+++ b/src/target/firmware/Makefile
@@ -8,28 +8,49 @@ DISPLAY_OBJS=display/font_r8x8.o display/font_r8x8_horiz.o display/st7558.o disp
ABB_OBJS=abb/twl3025.o
RF_OBJS=rf/trf6151.o
-# Board- and environment-specific startup code and linker script
-START=board/common/compal_ramload_start.S
-
# List of all supported boards
BOARDS?=compal_e88 compal_e99 gta0x
-compal_COMMON_OBJS=board/common/rffe_compal_dualband.o board/common/calypso_uart.o board/common/calypso_pwl.o
-gta0x_COMMON_OBJS=board/common/rffe_gta0x_triband.o board/common/calypso_uart.o board/common/calypso_pwl.o
+
+# TI Calypso
+
+calypso_COMMON_OBJS=board/common/calypso_uart.o board/common/calypso_pwl.o
+
+# OpenMoko GTA0x
+
+gta0x_COMMON_OBJS=board/common/rffe_gta0x_triband.o $(calypso_COMMON_OBJS)
+
+# Compal Generic
+
+compal_COMMON_OBJS=board/compal/start.o $(calypso_COMMON_OBJS) board/compal/rffe_dualband.o
+compal_COMMON_ENVIRONMENTS=compalram
+
+compalram_LDS=board/compal/ram.lds
+
+# Compal E88
+
compal_e88_OBJS=$(compal_COMMON_OBJS) board/compal_e88/init.o
+compal_e88_ENVIRONMENTS=$(compal_COMMON_ENVIRONMENTS) e88loader
+
+e88loader_LDS=board/compal_e88/loader.lds
+e88flash_LDS=board/compal_e88/flash.lds
+
+# Compal E99
+
compal_e99_OBJS=$(compal_COMMON_OBJS) board/compal_e99/init.o
+
gta0x_OBJS=$(gta0x_COMMON_OBJS) board/gta0x/init.o
-# List of all supported execution environments
-ENVIRONMENTS?=app ramload osmoload
-app_LDS=board/common/compal_app.lds
-ramload_LDS=board/common/compal_ramload.lds
-osmoload_LDS=board/common/compal_osmoload.lds
+compal_e99_ENVIRONMENTS=$(compal_COMMON_ENVIRONMENTS)
+
+e99loader_LDS=board/compal_e99/loader.lds
+e99flash_LDS=board/compal_e99/flash.lds
+
# List of all applications (add yours here!)
APPLICATIONS=hello_world compal_dsp_dump layer1 loader simtest
# Things that go in all applications
-ANY_APP_OBJS+=$(START:.S=.o) $(ABB_OBJS) $(RF_OBJS) $(DISPLAY_OBJS) $(FLASH_OBJS)
+ANY_APP_OBJS+=$(ABB_OBJS) $(RF_OBJS) $(DISPLAY_OBJS) $(FLASH_OBJS)
ANY_APP_LIBS+=calypso/libcalypso.a layer1/liblayer1.a lib/libmini.a comm/libcomm.a ../../shared/libosmocore/build-target/src/.libs/libosmocore.a
# Libraries are defined in subdirectories
diff --git a/src/target/firmware/Makefile.inc b/src/target/firmware/Makefile.inc
index eec793d7..b3b64a63 100644
--- a/src/target/firmware/Makefile.inc
+++ b/src/target/firmware/Makefile.inc
@@ -111,9 +111,16 @@ ALL_DEPS+=$$($(1)_OBJS:.o=.p) apps/$(1)/main.p
endef
# define rules for all defined applications
-$(foreach app,$(APPLICATIONS),$(foreach brd,$(BOARDS),$(foreach env,$(ENVIRONMENTS),$(eval $(call APPLICATION_BOARD_ENVIRONMENT_template,$(app),$(brd),$(env))))))
-$(foreach brd,$(BOARDS),$(eval $(call BOARD_template,$(brd))))
-$(foreach app,$(APPLICATIONS),$(eval $(call APPLICATION_template,$(app))))
+$(foreach app,$(APPLICATIONS), \
+ $(foreach brd,$(BOARDS), \
+ $(foreach env,$($(brd)_ENVIRONMENTS), \
+ $(eval $(call APPLICATION_BOARD_ENVIRONMENT_template,$(app),$(brd),$(env))))))
+
+$(foreach brd,$(BOARDS), \
+ $(eval $(call BOARD_template,$(brd))))
+
+$(foreach app,$(APPLICATIONS), \
+ $(eval $(call APPLICATION_template,$(app))))
#### LIBRARY RULES ####
@@ -177,6 +184,7 @@ clean:
.PHONY: distclean
distclean: clean
+ find . -name '*.o' -or -name '*.bin' -or -name '*.map' -or -name '*.lst' -or -name '*.p' -exec rm '{}' ';'
#### DEPENDENCY LOAD ####
diff --git a/src/target/firmware/board/common/compal_osmoload.lds b/src/target/firmware/board/common/compal_osmoload.lds
deleted file mode 100644
index 2765ec22..00000000
--- a/src/target/firmware/board/common/compal_osmoload.lds
+++ /dev/null
@@ -1,98 +0,0 @@
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-ENTRY(_start)
-MEMORY
-{
- /* compal-loaded binary: text, initialized data */
- LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00010000
- /* compal-loaded binary: unitialized data, stacks, heap */
- DRAM (rw) : ORIGIN = 0x00810000, LENGTH = 0x00010000
- /* remainder of internal ram: this is where we are linking to */
- IRAM (rw) : ORIGIN = 0x00820000, LENGTH = 0x00020000
-}
-SECTIONS
-{
- . = 0x820000;
-
- /* initialization code */
- . = ALIGN(4);
- .text.start : {
- PROVIDE(_start = .);
- KEEP(*(.text.start))
- *(.text.start)
- } > IRAM
-
- /* exception vectors from 0x80001c to 0x800034 */
- .text.exceptions 0x80001c : AT (LOADADDR(.text.start) + SIZEOF(.text.start)) {
- KEEP(*(.text.exceptions))
- * (.text.exceptions)
- . = ALIGN(4);
-
- /* constructors and destructors */
- . = ALIGN(4);
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- KEEP(*(SORT(.ctors)))
- LONG(0) /* end of list */
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- KEEP(*(SORT(.dtors)))
- LONG(0) /* end of list */
- __DTOR_END__ = .;
- } > LRAM
- PROVIDE(_exceptions = LOADADDR(.text.exceptions));
-
- /* code */
- . = ALIGN(4);
- .text (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) :
- AT (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) {
- /* regular code */
- *(.text*)
- /* gcc voodoo */
- *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
- } > IRAM
- PROVIDE(_text_start = LOADADDR(.text));
- PROVIDE(_text_end = LOADADDR(.text) + SIZEOF(.text));
-
- /* read-only data */
- . = ALIGN(4);
- .rodata : {
- *(.rodata*)
- } > IRAM
- PROVIDE(_rodata_start = LOADADDR(.rodata));
- PROVIDE(_rodata_end = LOADADDR(.rodata) + SIZEOF(.rodata));
-
- /* initialized data */
- . = ALIGN(4);
- .data : {
- *(.data)
- } > IRAM
- PROVIDE(_data_start = LOADADDR(.data));
- PROVIDE(_data_end = LOADADDR(.data) + SIZEOF(.data));
-
- /* pic offset tables */
- . = ALIGN(4);
- .got : {
- *(.got)
- *(.got.plt) *(.igot.plt) *(.got) *(.igot)
- } > IRAM
- PROVIDE(_got_start = LOADADDR(.got));
- PROVIDE(_got_end = LOADADDR(.got) + SIZEOF(.got));
-
- /* uninitialized data */
- .bss (NOLOAD) : {
- . = ALIGN(4);
- __bss_start = .;
- *(.bss)
- } > IRAM
- . = ALIGN(4);
- __bss_end = .;
- PROVIDE(_bss_start = __bss_start);
- PROVIDE(_bss_end = __bss_end);
-
- /* end of image */
- . = ALIGN(4);
- _end = .;
- PROVIDE(end = .);
-}
diff --git a/src/target/firmware/board/common/compal_ramload.lds b/src/target/firmware/board/compal/ram.lds
index 00f0d001..d6df49a9 100644
--- a/src/target/firmware/board/common/compal_ramload.lds
+++ b/src/target/firmware/board/compal/ram.lds
@@ -1,3 +1,10 @@
+/*
+ * Linker script for running from internal SRAM on Compal phones
+ *
+ * This script is tailored specifically to the requirements imposed
+ * on us by the Compal bootloader.
+ *
+ */
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
diff --git a/src/target/firmware/board/common/rffe_compal_dualband.c b/src/target/firmware/board/compal/rffe_dualband.c
index bfd3d98e..bfd3d98e 100644
--- a/src/target/firmware/board/common/rffe_compal_dualband.c
+++ b/src/target/firmware/board/compal/rffe_dualband.c
diff --git a/src/target/firmware/board/common/compal_ramload_start.S b/src/target/firmware/board/compal/start.S
index 3036fec9..3036fec9 100644
--- a/src/target/firmware/board/common/compal_ramload_start.S
+++ b/src/target/firmware/board/compal/start.S
diff --git a/src/target/firmware/board/common/compal_app.lds b/src/target/firmware/board/compal_e88/loader.lds
index 3d821ae8..3d821ae8 100644
--- a/src/target/firmware/board/common/compal_app.lds
+++ b/src/target/firmware/board/compal_e88/loader.lds