summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-06-11 14:39:35 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-06-11 14:39:35 +0000
commit60f843bf181fba3fc509955195ecea786cc002b2 (patch)
tree31399c08bb3ec25dd98318e6f23bcd2f4a0191d0 /firmware/target
parentd5a27c2fb1d653bb133a57acacc06b9efdc3ce4c (diff)
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
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/imx31/app.lds38
-rw-r--r--firmware/target/arm/imx31/avic-imx31.c2
-rw-r--r--firmware/target/arm/imx31/crt0.S16
-rw-r--r--firmware/target/arm/imx31/dvfs_dptc-imx31.c6
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c2
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/kernel-gigabeat-s.c4
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c2
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/powermgmt-gigabeat-s.c2
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/system-gigabeat-s.c4
-rw-r--r--firmware/target/arm/imx31/gpio-imx31.c2
-rw-r--r--firmware/target/arm/imx31/mc13783-imx31.c2
-rw-r--r--firmware/target/arm/imx31/sdma-imx31.c2
-rw-r--r--firmware/target/arm/imx31/spi-imx31.c2
13 files changed, 45 insertions, 39 deletions
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++)