From 60f843bf181fba3fc509955195ecea786cc002b2 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Fri, 11 Jun 2010 14:39:35 +0000 Subject: 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 --- apps/codecs/libspc/libspc.make | 2 +- firmware/export/config.h | 3 +- firmware/export/pcm.h | 2 +- firmware/target/arm/imx31/app.lds | 38 +++++++++++++--------- firmware/target/arm/imx31/avic-imx31.c | 2 +- firmware/target/arm/imx31/crt0.S | 16 ++++----- firmware/target/arm/imx31/dvfs_dptc-imx31.c | 6 ++-- .../arm/imx31/gigabeat-s/headphone-gigabeat-s.c | 2 +- .../arm/imx31/gigabeat-s/kernel-gigabeat-s.c | 4 +-- .../target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c | 2 +- .../arm/imx31/gigabeat-s/powermgmt-gigabeat-s.c | 2 +- .../arm/imx31/gigabeat-s/system-gigabeat-s.c | 4 +-- firmware/target/arm/imx31/gpio-imx31.c | 2 +- firmware/target/arm/imx31/mc13783-imx31.c | 2 +- firmware/target/arm/imx31/sdma-imx31.c | 2 +- firmware/target/arm/imx31/spi-imx31.c | 2 +- tools/configure | 2 +- 17 files changed, 50 insertions(+), 43 deletions(-) diff --git a/apps/codecs/libspc/libspc.make b/apps/codecs/libspc/libspc.make index 7da5135e41..63360af1b1 100644 --- a/apps/codecs/libspc/libspc.make +++ b/apps/codecs/libspc/libspc.make @@ -17,7 +17,7 @@ $(SPCLIB): $(SPCLIB_OBJ) $(SILENT)$(shell rm -f $@) $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null -SPCFLAGS = $(filter-out -O%,$(CODECFLAGS)) +SPCFLAGS = $(filter-out -O%,$(CODECFLAGS)) -fno-strict-aliasing SPCFLAGS += -O1 $(CODECDIR)/libspc/%.o: $(ROOTDIR)/apps/codecs/libspc/%.c diff --git a/firmware/export/config.h b/firmware/export/config.h index 24e258d3af..0e9df895c5 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -778,7 +778,8 @@ Lyre prototype 1 */ #define IBSS_ATTR #define STATICIRAM static #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) /* 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 diff --git a/firmware/export/pcm.h b/firmware/export/pcm.h index 304f120059..02fa04cb7e 100644 --- a/firmware/export/pcm.h +++ b/firmware/export/pcm.h @@ -68,7 +68,7 @@ void pcm_play_lock(void); void pcm_play_unlock(void); void pcm_init(void) INIT_ATTR; -void pcm_postinit(void) INIT_ATTR; +void pcm_postinit(void); /* This is for playing "raw" PCM data */ void pcm_play_data(pcm_play_callback_type get_more, diff --git a/firmware/target/arm/imx31/app.lds b/firmware/target/arm/imx31/app.lds index 7043a55526..24b9f27d5d 100644 --- a/firmware/target/arm/imx31/app.lds +++ b/firmware/target/arm/imx31/app.lds @@ -32,9 +32,14 @@ STARTUP(target/arm/imx31/crt0.o) /* Where the codec buffer ends, and the plugin buffer starts */ #define ENDADDR (ENDAUDIOADDR + CODECSIZE) +/* INIT section is the codec buffer */ +#define INITSIZE CODECSIZE +#define INITSTART ENDAUDIOADDR + MEMORY { DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE + INIT : ORIGIN = INITSTART, LENGTH = INITSIZE QHARRAY : ORIGIN = QHARRAY_PHYS_ADDR, LENGTH = QHARRAY_SIZE } @@ -97,25 +102,35 @@ SECTIONS .vectors 0x0 : { _vectorsstart = .; - *(.vectors); + *(.vectors) _vectorsend = .; } AT> DRAM _vectorscopy = LOADADDR(.vectors); + .init : + { + . = ALIGN(4); + _initstart = .; + *(.init) + *(.sdmacode) + _initend = .; + } > INIT AT> DRAM + + _initcopy = LOADADDR(.init); + .stack (NOLOAD) : { - *(.stack) - stackbegin = .; - . += 0x2000; - stackend = .; + . = ALIGN(4); + *(.stack) + stackbegin = .; + . += 0x2000; + stackend = .; } > DRAM - _sdmacodecopy = stackbegin; - .bss (NOLOAD) : { - _edata = .; + _edata = .; *(.bss*) *(.ibss) *(COMMON) @@ -158,13 +173,6 @@ SECTIONS pluginbuf = .; } - .sdma _pluginbuf : AT( _sdmacodecopy ) - { - _sdmacodestart = .; - *(.sdmacode); - _sdmacodeend = .; - } - .qharray (NOLOAD) : { _qharray = .; diff --git a/firmware/target/arm/imx31/avic-imx31.c b/firmware/target/arm/imx31/avic-imx31.c index 5bf7275e07..b2b62755e1 100644 --- a/firmware/target/arm/imx31/avic-imx31.c +++ b/firmware/target/arm/imx31/avic-imx31.c @@ -116,7 +116,7 @@ void __attribute__((naked)) fiq_handler(void) ); } -void avic_init(void) +void INIT_ATTR avic_init(void) { int i; diff --git a/firmware/target/arm/imx31/crt0.S b/firmware/target/arm/imx31/crt0.S index d241fcb8ae..53e18c17df 100644 --- a/firmware/target/arm/imx31/crt0.S +++ b/firmware/target/arm/imx31/crt0.S @@ -231,20 +231,18 @@ remap_end: bhi 1b #endif /* BOOTLOADER */ -#ifndef BOOTLOADER - /* Copy discardable SDMA code - loaded in the stack section - * and so must be done first. Destination is the plugin buffer - * which is safe when SDMA init takes place just after kernel - * init. */ - ldr r4, =_sdmacodecopy - ldr r3, =_sdmacodeend - ldr r2, =_sdmacodestart +#ifdef HAVE_INIT_ATTR + /* copy init data to codec buffer */ + /* must be done before bss is zeroed */ + ldr r4, =_initcopy + ldr r3, =_initend + ldr r2, =_initstart 1: cmp r3, r2 ldrhi r5, [r4], #4 strhi r5, [r2], #4 bhi 1b -#endif /* BOOTLOADER */ +#endif /* HAVE_INIT_ATTR */ /* Initialise bss and ncbss sections to zero */ ldr r2, =_edata diff --git a/firmware/target/arm/imx31/dvfs_dptc-imx31.c b/firmware/target/arm/imx31/dvfs_dptc-imx31.c index 129e47d55e..6bacc20c10 100644 --- a/firmware/target/arm/imx31/dvfs_dptc-imx31.c +++ b/firmware/target/arm/imx31/dvfs_dptc-imx31.c @@ -248,7 +248,7 @@ static __attribute__((naked, interrupt("IRQ"))) void CCM_DVFS_HANDLER(void) /* Initialize the DVFS hardware */ -static void dvfs_init(void) +static void INIT_ATTR dvfs_init(void) { if (CCM_PMCR0 & CCM_PMCR0_DVFEN) { @@ -514,7 +514,7 @@ static __attribute__((interrupt("IRQ"))) void CCM_CLK_HANDLER(void) /* Initialize the DPTC hardware */ -static void dptc_init(void) +static void INIT_ATTR dptc_init(void) { /* Force DPTC off if running for some reason. */ imx31_regmod32(&CCM_PMCR0, CCM_PMCR0_PTVAIM, @@ -590,7 +590,7 @@ static void dptc_stop(void) /** Main module interface **/ /* Initialize DVFS and DPTC */ -void dvfs_dptc_init(void) +void INIT_ATTR dvfs_dptc_init(void) { dptc_init(); dvfs_init(); diff --git a/firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c index 14bb534138..0f8cb67a9d 100644 --- a/firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c +++ b/firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c @@ -184,7 +184,7 @@ bool headphones_inserted(void) 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. */ wakeup_init(&headphone_wakeup); diff --git a/firmware/target/arm/imx31/gigabeat-s/kernel-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/kernel-gigabeat-s.c index bece976ab9..79f3eccc6b 100644 --- a/firmware/target/arm/imx31/gigabeat-s/kernel-gigabeat-s.c +++ b/firmware/target/arm/imx31/gigabeat-s/kernel-gigabeat-s.c @@ -37,7 +37,7 @@ static __attribute__((interrupt("IRQ"))) void EPIT1_HANDLER(void) 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 clock ON - before writing @@ -65,7 +65,7 @@ void tick_start(unsigned int interval_in_ms) EPITCR1 |= EPITCR_EN; /* Enable the counter */ } -void kernel_device_init(void) +void INIT_ATTR kernel_device_init(void) { sdma_init(); spi_init(); diff --git a/firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c index d567de8dbb..cadd0e7ae8 100644 --- a/firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c +++ b/firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c @@ -147,7 +147,7 @@ static void lcd_set_power(bool powered) } /* LCD init */ -void lcd_init_device(void) +void INIT_ATTR lcd_init_device(void) { /* Move the framebuffer */ #ifdef BOOTLOADER diff --git a/firmware/target/arm/imx31/gigabeat-s/powermgmt-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/powermgmt-gigabeat-s.c index dc00b1ede6..06ea280067 100644 --- a/firmware/target/arm/imx31/gigabeat-s/powermgmt-gigabeat-s.c +++ b/firmware/target/arm/imx31/gigabeat-s/powermgmt-gigabeat-s.c @@ -606,7 +606,7 @@ static bool charging_ok(void) return ok; } -void powermgmt_init_target(void) +void INIT_ATTR powermgmt_init_target(void) { last_inputs = power_thread_inputs; diff --git a/firmware/target/arm/imx31/gigabeat-s/system-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/system-gigabeat-s.c index 7c0d30c783..80b6f22397 100644 --- a/firmware/target/arm/imx31/gigabeat-s/system-gigabeat-s.c +++ b/firmware/target/arm/imx31/gigabeat-s/system-gigabeat-s.c @@ -48,7 +48,7 @@ unsigned int iim_prod_rev(void) return product_rev; } -static void iim_init(void) +static void INIT_ATTR iim_init(void) { /* Initialize the IC revision info (required by SDMA) */ ccm_module_clock_gating(CG_IIM, CGM_ON_RUN_WAIT); @@ -136,7 +136,7 @@ void system_exception_wait(void) system_halt(); } -void system_init(void) +void INIT_ATTR system_init(void) { static const int disable_clocks[] = { diff --git a/firmware/target/arm/imx31/gpio-imx31.c b/firmware/target/arm/imx31/gpio-imx31.c index 42d0a42188..e368d1ae07 100644 --- a/firmware/target/arm/imx31/gpio-imx31.c +++ b/firmware/target/arm/imx31/gpio-imx31.c @@ -150,7 +150,7 @@ static __attribute__((interrupt("IRQ"))) void GPIO3_HANDLER(void) } #endif -void gpio_init(void) +void INIT_ATTR gpio_init(void) { /* Mask-out GPIO interrupts - enable what's wanted later */ int i; diff --git a/firmware/target/arm/imx31/mc13783-imx31.c b/firmware/target/arm/imx31/mc13783-imx31.c index 9d8f6190a3..6e982af3d3 100644 --- a/firmware/target/arm/imx31/mc13783-imx31.c +++ b/firmware/target/arm/imx31/mc13783-imx31.c @@ -143,7 +143,7 @@ void mc13783_event(void) wakeup_signal(&mc13783_svc_wake); } -void mc13783_init(void) +void INIT_ATTR mc13783_init(void) { /* Serial interface must have been initialized first! */ wakeup_init(&mc13783_svc_wake); diff --git a/firmware/target/arm/imx31/sdma-imx31.c b/firmware/target/arm/imx31/sdma-imx31.c index a877d5824b..4928108f67 100644 --- a/firmware/target/arm/imx31/sdma-imx31.c +++ b/firmware/target/arm/imx31/sdma-imx31.c @@ -500,7 +500,7 @@ static bool setup_channel(struct channel_control_block *ccb_p) } /** Public routines **/ -void sdma_init(void) +void INIT_ATTR sdma_init(void) { int i; unsigned long acr; diff --git a/firmware/target/arm/imx31/spi-imx31.c b/firmware/target/arm/imx31/spi-imx31.c index e0187e4388..7fcf94ce90 100644 --- a/firmware/target/arm/imx31/spi-imx31.c +++ b/firmware/target/arm/imx31/spi-imx31.c @@ -331,7 +331,7 @@ static __attribute__((interrupt("IRQ"))) void CSPI3_HANDLER(void) #endif /* Initialize the SPI driver */ -void spi_init(void) +void INIT_ATTR spi_init(void) { unsigned i; for (i = 0; i < SPI_NUM_CSPI; i++) diff --git a/tools/configure b/tools/configure index b7d17411b4..142f3f6169 100755 --- a/tools/configure +++ b/tools/configure @@ -40,7 +40,7 @@ prefixtools () { } 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 for model in $models_not_checked_with_eabi; do if [ "$modelname" = "$model" ]; then -- cgit v1.2.3