summaryrefslogtreecommitdiff
path: root/firmware/target/arm/system-pp502x.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/system-pp502x.c')
-rw-r--r--firmware/target/arm/system-pp502x.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/firmware/target/arm/system-pp502x.c b/firmware/target/arm/system-pp502x.c
index 41b43ba24d..bd71d28417 100644
--- a/firmware/target/arm/system-pp502x.c
+++ b/firmware/target/arm/system-pp502x.c
@@ -260,12 +260,11 @@ static void init_cache(void)
260 CACHE_CTL |= CACHE_CTL_INIT | CACHE_CTL_ENABLE | CACHE_CTL_RUN; 260 CACHE_CTL |= CACHE_CTL_INIT | CACHE_CTL_ENABLE | CACHE_CTL_RUN;
261 nop; nop; nop; nop; 261 nop; nop; nop; nop;
262} 262}
263#endif /* BOOTLOADER || HAVE_BOOTLOADER_USB_MODE*/ 263#endif /* BOOTLOADER || HAVE_BOOTLOADER_USB_MODE */
264 264
265/* We need this for Sansas since we boost the cpu in their bootloader */ 265/* We need this for Sansas since we boost the cpu in their bootloader */
266#if !defined(BOOTLOADER) || defined(HAVE_BOOTLOADER_USB_MODE) || \ 266#if !defined(BOOTLOADER) || (defined(SANSA_E200) || defined(SANSA_C200) || \
267 defined(SANSA_E200) || defined(SANSA_C200) || \ 267 defined(PHILIPS_SA9200))
268 defined(PHILIPS_SA9200)
269void scale_suspend_core(bool suspend) ICODE_ATTR; 268void scale_suspend_core(bool suspend) ICODE_ATTR;
270void scale_suspend_core(bool suspend) 269void scale_suspend_core(bool suspend)
271{ 270{
@@ -409,12 +408,11 @@ static void pp_set_cpu_frequency(long frequency)
409 corelock_unlock(&cpufreq_cl); 408 corelock_unlock(&cpufreq_cl);
410#endif 409#endif
411} 410}
412#endif /* !BOOTLOADER || HAVE_BOOTLOADER_USB_MODE || 411#endif /* !BOOTLOADER || (SANSA_E200 || SANSA_C200 || PHILIPS_SA9200) */
413 SANSA_E200 || SANSA_C200 || PHILIPS_SA9200 */
414 412
413#ifndef BOOTLOADER
415void system_init(void) 414void system_init(void)
416{ 415{
417#ifndef BOOTLOADER
418 if (CURRENT_CORE == CPU) 416 if (CURRENT_CORE == CPU)
419 { 417 {
420#if defined (IRIVER_H10) || defined(IRIVER_H10_5GB) || defined(IPOD_COLOR) 418#if defined (IRIVER_H10) || defined(IRIVER_H10_5GB) || defined(IPOD_COLOR)
@@ -538,10 +536,13 @@ void system_init(void)
538 } 536 }
539 537
540 init_cache(); 538 init_cache();
539}
541 540
542#else /* !BOOTLOADER */ 541#else /* BOOTLOADER */
543 /* Only the CPU gets here in the bootloader */
544 542
543void system_init(void)
544{
545 /* Only the CPU gets here in the bootloader */
545#ifdef HAVE_BOOTLOADER_USB_MODE 546#ifdef HAVE_BOOTLOADER_USB_MODE
546 disable_all_interrupts(); 547 disable_all_interrupts();
547 init_cache(); 548 init_cache();
@@ -550,13 +551,23 @@ void system_init(void)
550#endif /* HAVE_BOOTLOADER_USB_MODE */ 551#endif /* HAVE_BOOTLOADER_USB_MODE */
551 552
552#if defined(SANSA_C200) || defined(SANSA_E200) || defined(PHILIPS_SA9200) 553#if defined(SANSA_C200) || defined(SANSA_E200) || defined(PHILIPS_SA9200)
553 pp_set_cpu_frequency(CPUFREQ_MAX); 554 pp_set_cpu_frequency(CPUFREQ_MAX);
554#endif 555#endif
555 /* Else the frequency shot get changed upon USB connect - 556 /* Else the frequency should get changed upon USB connect -
556 * decide per-target */ 557 * decide per-target */
558}
557 559
558#endif /* BOOTLOADER */ 560#ifdef HAVE_BOOTLOADER_USB_MODE
561void system_prepare_fw_start(void)
562{
563 disable_interrupt(IRQ_FIQ_STATUS);
564 tick_stop();
565 disable_all_interrupts();
566 /* Some OF's disable this themselves, others do not and will hang. */
567 CACHE_CTL &= ~CACHE_CTL_VECT_REMAP;
559} 568}
569#endif /* HAVE_BOOTLOADER_USB_MODE */
570#endif /* !BOOTLOADER */
560 571
561void ICODE_ATTR system_reboot(void) 572void ICODE_ATTR system_reboot(void)
562{ 573{
@@ -597,10 +608,3 @@ int system_memory_guard(int newmode)
597 return 0; 608 return 0;
598} 609}
599 610
600#ifdef HAVE_BOOTLOADER_USB_MODE
601void system_prepare_fw_start(void)
602{
603 tick_stop();
604 disable_all_interrupts();
605}
606#endif