diff --git a/bootloader/SOURCES b/bootloader/SOURCES index 9448515a58..9fd532b55d 100644 --- a/bootloader/SOURCES +++ b/bootloader/SOURCES @@ -57,7 +57,6 @@ sansa_as3525.c 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 523c902bb6..66de9cd0db 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 @@ void main(void) 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 70047ff866..37acec04e1 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -781,7 +781,7 @@ Lyre prototype 1 */ || (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 39e570a03e..cb925b055e 100644 --- a/firmware/target/arm/imx233/boot.lds +++ b/firmware/target/arm/imx233/boot.lds @@ -14,32 +14,6 @@ MEMORY 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 @@ SECTIONS _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 836c3e88cb..e233d439e0 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 @@ start: 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