imx233/fuze+: make config.h more correct, remove logo from bootloader, update linker file and crt0 to produce a single blob into dram

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30111 a1c6a512-1295-4272-9138-f99709370657
diff --git a/bootloader/SOURCES b/bootloader/SOURCES
index 9448515..9fd532b 100644
--- a/bootloader/SOURCES
+++ b/bootloader/SOURCES
@@ -57,7 +57,6 @@
 show_logo.c
 #elif CONFIG_CPU==IMX233
 imx233.c
-show_logo.c
 #elif defined(LYRE_PROTO1)
 lyre_proto1.c
 show_logo.c
diff --git a/bootloader/imx233.c b/bootloader/imx233.c
index 523c902..66de9cd 100644
--- a/bootloader/imx233.c
+++ b/bootloader/imx233.c
@@ -39,8 +39,6 @@
 
 #include "usb.h"
 
-int show_logo(void);
-
 void main(void) NORETURN_ATTR;
 void main(void)
 {
@@ -55,7 +53,8 @@
     enable_irq();
 
     lcd_init();
-    show_logo();
+    lcd_clear_display();
+    lcd_update();
 
     backlight_init();
 
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 70047ff..37acec0 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -781,7 +781,7 @@
     || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) \
     || defined(CPU_S5L870X) || (CONFIG_CPU == S3C2440) \
     || defined(APPLICATION) || (CONFIG_CPU == PP5002) \
-    || (CONFIG_CPU == RK27XX)
+    || (CONFIG_CPU == RK27XX) || (CONFIG_CPU == IMX233)
 #define HAVE_SEMAPHORE_OBJECTS
 #endif
 
diff --git a/firmware/target/arm/imx233/boot.lds b/firmware/target/arm/imx233/boot.lds
index 39e570a..cb925b0 100644
--- a/firmware/target/arm/imx233/boot.lds
+++ b/firmware/target/arm/imx233/boot.lds
@@ -14,32 +14,6 @@
 
 SECTIONS
 {
-    .vectors 0 :
-    {
-        *(.vectors);
-        . = ALIGN(0x4);
-    } > IRAM
-
-    .itext :
-    {
-        *(.icode)
-        *(.init.text)
-        . = ALIGN(0x4);
-    } > IRAM
-
-    .idata :
-    {
-        *(.qharray)
-        *(.idata)
-        *(.irodata)
-        . = ALIGN(0x4);
-    } > IRAM
-
-    .ibss :
-    {
-        *(.ibss)
-    } > IRAM
-
     .text :
     {
         *(.text*)
@@ -52,13 +26,34 @@
         _dataend = . ;
     } > DRAM
 
+    .iram :
+    {
+        _iramstart = .; // always 0
+        *(.vectors)
+        KEEP(*(.vectors));// otherwise there are no reference to it and the linker strip it
+        *(.icode)
+        *(.irodata)
+        *(.idata)
+        . = ALIGN(0x4);
+        _iramend = .;
+    } > IRAM AT> DRAM
+
+    _iramcopy = LOADADDR(.iram);
+
+    .ibss (NOLOAD) :
+    {
+        _iedata = .;
+        *(.qharray)
+        *(.ibss)
+        . = ALIGN(0x4);
+        _iend = .;
+    } > IRAM
+
     .stack (NOLOAD) :
     {
         *(.stack)
-        _stackbegin = .;
         stackbegin = .;
         . += 0x2000;
-        _stackend = .;
         stackend = .;
     } > DRAM
 
diff --git a/firmware/target/arm/imx233/crt0.S b/firmware/target/arm/imx233/crt0.S
index 836c3e8..e233d43 100644
--- a/firmware/target/arm/imx233/crt0.S
+++ b/firmware/target/arm/imx233/crt0.S
@@ -23,10 +23,8 @@
 
 .section .vectors,"ax",%progbits
 .code 32
-.global start
-start:
     /* most handlers are in DRAM which is too far away for a relative jump */
-    ldr     pc, =newstart
+    ldr     pc, =start
     ldr     pc, =undef_instr_handler
     ldr     pc, =software_int_handler
     ldr     pc, =prefetch_abort_handler
@@ -36,8 +34,39 @@
     ldr     pc, =fiq_handler
 
 .text
-newstart:
+.global start
+start:
     msr     cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ/FIQ */
+    /* Zero out IBSS */
+    ldr     r2, =_iedata
+    ldr     r3, =_iend
+    mov     r4, #0
+1:
+    cmp     r3, r2
+    strhi   r4, [r2], #4
+    bhi     1b
+
+    /* Copy the IRAM */
+    /* must be done before bss is zeroed */
+    ldr     r2, =_iramcopy
+    ldr     r3, =_iramstart
+    ldr     r4, =_iramend
+1:
+    cmp     r4, r3
+    ldrhi   r5, [r2], #4
+    strhi   r5, [r3], #4
+    bhi     1b
+
+    /* Initialise bss section to zero */
+    ldr     r2, =_edata
+    ldr     r3, =_end
+    mov     r4, #0
+1:
+    cmp     r3, r2
+    strhi   r4, [r2], #4
+    bhi     1b
+
+
     /* Set up some stack and munge it with 0xdeadbeef */
     ldr     sp, =stackend
     ldr     r2, =stackbegin