diff options
-rw-r--r-- | apps/codecs/libspc/libspc.make | 2 | ||||
-rw-r--r-- | firmware/export/config.h | 3 | ||||
-rw-r--r-- | firmware/export/pcm.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx31/app.lds | 38 | ||||
-rw-r--r-- | firmware/target/arm/imx31/avic-imx31.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx31/crt0.S | 16 | ||||
-rw-r--r-- | firmware/target/arm/imx31/dvfs_dptc-imx31.c | 6 | ||||
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/kernel-gigabeat-s.c | 4 | ||||
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/powermgmt-gigabeat-s.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/system-gigabeat-s.c | 4 | ||||
-rw-r--r-- | firmware/target/arm/imx31/gpio-imx31.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx31/mc13783-imx31.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx31/sdma-imx31.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx31/spi-imx31.c | 2 | ||||
-rwxr-xr-x | 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) | |||
17 | $(SILENT)$(shell rm -f $@) | 17 | $(SILENT)$(shell rm -f $@) |
18 | $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null | 18 | $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null |
19 | 19 | ||
20 | SPCFLAGS = $(filter-out -O%,$(CODECFLAGS)) | 20 | SPCFLAGS = $(filter-out -O%,$(CODECFLAGS)) -fno-strict-aliasing |
21 | SPCFLAGS += -O1 | 21 | SPCFLAGS += -O1 |
22 | 22 | ||
23 | $(CODECDIR)/libspc/%.o: $(ROOTDIR)/apps/codecs/libspc/%.c | 23 | $(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 */ | |||
778 | #define IBSS_ATTR | 778 | #define IBSS_ATTR |
779 | #define STATICIRAM static | 779 | #define STATICIRAM static |
780 | #endif | 780 | #endif |
781 | #if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2)) \ | 781 | #if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) || \ |
782 | (CONFIG_CPU == IMX31L)) \ | ||
782 | && !defined(SIMULATOR) && !defined(BOOTLOADER) | 783 | && !defined(SIMULATOR) && !defined(BOOTLOADER) |
783 | /* Functions that have INIT_ATTR attached are NOT guaranteed to survive after | 784 | /* Functions that have INIT_ATTR attached are NOT guaranteed to survive after |
784 | * root_menu() has been called. Their code may be overwritten by other data or | 785 | * 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); | |||
68 | void pcm_play_unlock(void); | 68 | void pcm_play_unlock(void); |
69 | 69 | ||
70 | void pcm_init(void) INIT_ATTR; | 70 | void pcm_init(void) INIT_ATTR; |
71 | void pcm_postinit(void) INIT_ATTR; | 71 | void pcm_postinit(void); |
72 | 72 | ||
73 | /* This is for playing "raw" PCM data */ | 73 | /* This is for playing "raw" PCM data */ |
74 | void pcm_play_data(pcm_play_callback_type get_more, | 74 | 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) | |||
32 | /* Where the codec buffer ends, and the plugin buffer starts */ | 32 | /* Where the codec buffer ends, and the plugin buffer starts */ |
33 | #define ENDADDR (ENDAUDIOADDR + CODECSIZE) | 33 | #define ENDADDR (ENDAUDIOADDR + CODECSIZE) |
34 | 34 | ||
35 | /* INIT section is the codec buffer */ | ||
36 | #define INITSIZE CODECSIZE | ||
37 | #define INITSTART ENDAUDIOADDR | ||
38 | |||
35 | MEMORY | 39 | MEMORY |
36 | { | 40 | { |
37 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | 41 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE |
42 | INIT : ORIGIN = INITSTART, LENGTH = INITSIZE | ||
38 | QHARRAY : ORIGIN = QHARRAY_PHYS_ADDR, LENGTH = QHARRAY_SIZE | 43 | QHARRAY : ORIGIN = QHARRAY_PHYS_ADDR, LENGTH = QHARRAY_SIZE |
39 | } | 44 | } |
40 | 45 | ||
@@ -97,25 +102,35 @@ SECTIONS | |||
97 | .vectors 0x0 : | 102 | .vectors 0x0 : |
98 | { | 103 | { |
99 | _vectorsstart = .; | 104 | _vectorsstart = .; |
100 | *(.vectors); | 105 | *(.vectors) |
101 | _vectorsend = .; | 106 | _vectorsend = .; |
102 | } AT> DRAM | 107 | } AT> DRAM |
103 | 108 | ||
104 | _vectorscopy = LOADADDR(.vectors); | 109 | _vectorscopy = LOADADDR(.vectors); |
105 | 110 | ||
111 | .init : | ||
112 | { | ||
113 | . = ALIGN(4); | ||
114 | _initstart = .; | ||
115 | *(.init) | ||
116 | *(.sdmacode) | ||
117 | _initend = .; | ||
118 | } > INIT AT> DRAM | ||
119 | |||
120 | _initcopy = LOADADDR(.init); | ||
121 | |||
106 | .stack (NOLOAD) : | 122 | .stack (NOLOAD) : |
107 | { | 123 | { |
108 | *(.stack) | 124 | . = ALIGN(4); |
109 | stackbegin = .; | 125 | *(.stack) |
110 | . += 0x2000; | 126 | stackbegin = .; |
111 | stackend = .; | 127 | . += 0x2000; |
128 | stackend = .; | ||
112 | } > DRAM | 129 | } > DRAM |
113 | 130 | ||
114 | _sdmacodecopy = stackbegin; | ||
115 | |||
116 | .bss (NOLOAD) : | 131 | .bss (NOLOAD) : |
117 | { | 132 | { |
118 | _edata = .; | 133 | _edata = .; |
119 | *(.bss*) | 134 | *(.bss*) |
120 | *(.ibss) | 135 | *(.ibss) |
121 | *(COMMON) | 136 | *(COMMON) |
@@ -158,13 +173,6 @@ SECTIONS | |||
158 | pluginbuf = .; | 173 | pluginbuf = .; |
159 | } | 174 | } |
160 | 175 | ||
161 | .sdma _pluginbuf : AT( _sdmacodecopy ) | ||
162 | { | ||
163 | _sdmacodestart = .; | ||
164 | *(.sdmacode); | ||
165 | _sdmacodeend = .; | ||
166 | } | ||
167 | |||
168 | .qharray (NOLOAD) : | 176 | .qharray (NOLOAD) : |
169 | { | 177 | { |
170 | _qharray = .; | 178 | _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) | |||
116 | ); | 116 | ); |
117 | } | 117 | } |
118 | 118 | ||
119 | void avic_init(void) | 119 | void INIT_ATTR avic_init(void) |
120 | { | 120 | { |
121 | int i; | 121 | int i; |
122 | 122 | ||
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: | |||
231 | bhi 1b | 231 | bhi 1b |
232 | #endif /* BOOTLOADER */ | 232 | #endif /* BOOTLOADER */ |
233 | 233 | ||
234 | #ifndef BOOTLOADER | 234 | #ifdef HAVE_INIT_ATTR |
235 | /* Copy discardable SDMA code - loaded in the stack section | 235 | /* copy init data to codec buffer */ |
236 | * and so must be done first. Destination is the plugin buffer | 236 | /* must be done before bss is zeroed */ |
237 | * which is safe when SDMA init takes place just after kernel | 237 | ldr r4, =_initcopy |
238 | * init. */ | 238 | ldr r3, =_initend |
239 | ldr r4, =_sdmacodecopy | 239 | ldr r2, =_initstart |
240 | ldr r3, =_sdmacodeend | ||
241 | ldr r2, =_sdmacodestart | ||
242 | 1: | 240 | 1: |
243 | cmp r3, r2 | 241 | cmp r3, r2 |
244 | ldrhi r5, [r4], #4 | 242 | ldrhi r5, [r4], #4 |
245 | strhi r5, [r2], #4 | 243 | strhi r5, [r2], #4 |
246 | bhi 1b | 244 | bhi 1b |
247 | #endif /* BOOTLOADER */ | 245 | #endif /* HAVE_INIT_ATTR */ |
248 | 246 | ||
249 | /* Initialise bss and ncbss sections to zero */ | 247 | /* Initialise bss and ncbss sections to zero */ |
250 | ldr r2, =_edata | 248 | 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) | |||
248 | 248 | ||
249 | 249 | ||
250 | /* Initialize the DVFS hardware */ | 250 | /* Initialize the DVFS hardware */ |
251 | static void dvfs_init(void) | 251 | static void INIT_ATTR dvfs_init(void) |
252 | { | 252 | { |
253 | if (CCM_PMCR0 & CCM_PMCR0_DVFEN) | 253 | if (CCM_PMCR0 & CCM_PMCR0_DVFEN) |
254 | { | 254 | { |
@@ -514,7 +514,7 @@ static __attribute__((interrupt("IRQ"))) void CCM_CLK_HANDLER(void) | |||
514 | 514 | ||
515 | 515 | ||
516 | /* Initialize the DPTC hardware */ | 516 | /* Initialize the DPTC hardware */ |
517 | static void dptc_init(void) | 517 | static void INIT_ATTR dptc_init(void) |
518 | { | 518 | { |
519 | /* Force DPTC off if running for some reason. */ | 519 | /* Force DPTC off if running for some reason. */ |
520 | imx31_regmod32(&CCM_PMCR0, CCM_PMCR0_PTVAIM, | 520 | imx31_regmod32(&CCM_PMCR0, CCM_PMCR0_PTVAIM, |
@@ -590,7 +590,7 @@ static void dptc_stop(void) | |||
590 | /** Main module interface **/ | 590 | /** Main module interface **/ |
591 | 591 | ||
592 | /* Initialize DVFS and DPTC */ | 592 | /* Initialize DVFS and DPTC */ |
593 | void dvfs_dptc_init(void) | 593 | void INIT_ATTR dvfs_dptc_init(void) |
594 | { | 594 | { |
595 | dptc_init(); | 595 | dptc_init(); |
596 | dvfs_init(); | 596 | 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) | |||
184 | return headphones_detect; | 184 | return headphones_detect; |
185 | } | 185 | } |
186 | 186 | ||
187 | void headphone_init(void) | 187 | void INIT_ATTR headphone_init(void) |
188 | { | 188 | { |
189 | /* A thread is required to monitor the remote ADC and jack state. */ | 189 | /* A thread is required to monitor the remote ADC and jack state. */ |
190 | wakeup_init(&headphone_wakeup); | 190 | 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) | |||
37 | call_tick_tasks(); | 37 | call_tick_tasks(); |
38 | } | 38 | } |
39 | 39 | ||
40 | void tick_start(unsigned int interval_in_ms) | 40 | void INIT_ATTR tick_start(unsigned int interval_in_ms) |
41 | { | 41 | { |
42 | ccm_module_clock_gating(CG_EPIT1, CGM_ON_RUN_WAIT); /* EPIT1 module | 42 | ccm_module_clock_gating(CG_EPIT1, CGM_ON_RUN_WAIT); /* EPIT1 module |
43 | clock ON - before writing | 43 | clock ON - before writing |
@@ -65,7 +65,7 @@ void tick_start(unsigned int interval_in_ms) | |||
65 | EPITCR1 |= EPITCR_EN; /* Enable the counter */ | 65 | EPITCR1 |= EPITCR_EN; /* Enable the counter */ |
66 | } | 66 | } |
67 | 67 | ||
68 | void kernel_device_init(void) | 68 | void INIT_ATTR kernel_device_init(void) |
69 | { | 69 | { |
70 | sdma_init(); | 70 | sdma_init(); |
71 | spi_init(); | 71 | 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) | |||
147 | } | 147 | } |
148 | 148 | ||
149 | /* LCD init */ | 149 | /* LCD init */ |
150 | void lcd_init_device(void) | 150 | void INIT_ATTR lcd_init_device(void) |
151 | { | 151 | { |
152 | /* Move the framebuffer */ | 152 | /* Move the framebuffer */ |
153 | #ifdef BOOTLOADER | 153 | #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) | |||
606 | return ok; | 606 | return ok; |
607 | } | 607 | } |
608 | 608 | ||
609 | void powermgmt_init_target(void) | 609 | void INIT_ATTR powermgmt_init_target(void) |
610 | { | 610 | { |
611 | last_inputs = power_thread_inputs; | 611 | last_inputs = power_thread_inputs; |
612 | 612 | ||
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) | |||
48 | return product_rev; | 48 | return product_rev; |
49 | } | 49 | } |
50 | 50 | ||
51 | static void iim_init(void) | 51 | static void INIT_ATTR iim_init(void) |
52 | { | 52 | { |
53 | /* Initialize the IC revision info (required by SDMA) */ | 53 | /* Initialize the IC revision info (required by SDMA) */ |
54 | ccm_module_clock_gating(CG_IIM, CGM_ON_RUN_WAIT); | 54 | ccm_module_clock_gating(CG_IIM, CGM_ON_RUN_WAIT); |
@@ -136,7 +136,7 @@ void system_exception_wait(void) | |||
136 | system_halt(); | 136 | system_halt(); |
137 | } | 137 | } |
138 | 138 | ||
139 | void system_init(void) | 139 | void INIT_ATTR system_init(void) |
140 | { | 140 | { |
141 | static const int disable_clocks[] = | 141 | static const int disable_clocks[] = |
142 | { | 142 | { |
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) | |||
150 | } | 150 | } |
151 | #endif | 151 | #endif |
152 | 152 | ||
153 | void gpio_init(void) | 153 | void INIT_ATTR gpio_init(void) |
154 | { | 154 | { |
155 | /* Mask-out GPIO interrupts - enable what's wanted later */ | 155 | /* Mask-out GPIO interrupts - enable what's wanted later */ |
156 | int i; | 156 | 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) | |||
143 | wakeup_signal(&mc13783_svc_wake); | 143 | wakeup_signal(&mc13783_svc_wake); |
144 | } | 144 | } |
145 | 145 | ||
146 | void mc13783_init(void) | 146 | void INIT_ATTR mc13783_init(void) |
147 | { | 147 | { |
148 | /* Serial interface must have been initialized first! */ | 148 | /* Serial interface must have been initialized first! */ |
149 | wakeup_init(&mc13783_svc_wake); | 149 | 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) | |||
500 | } | 500 | } |
501 | 501 | ||
502 | /** Public routines **/ | 502 | /** Public routines **/ |
503 | void sdma_init(void) | 503 | void INIT_ATTR sdma_init(void) |
504 | { | 504 | { |
505 | int i; | 505 | int i; |
506 | unsigned long acr; | 506 | 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) | |||
331 | #endif | 331 | #endif |
332 | 332 | ||
333 | /* Initialize the SPI driver */ | 333 | /* Initialize the SPI driver */ |
334 | void spi_init(void) | 334 | void INIT_ATTR spi_init(void) |
335 | { | 335 | { |
336 | unsigned i; | 336 | unsigned i; |
337 | for (i = 0; i < SPI_NUM_CSPI; i++) | 337 | 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 () { | |||
40 | } | 40 | } |
41 | 41 | ||
42 | findarmgcc() { | 42 | findarmgcc() { |
43 | 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" | 43 | 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" |
44 | if [ "$ARG_ARM_EABI" != 1 ]; then # eabi not explicitely enabled | 44 | if [ "$ARG_ARM_EABI" != 1 ]; then # eabi not explicitely enabled |
45 | for model in $models_not_checked_with_eabi; do | 45 | for model in $models_not_checked_with_eabi; do |
46 | if [ "$modelname" = "$model" ]; then | 46 | if [ "$modelname" = "$model" ]; then |