lm32: port umon_apps/lwip
authorMichael Walle <michael@walle.cc>
Fri, 14 May 2010 21:14:49 +0000 (23:14 +0200)
committerMichael Walle <michael@walle.cc>
Fri, 14 May 2010 21:14:49 +0000 (23:14 +0200)
umon_apps/lwip/crt0_lm32.S [new file with mode: 0644]
umon_apps/lwip/main.c
umon_apps/lwip/makefile

diff --git a/umon_apps/lwip/crt0_lm32.S b/umon_apps/lwip/crt0_lm32.S
new file mode 100644 (file)
index 0000000..74b2463
--- /dev/null
@@ -0,0 +1,16 @@
+#include "cfg.h"
+
+#if USE_APPSTACK
+       .extern AppStack
+       .extern Cstart
+       .global start
+
+    /* Set stack pointer to end of AppStack and jump to Cstart:
+        */
+start:
+       mvhi sp, hi(AppStack + APPSTACKSIZE - 4)
+       ori sp, sp, lo(AppStack + APPSTACKSIZE -4)
+
+jump_to_c:
+    bi Cstart
+#endif
index 44c4674..e9b6940 100755 (executable)
@@ -204,6 +204,10 @@ clock_time(void)
 #if CLOCK_MS
 #error: Gotta write clock_time for 68K.
 #endif
+#elif CPU_IS_LM32
+#if CLOCK_MS
+#error: Gotta write clock_time for LM32.
+#endif
 #else
 #error: Invalid CPU specification.
 #endif
index 29afbea..97a9499 100755 (executable)
@@ -76,6 +76,15 @@ CLOCK_MS     = 0
 ENDIANNESS     = -D BYTE_ORDER=LITTLE_ENDIAN
 endif
 
+ifeq ($(PORT),MILKYMIST)
+ARCH           = LM32
+MONCOMPTR      = 0x00000134
+APPRAMBASE     = 0x40146000
+TARGET_IP      = 172.16.0.1
+CLOCK_MS       = 0
+ENDIANNESS     = -D BYTE_ORDER=BIG_ENDIAN
+endif
+
 
 
 #########################################################################
@@ -155,6 +164,14 @@ CPU                        := -D CPU_IS_68K=1
 LIBGCC         = /usr/lib/gcc-lib/m68k-elf/3.2/m5200/libgcc.a -L /usr/m68k-elf/lib/m5200
 endif
 
+ifeq ($(ARCH),LM32)
+TOOL_PREFIX    := lm32-elf
+CFLAGS         := -Wall -fno-builtin -mbarrel-shift-enabled -mmultiply-enabled -mdivide-enabled -msign-extend-enabled -g -c \
+                          $(INCPATHS) $(ENDIANNESS)
+CRT0           := crt0_lm32.o
+CPU                    := -D CPU_IS_LM32=1
+endif
+
 BASE_OBJS=$(CRT0) main.o console.o monlib.o
 
 #
@@ -253,6 +270,9 @@ crt0_ppc.o: crt0_ppc.S
 crt0_sh2.o: crt0_sh2.S
        $(CC) $(CFLAGS) -D USE_APPSTACK=$(USEAPPSTACK) -o $@ crt0_sh2.S
 
+crt0_lm32.o: crt0_lm32.S
+       $(CC) $(CFLAGS) -D USE_APPSTACK=$(USEAPPSTACK) -o $@ crt0_lm32.S
+
 main.o: main.c 
        $(CC) $(CFLAGS) $(CPU) -o $@ \
                -D USE_APPSTACK=$(USEAPPSTACK) -D MONCOMPTR=$(MONCOMPTR) \