Commit 20695936 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Peter Korsgaard
Browse files

lpc32xx: Add CDL to the available bootloaders



This will build kickstart and s1l for the selected board and install
them alongside u-boot.

Signed-off-by: default avatarAlexandre Belloni <abelloni@adeneo-embedded.com>
Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent 14b60020
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ source "boot/at91bootstrap/Config.in"
source "boot/at91dataflashboot/Config.in"
source "boot/barebox/Config.in"
source "boot/grub/Config.in"
source "boot/lpc32xxcdl/Config.in"
source "boot/syslinux/Config.in"
source "boot/uboot/Config.in"
source "boot/xloader/Config.in"
+10 −0
Original line number Diff line number Diff line
config BR2_TARGET_LPC32XXCDL
	depends on BR2_arm
	bool "LPC32XX CDL (kickstart and S1L)"

if BR2_TARGET_LPC32XXCDL

config BR2_TARGET_LPC32XXCDL_BOARDNAME
	string "LPC32xx board name"

endif #BR2_TARGET_LPC32XXCDL
+52 −0
Original line number Diff line number Diff line
Use CROSS_COMPILE as compiler name and stop using libc

Signed-off-by: Alexandre Belloni <abelloni@adeneo-embedded.com>
---
 makerule/lpc32xx/make.lpc32xx.gnu |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/makerule/lpc32xx/make.lpc32xx.gnu b/makerule/lpc32xx/make.lpc32xx.gnu
index 1014c28..3277d99 100644
--- a/makerule/lpc32xx/make.lpc32xx.gnu
+++ b/makerule/lpc32xx/make.lpc32xx.gnu
@@ -27,19 +27,19 @@ CFLAGS   += -mno-sched-prolog -fno-hosted -mno-thumb-interwork -ffunction-sectio
 CFLAGS   += -I$(CSP_INC_DIR) -I$(BSP_INC_DIR) -I$(GEN_INC_DIR)
 AFLAGS   = -mcpu=arm926ej-s
 AFLAGS   += -I$(CSP_INC_DIR) -I$(BSP_INC_DIR) -I$(GEN_INC_DIR)
-CC       = arm-none-eabi-gcc
-AS       = arm-none-eabi-as
-AR       = arm-none-eabi-ar -r
-LD       = arm-none-eabi-gcc
-NM       = arm-none-eabi-nm
-OBJDUMP  = arm-none-eabi-objdump
-OBJCOPY  = arm-none-eabi-objcopy
-READELF  = arm-none-eabi-readelf
+CC       = $(CROSS_COMPILE)gcc
+AS       = $(CROSS_COMPILE)as
+AR       = $(CROSS_COMPILE)ar -r
+LD       = $(CROSS_COMPILE)gcc
+NM       = $(CROSS_COMPILE)nm
+OBJDUMP  = $(CROSS_COMPILE)objdump
+OBJCOPY  = $(CROSS_COMPILE)objcopy
+READELF  = $(CROSS_COMPILE)readelf
 LDFLAGS  += -Wl,--gc-sections
 
 LK       =  -static
 LK       += -Wl,--start-group $(TARGET_CSP_LIB) $(TARGET_BSP_LIB) $(TARGET_GEN_LIB)
-LK       +=  -lgcc -lc -lg -lm -lstdc++ -lsupc++ 
+LK       +=  -nostdlib -lgcc #-lc -lg -lm -lstdc++ -lsupc++ 
 LK       += -Wl,--end-group
 MAP      = -Xlinker -Map -Xlinker
 LDESC    = -Xlinker -T  
@@ -47,6 +47,6 @@ ENTRY    = -e
 BIN      = -bin
 EXT      = .elf
 LEXT     = 
-ELFTOREC =arm-none-eabi-objcopy -O srec --strip-all --verbose
-ELFTOBIN =arm-none-eabi-objcopy -I elf32-littlearm -O binary --strip-all --verbose
+ELFTOREC = $(OBJCOPY) -O srec --strip-all --verbose
+ELFTOBIN = $(OBJCOPY) -I elf32-littlearm -O binary --strip-all --verbose
 REC      =.srec
-- 
1.7.7.3
+969 −0

File added.

Preview size limit exceeded, changes collapsed.

+188 −0
Original line number Diff line number Diff line
Fix compilation and eabi issues

Since we are not linking with libc anymore, we need to define our own memset,
strlen and memcpy. Also, as we are using a *libc compiler, we need to "handle"
exceptions (mostly division by 0) by defining raise() and
__aeabi_unwind_cpp_pr0.

Signed-off-by: Alexandre Belloni <abelloni@adeneo-embedded.com>
---
 csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c  |   41 +++++++++++++++++++++++
 csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c |   41 +++++++++++++++++++++++
 csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c |   41 +++++++++++++++++++++++
 3 files changed, 123 insertions(+), 0 deletions(-)

diff --git a/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c b/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c
index 385b0ab..f1f0a0a 100644
--- a/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c
+++ b/csps/lpc32xx/bsps/ea3250/source/libnosys_gnu.c
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <sys/times.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 
 /* errno definition */
 #undef errno
@@ -125,4 +126,44 @@ int _write(int file, char *ptr, int len){
     return 0;
 }
 
+void * memset(void * s,int c,size_t count)
+{
+        char *xs = (char *) s;
+
+        while (count--)
+                *xs++ = c;
+
+        return s;
+}
+
+
+size_t strlen(const char * s)
+{
+        const char *sc;
+
+        for (sc = s; *sc != '\0'; ++sc)
+                /* nothing */;
+        return sc - s;
+}
+
+void * memcpy(void * dest,const void *src,size_t count)
+{
+        char *tmp = (char *) dest, *s = (char *) src;
+
+        while (count--)
+                *tmp++ = *s++;
+
+        return dest;
+}
+
+
+/* Dummy functions to avoid linker complaints */
+void __aeabi_unwind_cpp_pr0(void)
+{
+};
+
+void raise(void)
+{
+};
+
 #endif /*__GNUC__*/
diff --git a/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c b/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c
index 385b0ab..f1f0a0a 100644
--- a/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c
+++ b/csps/lpc32xx/bsps/fdi3250/source/libnosys_gnu.c
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <sys/times.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 
 /* errno definition */
 #undef errno
@@ -125,4 +126,44 @@ int _write(int file, char *ptr, int len){
     return 0;
 }
 
+void * memset(void * s,int c,size_t count)
+{
+        char *xs = (char *) s;
+
+        while (count--)
+                *xs++ = c;
+
+        return s;
+}
+
+
+size_t strlen(const char * s)
+{
+        const char *sc;
+
+        for (sc = s; *sc != '\0'; ++sc)
+                /* nothing */;
+        return sc - s;
+}
+
+void * memcpy(void * dest,const void *src,size_t count)
+{
+        char *tmp = (char *) dest, *s = (char *) src;
+
+        while (count--)
+                *tmp++ = *s++;
+
+        return dest;
+}
+
+
+/* Dummy functions to avoid linker complaints */
+void __aeabi_unwind_cpp_pr0(void)
+{
+};
+
+void raise(void)
+{
+};
+
 #endif /*__GNUC__*/
diff --git a/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c b/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c
index cfdb674..6b50c60 100644
--- a/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c
+++ b/csps/lpc32xx/bsps/phy3250/source/libnosys_gnu.c
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <sys/times.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 
 /* errno definition */
 #undef errno
@@ -125,4 +126,44 @@ int _write(int file, char *ptr, int len){
     return 0;
 }
 
+void * memset(void * s,int c,size_t count)
+{
+        char *xs = (char *) s;
+
+        while (count--)
+                *xs++ = c;
+
+        return s;
+}
+
+
+size_t strlen(const char * s)
+{
+        const char *sc;
+
+        for (sc = s; *sc != '\0'; ++sc)
+                /* nothing */;
+        return sc - s;
+}
+
+void * memcpy(void * dest,const void *src,size_t count)
+{
+        char *tmp = (char *) dest, *s = (char *) src;
+
+        while (count--)
+                *tmp++ = *s++;
+
+        return dest;
+}
+
+
+/* Dummy functions to avoid linker complaints */
+void __aeabi_unwind_cpp_pr0(void)
+{
+};
+
+void raise(void)
+{
+};
+
 #endif /*__GNUC__*/
-- 
1.7.7.3
Loading