summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2008-11-10 11:04:43 +0000
committerRafaël Carré <rafael.carre@gmail.com>2008-11-10 11:04:43 +0000
commit6b566568ebdb9e06a0f007606cce98ac996d541a (patch)
tree00808daafeee2b419ad12c3306d0a02b29c2ff35
parentb52a3da2b5ad0ee7d7061af863f0acd33d327292 (diff)
downloadrockbox-6b566568ebdb9e06a0f007606cce98ac996d541a.tar.gz
rockbox-6b566568ebdb9e06a0f007606cce98ac996d541a.zip
Fix Clip firmware building by adding missing symbols
Implement some of the new functions Use as3514 rtc Add AS3525 case in rolo.c Copy card_get_info_target() from ata-sd-pp.c , and use the correct 32bits words order git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19064 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/SOURCES14
-rw-r--r--firmware/export/config-clip.h6
-rw-r--r--firmware/rolo.c3
-rw-r--r--firmware/target/arm/as3525/adc-as3525.c33
-rw-r--r--firmware/target/arm/as3525/ata_sd_as3525.c60
-rw-r--r--firmware/target/arm/as3525/audio-as3525.c38
-rw-r--r--firmware/target/arm/as3525/debug-as3525.c35
-rw-r--r--firmware/target/arm/as3525/debug-target.h25
-rw-r--r--firmware/target/arm/as3525/i2c-as3525.c28
-rw-r--r--firmware/target/arm/as3525/i2s-as3525.c28
-rw-r--r--firmware/target/arm/as3525/pcm-as3525.c76
-rw-r--r--firmware/target/arm/as3525/power-as3525.c59
-rw-r--r--firmware/target/arm/as3525/powermgmt-as3525.c56
-rw-r--r--firmware/target/arm/as3525/system-as3525.c16
-rw-r--r--firmware/target/arm/as3525/usb-as3525.c41
15 files changed, 507 insertions, 11 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 2564a88812..859ae24920 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -336,7 +336,19 @@ target/arm/pnx0101/system-pnx0101.c
336target/arm/as3525/system-as3525.c 336target/arm/as3525/system-as3525.c
337target/arm/as3525/kernel-as3525.c 337target/arm/as3525/kernel-as3525.c
338target/arm/as3525/ata_sd_as3525.c 338target/arm/as3525/ata_sd_as3525.c
339#endif 339target/arm/as3525/power-as3525.c
340target/arm/as3525/usb-as3525.c
341#ifndef BOOTLOADER
342target/arm/as3525/adc-as3525.c
343target/arm/as3525/pcm-as3525.c
344target/arm/as3525/audio-as3525.c
345target/arm/as3525/debug-as3525.c
346target/arm/as3525/i2s-as3525.c
347target/arm/as3525/i2c-as3525.c
348drivers/rtc/rtc_as3514.c
349target/arm/as3525/powermgmt-as3525.c
350#endif /* BOOTLOADER */
351#endif /* CONFIG_CPU == AS3525 */
340 352
341#if defined(CPU_PP) 353#if defined(CPU_PP)
342target/arm/kernel-pp.c 354target/arm/kernel-pp.c
diff --git a/firmware/export/config-clip.h b/firmware/export/config-clip.h
index 9bc4a14bf5..17d975f49d 100644
--- a/firmware/export/config-clip.h
+++ b/firmware/export/config-clip.h
@@ -9,6 +9,8 @@
9#define FIRMWARE_OFFSET_FILE_DATA 8 9#define FIRMWARE_OFFSET_FILE_DATA 8
10#define FIRMWARE_OFFSET_FILE_CRC 0 10#define FIRMWARE_OFFSET_FILE_CRC 0
11 11
12#if 0 /* disabled since there is no driver (yet) */
13
12#define HW_SAMPR_CAPS (SAMPR_CAP_44) 14#define HW_SAMPR_CAPS (SAMPR_CAP_44)
13 15
14/* define this if you have recording possibility */ 16/* define this if you have recording possibility */
@@ -23,6 +25,8 @@
23 explicitly if different */ 25 explicitly if different */
24#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) 26#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO)
25 27
28#endif
29
26/* define this if you have a bitmap LCD display */ 30/* define this if you have a bitmap LCD display */
27#define HAVE_LCD_BITMAP 31#define HAVE_LCD_BITMAP
28 32
@@ -93,8 +97,10 @@
93#define AB_REPEAT_ENABLE 1 97#define AB_REPEAT_ENABLE 1
94 98
95/* FM Tuner */ 99/* FM Tuner */
100#if 0 /* disabled since there is no driver (yet) */
96#define CONFIG_TUNER SI4700 /* in fact SI4702 but let's hope it's compatible */ 101#define CONFIG_TUNER SI4700 /* in fact SI4702 but let's hope it's compatible */
97//#define HAVE_TUNER_PWR_CTRL 102//#define HAVE_TUNER_PWR_CTRL
103#endif
98 104
99/* Define this for LCD backlight available */ 105/* Define this for LCD backlight available */
100#define HAVE_BACKLIGHT 106#define HAVE_BACKLIGHT
diff --git a/firmware/rolo.c b/firmware/rolo.c
index 9724db2306..6a3fcd2bbb 100644
--- a/firmware/rolo.c
+++ b/firmware/rolo.c
@@ -230,7 +230,8 @@ int rolo_load(const char* filename)
230 length = filesize(fd) - FIRMWARE_OFFSET_FILE_DATA; 230 length = filesize(fd) - FIRMWARE_OFFSET_FILE_DATA;
231 231
232#if defined(CPU_COLDFIRE) || defined(CPU_PP) || (CONFIG_CPU==DM320) \ 232#if defined(CPU_COLDFIRE) || defined(CPU_PP) || (CONFIG_CPU==DM320) \
233 || defined(CPU_TCC780X) || (CONFIG_CPU==IMX31L) || (CONFIG_CPU == S3C2440) 233 || defined(CPU_TCC780X) || (CONFIG_CPU==IMX31L) || (CONFIG_CPU == S3C2440) \
234 || (CONFIG_CPU==AS3525)
234 /* Read and save checksum */ 235 /* Read and save checksum */
235 lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET); 236 lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET);
236 if (read(fd, &file_checksum, 4) != 4) { 237 if (read(fd, &file_checksum, 4) != 4) {
diff --git a/firmware/target/arm/as3525/adc-as3525.c b/firmware/target/arm/as3525/adc-as3525.c
new file mode 100644
index 0000000000..6e1aac5a65
--- /dev/null
+++ b/firmware/target/arm/as3525/adc-as3525.c
@@ -0,0 +1,33 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright © 2008 Rafaël Carré
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "adc.h"
23
24/* TODO */
25
26unsigned short adc_read(int channel)
27{
28 return 0;
29}
30
31void adc_init(void)
32{
33}
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c
index 25052de826..6722e8e94a 100644
--- a/firmware/target/arm/as3525/ata_sd_as3525.c
+++ b/firmware/target/arm/as3525/ata_sd_as3525.c
@@ -616,6 +616,7 @@ sd_read_error:
616 } 616 }
617} 617}
618 618
619#ifndef BOOTLOADER
619void sd_sleep(void) 620void sd_sleep(void)
620{ 621{
621} 622}
@@ -628,3 +629,62 @@ void sd_spindown(int seconds)
628{ 629{
629 (void)seconds; 630 (void)seconds;
630} 631}
632
633long sd_last_disk_activity(void)
634{
635 return last_disk_activity;
636}
637
638void sd_enable(bool on)
639{
640 if(on)
641 {
642 CGU_PERI |= CGU_NAF_CLOCK_ENABLE;
643#ifdef HAVE_MULTIVOLUME
644 CGU_PERI |= CGU_MCI_CLOCK_ENABLE;
645#endif
646 CGU_IDE |= (1<<7) /* AHB interface enable */ |
647 (1<<6) /* interface enable */;
648 }
649 else
650 {
651 CGU_PERI &= ~CGU_NAF_CLOCK_ENABLE;
652#ifdef HAVE_MULTIVOLUME
653 CGU_PERI &= ~CGU_MCI_CLOCK_ENABLE;
654#endif
655 CGU_IDE &= ~((1<<7)|(1<<6));
656 }
657}
658
659/* move the sd-card info to mmc struct */
660tCardInfo *card_get_info_target(int card_no)
661{
662 int i, temp;
663 static tCardInfo card;
664 static const char mantissa[] = { /* *10 */
665 0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 };
666 static const int exponent[] = { /* use varies */
667 1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000 };
668
669 card.initialized = card_info[card_no].initialized;
670 card.ocr = card_info[card_no].ocr;
671 for(i=0; i<4; i++) card.csd[i] = card_info[card_no].csd[i];
672 for(i=0; i<4; i++) card.cid[i] = card_info[card_no].cid[i];
673 card.numblocks = card_info[card_no].numblocks;
674 card.blocksize = card_info[card_no].block_size;
675 temp = card_extract_bits(card.csd, 29, 3);
676 card.speed = mantissa[card_extract_bits(card.csd, 25, 4)]
677 * exponent[temp > 2 ? 7 : temp + 4];
678 card.nsac = 100 * card_extract_bits(card.csd, 16, 8);
679 temp = card_extract_bits(card.csd, 13, 3);
680 card.tsac = mantissa[card_extract_bits(card.csd, 9, 4)]
681 * exponent[temp] / 10;
682 card.cid[0] = htobe32(card.cid[0]); /* ascii chars here */
683 card.cid[1] = htobe32(card.cid[1]); /* ascii chars here */
684 temp = *((char*)card.cid+13); /* adjust year<=>month, 1997 <=> 2000 */
685 *((char*)card.cid+13) = (unsigned char)((temp >> 4) | (temp << 4)) + 3;
686
687 return &card;
688}
689
690#endif /* BOOTLOADER */
diff --git a/firmware/target/arm/as3525/audio-as3525.c b/firmware/target/arm/as3525/audio-as3525.c
new file mode 100644
index 0000000000..d88fd1b5ec
--- /dev/null
+++ b/firmware/target/arm/as3525/audio-as3525.c
@@ -0,0 +1,38 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright © 2008 Rafaël Carré
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "system.h"
22#include "cpu.h"
23#include "audio.h"
24#include "sound.h"
25
26/* TODO */
27
28void audiohw_enable_output(bool on)
29{
30}
31
32void audio_set_output_source(int source)
33{
34}
35
36void audio_input_mux(int source, unsigned flags)
37{
38}
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c
new file mode 100644
index 0000000000..8a2f8838d6
--- /dev/null
+++ b/firmware/target/arm/as3525/debug-as3525.c
@@ -0,0 +1,35 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright © 2008 Rafaël Carré
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include <stdbool.h>
23#include "debug-target.h"
24
25/* TODO */
26
27bool __dbg_ports(void)
28{
29 return false;
30}
31
32bool __dbg_hw_info(void)
33{
34 return false;
35}
diff --git a/firmware/target/arm/as3525/debug-target.h b/firmware/target/arm/as3525/debug-target.h
new file mode 100644
index 0000000000..d3b7a28aee
--- /dev/null
+++ b/firmware/target/arm/as3525/debug-target.h
@@ -0,0 +1,25 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Karl Kurbjun
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include <stdbool.h>
23
24bool __dbg_hw_info(void);
25bool __dbg_ports(void);
diff --git a/firmware/target/arm/as3525/i2c-as3525.c b/firmware/target/arm/as3525/i2c-as3525.c
new file mode 100644
index 0000000000..32f33435bc
--- /dev/null
+++ b/firmware/target/arm/as3525/i2c-as3525.c
@@ -0,0 +1,28 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright © 2008 Rafaël Carré
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "i2c.h"
23
24/* TODO */
25
26void i2c_init(void)
27{
28}
diff --git a/firmware/target/arm/as3525/i2s-as3525.c b/firmware/target/arm/as3525/i2s-as3525.c
new file mode 100644
index 0000000000..298788e796
--- /dev/null
+++ b/firmware/target/arm/as3525/i2s-as3525.c
@@ -0,0 +1,28 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright © 2008 Rafaël Carré
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "i2s.h"
23
24/* TODO */
25
26void i2s_reset(void)
27{
28}
diff --git a/firmware/target/arm/as3525/pcm-as3525.c b/firmware/target/arm/as3525/pcm-as3525.c
new file mode 100644
index 0000000000..e2c31ad047
--- /dev/null
+++ b/firmware/target/arm/as3525/pcm-as3525.c
@@ -0,0 +1,76 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright © 2008 Rafaël Carré
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "system.h"
22#include "audio.h"
23#include "string.h"
24
25/* TODO */
26
27void pcm_play_lock(void)
28{
29}
30
31void pcm_play_unlock(void)
32{
33}
34
35void pcm_play_dma_start(const void *addr, size_t size)
36{
37}
38
39void pcm_play_dma_stop(void)
40{
41}
42
43void pcm_play_dma_pause(bool pause)
44{
45}
46
47unsigned long physical_address(void *p)
48{
49 return 0;
50}
51
52void pcm_play_dma_init(void)
53{
54}
55
56void pcm_postinit(void)
57{
58}
59
60void pcm_set_frequency(unsigned int frequency)
61{
62}
63
64void pcm_apply_settings(void)
65{
66}
67
68size_t pcm_get_bytes_waiting(void)
69{
70 return 0;
71}
72
73const void * pcm_play_dma_get_peak_buffer(int *count)
74{
75 return NULL;
76}
diff --git a/firmware/target/arm/as3525/power-as3525.c b/firmware/target/arm/as3525/power-as3525.c
new file mode 100644
index 0000000000..3d191ec3b5
--- /dev/null
+++ b/firmware/target/arm/as3525/power-as3525.c
@@ -0,0 +1,59 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright © 2008 Rafaël Carré
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "config.h"
23#include "as3525-codec.h"
24#include <stdbool.h>
25
26void power_off(void)
27{
28 /* clear bit 0 of system register */
29 ascodec_write(0x20, ascodec_read(0x20) & ~1);
30
31 /* TODO : turn off peripherals properly ? */
32
33 while(1); /* wait for system to shut down */
34}
35
36void power_init(void)
37{
38}
39
40bool charger_inserted(void)
41{
42 if(ascodec_read(0x25) & (1<<5))
43 return true;
44 else
45 return false;
46}
47
48void ide_power_enable(bool on)
49{
50 (void)on;
51}
52
53#if CONFIG_TUNER
54bool tuner_power(bool status)
55{
56 (void)status;
57 return false;
58}
59#endif
diff --git a/firmware/target/arm/as3525/powermgmt-as3525.c b/firmware/target/arm/as3525/powermgmt-as3525.c
new file mode 100644
index 0000000000..ac1ee79f00
--- /dev/null
+++ b/firmware/target/arm/as3525/powermgmt-as3525.c
@@ -0,0 +1,56 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright © 2008 Rafaël Carré
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "config.h"
23#include "adc.h"
24#include "powermgmt.h"
25
26/* TODO */
27
28const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
29{
30 0
31};
32
33const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
34{
35 0
36};
37
38/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
39const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
40{
41 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
42};
43
44#if CONFIG_CHARGING
45/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
46const unsigned short percent_to_volt_charge[11] =
47{
48 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
49};
50#endif /* CONFIG_CHARGING */
51
52/* Returns battery voltage from ADC [millivolts] */
53unsigned int battery_adc_voltage(void)
54{
55 return 1;
56}
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index e79dd460fa..07832f1a49 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -252,14 +252,12 @@ int system_memory_guard(int newmode)
252 return 0; 252 return 0;
253} 253}
254 254
255void power_off(void) 255#ifndef BOOTLOADER
256{
257 int system;
258 system = ascodec_read(0x20);
259 system &= ~1; /* clear bit 0 of system register */
260 ascodec_write(0x20, system);
261
262 /* TODO : turn off peripherals properly ? */
263 256
264 while(1); 257#ifdef HAVE_ADJUSTABLE_CPU_FREQ
258void set_cpu_frequency(long frequency)
259{
260 /* TODO */
265} 261}
262#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
263#endif /* BOOTLOADER */
diff --git a/firmware/target/arm/as3525/usb-as3525.c b/firmware/target/arm/as3525/usb-as3525.c
new file mode 100644
index 0000000000..c9a6381b38
--- /dev/null
+++ b/firmware/target/arm/as3525/usb-as3525.c
@@ -0,0 +1,41 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright © 2008 Rafaël Carré
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "usb.h"
23#include "power.h"
24#include <stdbool.h>
25
26void usb_enable(bool on)
27{
28 (void)on;
29}
30
31void usb_init_device(void)
32{
33 /* TODO */
34}
35
36int usb_detect(void)
37{
38 if (charger_inserted())
39 return USB_INSERTED;
40 return USB_EXTRACTED;
41}