diff options
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r-- | firmware/target/arm/as3525/adc-as3525.c | 33 | ||||
-rw-r--r-- | firmware/target/arm/as3525/ata_sd_as3525.c | 60 | ||||
-rw-r--r-- | firmware/target/arm/as3525/audio-as3525.c | 38 | ||||
-rw-r--r-- | firmware/target/arm/as3525/debug-as3525.c | 35 | ||||
-rw-r--r-- | firmware/target/arm/as3525/debug-target.h | 25 | ||||
-rw-r--r-- | firmware/target/arm/as3525/i2c-as3525.c | 28 | ||||
-rw-r--r-- | firmware/target/arm/as3525/i2s-as3525.c | 28 | ||||
-rw-r--r-- | firmware/target/arm/as3525/pcm-as3525.c | 76 | ||||
-rw-r--r-- | firmware/target/arm/as3525/power-as3525.c | 59 | ||||
-rw-r--r-- | firmware/target/arm/as3525/powermgmt-as3525.c | 56 | ||||
-rw-r--r-- | firmware/target/arm/as3525/system-as3525.c | 16 | ||||
-rw-r--r-- | firmware/target/arm/as3525/usb-as3525.c | 41 |
12 files changed, 486 insertions, 9 deletions
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 | |||
26 | unsigned short adc_read(int channel) | ||
27 | { | ||
28 | return 0; | ||
29 | } | ||
30 | |||
31 | void 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 | ||
619 | void sd_sleep(void) | 620 | void 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 | |||
633 | long sd_last_disk_activity(void) | ||
634 | { | ||
635 | return last_disk_activity; | ||
636 | } | ||
637 | |||
638 | void 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 */ | ||
660 | tCardInfo *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 | |||
28 | void audiohw_enable_output(bool on) | ||
29 | { | ||
30 | } | ||
31 | |||
32 | void audio_set_output_source(int source) | ||
33 | { | ||
34 | } | ||
35 | |||
36 | void 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 | |||
27 | bool __dbg_ports(void) | ||
28 | { | ||
29 | return false; | ||
30 | } | ||
31 | |||
32 | bool __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 | |||
24 | bool __dbg_hw_info(void); | ||
25 | bool __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 | |||
26 | void 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 | |||
26 | void 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 | |||
27 | void pcm_play_lock(void) | ||
28 | { | ||
29 | } | ||
30 | |||
31 | void pcm_play_unlock(void) | ||
32 | { | ||
33 | } | ||
34 | |||
35 | void pcm_play_dma_start(const void *addr, size_t size) | ||
36 | { | ||
37 | } | ||
38 | |||
39 | void pcm_play_dma_stop(void) | ||
40 | { | ||
41 | } | ||
42 | |||
43 | void pcm_play_dma_pause(bool pause) | ||
44 | { | ||
45 | } | ||
46 | |||
47 | unsigned long physical_address(void *p) | ||
48 | { | ||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | void pcm_play_dma_init(void) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | void pcm_postinit(void) | ||
57 | { | ||
58 | } | ||
59 | |||
60 | void pcm_set_frequency(unsigned int frequency) | ||
61 | { | ||
62 | } | ||
63 | |||
64 | void pcm_apply_settings(void) | ||
65 | { | ||
66 | } | ||
67 | |||
68 | size_t pcm_get_bytes_waiting(void) | ||
69 | { | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | const 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 | |||
26 | void 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 | |||
36 | void power_init(void) | ||
37 | { | ||
38 | } | ||
39 | |||
40 | bool charger_inserted(void) | ||
41 | { | ||
42 | if(ascodec_read(0x25) & (1<<5)) | ||
43 | return true; | ||
44 | else | ||
45 | return false; | ||
46 | } | ||
47 | |||
48 | void ide_power_enable(bool on) | ||
49 | { | ||
50 | (void)on; | ||
51 | } | ||
52 | |||
53 | #if CONFIG_TUNER | ||
54 | bool 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 | |||
28 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = | ||
29 | { | ||
30 | 0 | ||
31 | }; | ||
32 | |||
33 | const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = | ||
34 | { | ||
35 | 0 | ||
36 | }; | ||
37 | |||
38 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ | ||
39 | const 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 */ | ||
46 | const 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] */ | ||
53 | unsigned 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 | ||
255 | void 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 |
258 | void 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 | |||
26 | void usb_enable(bool on) | ||
27 | { | ||
28 | (void)on; | ||
29 | } | ||
30 | |||
31 | void usb_init_device(void) | ||
32 | { | ||
33 | /* TODO */ | ||
34 | } | ||
35 | |||
36 | int usb_detect(void) | ||
37 | { | ||
38 | if (charger_inserted()) | ||
39 | return USB_INSERTED; | ||
40 | return USB_EXTRACTED; | ||
41 | } | ||