1
0
Fork 0
forked from len0rd/rockbox

Configure Gigabeat S with EABI compiler by default. Implement the INIT section that this enables (due to selective need for long calls). Remove pcm_postinit from INIT section since it's asynchronous. Disable strict aliasing on SPC codec for now just to shut it up.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26779 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2010-06-11 14:39:35 +00:00
parent d5a27c2fb1
commit 60f843bf18
17 changed files with 50 additions and 43 deletions

View file

@ -17,7 +17,7 @@ $(SPCLIB): $(SPCLIB_OBJ)
$(SILENT)$(shell rm -f $@) $(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
SPCFLAGS = $(filter-out -O%,$(CODECFLAGS)) SPCFLAGS = $(filter-out -O%,$(CODECFLAGS)) -fno-strict-aliasing
SPCFLAGS += -O1 SPCFLAGS += -O1
$(CODECDIR)/libspc/%.o: $(ROOTDIR)/apps/codecs/libspc/%.c $(CODECDIR)/libspc/%.o: $(ROOTDIR)/apps/codecs/libspc/%.c

View file

@ -778,7 +778,8 @@ Lyre prototype 1 */
#define IBSS_ATTR #define IBSS_ATTR
#define STATICIRAM static #define STATICIRAM static
#endif #endif
#if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2)) \ #if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) || \
(CONFIG_CPU == IMX31L)) \
&& !defined(SIMULATOR) && !defined(BOOTLOADER) && !defined(SIMULATOR) && !defined(BOOTLOADER)
/* Functions that have INIT_ATTR attached are NOT guaranteed to survive after /* Functions that have INIT_ATTR attached are NOT guaranteed to survive after
* root_menu() has been called. Their code may be overwritten by other data or * root_menu() has been called. Their code may be overwritten by other data or

View file

@ -68,7 +68,7 @@ void pcm_play_lock(void);
void pcm_play_unlock(void); void pcm_play_unlock(void);
void pcm_init(void) INIT_ATTR; void pcm_init(void) INIT_ATTR;
void pcm_postinit(void) INIT_ATTR; void pcm_postinit(void);
/* This is for playing "raw" PCM data */ /* This is for playing "raw" PCM data */
void pcm_play_data(pcm_play_callback_type get_more, void pcm_play_data(pcm_play_callback_type get_more,

View file

@ -32,9 +32,14 @@ STARTUP(target/arm/imx31/crt0.o)
/* Where the codec buffer ends, and the plugin buffer starts */ /* Where the codec buffer ends, and the plugin buffer starts */
#define ENDADDR (ENDAUDIOADDR + CODECSIZE) #define ENDADDR (ENDAUDIOADDR + CODECSIZE)
/* INIT section is the codec buffer */
#define INITSIZE CODECSIZE
#define INITSTART ENDAUDIOADDR
MEMORY MEMORY
{ {
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
INIT : ORIGIN = INITSTART, LENGTH = INITSIZE
QHARRAY : ORIGIN = QHARRAY_PHYS_ADDR, LENGTH = QHARRAY_SIZE QHARRAY : ORIGIN = QHARRAY_PHYS_ADDR, LENGTH = QHARRAY_SIZE
} }
@ -97,25 +102,35 @@ SECTIONS
.vectors 0x0 : .vectors 0x0 :
{ {
_vectorsstart = .; _vectorsstart = .;
*(.vectors); *(.vectors)
_vectorsend = .; _vectorsend = .;
} AT> DRAM } AT> DRAM
_vectorscopy = LOADADDR(.vectors); _vectorscopy = LOADADDR(.vectors);
.init :
{
. = ALIGN(4);
_initstart = .;
*(.init)
*(.sdmacode)
_initend = .;
} > INIT AT> DRAM
_initcopy = LOADADDR(.init);
.stack (NOLOAD) : .stack (NOLOAD) :
{ {
*(.stack) . = ALIGN(4);
stackbegin = .; *(.stack)
. += 0x2000; stackbegin = .;
stackend = .; . += 0x2000;
stackend = .;
} > DRAM } > DRAM
_sdmacodecopy = stackbegin;
.bss (NOLOAD) : .bss (NOLOAD) :
{ {
_edata = .; _edata = .;
*(.bss*) *(.bss*)
*(.ibss) *(.ibss)
*(COMMON) *(COMMON)
@ -158,13 +173,6 @@ SECTIONS
pluginbuf = .; pluginbuf = .;
} }
.sdma _pluginbuf : AT( _sdmacodecopy )
{
_sdmacodestart = .;
*(.sdmacode);
_sdmacodeend = .;
}
.qharray (NOLOAD) : .qharray (NOLOAD) :
{ {
_qharray = .; _qharray = .;

View file

@ -116,7 +116,7 @@ void __attribute__((naked)) fiq_handler(void)
); );
} }
void avic_init(void) void INIT_ATTR avic_init(void)
{ {
int i; int i;

View file

@ -231,20 +231,18 @@ remap_end:
bhi 1b bhi 1b
#endif /* BOOTLOADER */ #endif /* BOOTLOADER */
#ifndef BOOTLOADER #ifdef HAVE_INIT_ATTR
/* Copy discardable SDMA code - loaded in the stack section /* copy init data to codec buffer */
* and so must be done first. Destination is the plugin buffer /* must be done before bss is zeroed */
* which is safe when SDMA init takes place just after kernel ldr r4, =_initcopy
* init. */ ldr r3, =_initend
ldr r4, =_sdmacodecopy ldr r2, =_initstart
ldr r3, =_sdmacodeend
ldr r2, =_sdmacodestart
1: 1:
cmp r3, r2 cmp r3, r2
ldrhi r5, [r4], #4 ldrhi r5, [r4], #4
strhi r5, [r2], #4 strhi r5, [r2], #4
bhi 1b bhi 1b
#endif /* BOOTLOADER */ #endif /* HAVE_INIT_ATTR */
/* Initialise bss and ncbss sections to zero */ /* Initialise bss and ncbss sections to zero */
ldr r2, =_edata ldr r2, =_edata

View file

@ -248,7 +248,7 @@ static __attribute__((naked, interrupt("IRQ"))) void CCM_DVFS_HANDLER(void)
/* Initialize the DVFS hardware */ /* Initialize the DVFS hardware */
static void dvfs_init(void) static void INIT_ATTR dvfs_init(void)
{ {
if (CCM_PMCR0 & CCM_PMCR0_DVFEN) if (CCM_PMCR0 & CCM_PMCR0_DVFEN)
{ {
@ -514,7 +514,7 @@ static __attribute__((interrupt("IRQ"))) void CCM_CLK_HANDLER(void)
/* Initialize the DPTC hardware */ /* Initialize the DPTC hardware */
static void dptc_init(void) static void INIT_ATTR dptc_init(void)
{ {
/* Force DPTC off if running for some reason. */ /* Force DPTC off if running for some reason. */
imx31_regmod32(&CCM_PMCR0, CCM_PMCR0_PTVAIM, imx31_regmod32(&CCM_PMCR0, CCM_PMCR0_PTVAIM,
@ -590,7 +590,7 @@ static void dptc_stop(void)
/** Main module interface **/ /** Main module interface **/
/* Initialize DVFS and DPTC */ /* Initialize DVFS and DPTC */
void dvfs_dptc_init(void) void INIT_ATTR dvfs_dptc_init(void)
{ {
dptc_init(); dptc_init();
dvfs_init(); dvfs_init();

View file

@ -184,7 +184,7 @@ bool headphones_inserted(void)
return headphones_detect; return headphones_detect;
} }
void headphone_init(void) void INIT_ATTR headphone_init(void)
{ {
/* A thread is required to monitor the remote ADC and jack state. */ /* A thread is required to monitor the remote ADC and jack state. */
wakeup_init(&headphone_wakeup); wakeup_init(&headphone_wakeup);

View file

@ -37,7 +37,7 @@ static __attribute__((interrupt("IRQ"))) void EPIT1_HANDLER(void)
call_tick_tasks(); call_tick_tasks();
} }
void tick_start(unsigned int interval_in_ms) void INIT_ATTR tick_start(unsigned int interval_in_ms)
{ {
ccm_module_clock_gating(CG_EPIT1, CGM_ON_RUN_WAIT); /* EPIT1 module ccm_module_clock_gating(CG_EPIT1, CGM_ON_RUN_WAIT); /* EPIT1 module
clock ON - before writing clock ON - before writing
@ -65,7 +65,7 @@ void tick_start(unsigned int interval_in_ms)
EPITCR1 |= EPITCR_EN; /* Enable the counter */ EPITCR1 |= EPITCR_EN; /* Enable the counter */
} }
void kernel_device_init(void) void INIT_ATTR kernel_device_init(void)
{ {
sdma_init(); sdma_init();
spi_init(); spi_init();

View file

@ -147,7 +147,7 @@ static void lcd_set_power(bool powered)
} }
/* LCD init */ /* LCD init */
void lcd_init_device(void) void INIT_ATTR lcd_init_device(void)
{ {
/* Move the framebuffer */ /* Move the framebuffer */
#ifdef BOOTLOADER #ifdef BOOTLOADER

View file

@ -606,7 +606,7 @@ static bool charging_ok(void)
return ok; return ok;
} }
void powermgmt_init_target(void) void INIT_ATTR powermgmt_init_target(void)
{ {
last_inputs = power_thread_inputs; last_inputs = power_thread_inputs;

View file

@ -48,7 +48,7 @@ unsigned int iim_prod_rev(void)
return product_rev; return product_rev;
} }
static void iim_init(void) static void INIT_ATTR iim_init(void)
{ {
/* Initialize the IC revision info (required by SDMA) */ /* Initialize the IC revision info (required by SDMA) */
ccm_module_clock_gating(CG_IIM, CGM_ON_RUN_WAIT); ccm_module_clock_gating(CG_IIM, CGM_ON_RUN_WAIT);
@ -136,7 +136,7 @@ void system_exception_wait(void)
system_halt(); system_halt();
} }
void system_init(void) void INIT_ATTR system_init(void)
{ {
static const int disable_clocks[] = static const int disable_clocks[] =
{ {

View file

@ -150,7 +150,7 @@ static __attribute__((interrupt("IRQ"))) void GPIO3_HANDLER(void)
} }
#endif #endif
void gpio_init(void) void INIT_ATTR gpio_init(void)
{ {
/* Mask-out GPIO interrupts - enable what's wanted later */ /* Mask-out GPIO interrupts - enable what's wanted later */
int i; int i;

View file

@ -143,7 +143,7 @@ void mc13783_event(void)
wakeup_signal(&mc13783_svc_wake); wakeup_signal(&mc13783_svc_wake);
} }
void mc13783_init(void) void INIT_ATTR mc13783_init(void)
{ {
/* Serial interface must have been initialized first! */ /* Serial interface must have been initialized first! */
wakeup_init(&mc13783_svc_wake); wakeup_init(&mc13783_svc_wake);

View file

@ -500,7 +500,7 @@ static bool setup_channel(struct channel_control_block *ccb_p)
} }
/** Public routines **/ /** Public routines **/
void sdma_init(void) void INIT_ATTR sdma_init(void)
{ {
int i; int i;
unsigned long acr; unsigned long acr;

View file

@ -331,7 +331,7 @@ static __attribute__((interrupt("IRQ"))) void CSPI3_HANDLER(void)
#endif #endif
/* Initialize the SPI driver */ /* Initialize the SPI driver */
void spi_init(void) void INIT_ATTR spi_init(void)
{ {
unsigned i; unsigned i;
for (i = 0; i < SPI_NUM_CSPI; i++) for (i = 0; i < SPI_NUM_CSPI; i++)

2
tools/configure vendored
View file

@ -40,7 +40,7 @@ prefixtools () {
} }
findarmgcc() { findarmgcc() {
models_not_checked_with_eabi="iriverh10 iriverh10_5gb ipodcolor ipodnano1g ipodvideo ipod3g ipod4g ipodmini1g ipodmini2g ipod1g2g ipodnano2g iaudio7 cowond2 gigabeatfx gigabeats mrobe500 mrobe100 sansae200 sansac200 sansae200r vibe500" models_not_checked_with_eabi="iriverh10 iriverh10_5gb ipodcolor ipodnano1g ipodvideo ipod3g ipod4g ipodmini1g ipodmini2g ipod1g2g ipodnano2g iaudio7 cowond2 gigabeatfx mrobe500 mrobe100 sansae200 sansac200 sansae200r vibe500"
if [ "$ARG_ARM_EABI" != 1 ]; then # eabi not explicitely enabled if [ "$ARG_ARM_EABI" != 1 ]; then # eabi not explicitely enabled
for model in $models_not_checked_with_eabi; do for model in $models_not_checked_with_eabi; do
if [ "$modelname" = "$model" ]; then if [ "$modelname" = "$model" ]; then