diff options
Diffstat (limited to 'firmware/target/arm/s5l8700/usb-nano2g-6g.c')
-rw-r--r-- | firmware/target/arm/s5l8700/usb-nano2g-6g.c | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/firmware/target/arm/s5l8700/usb-nano2g-6g.c b/firmware/target/arm/s5l8700/usb-nano2g-6g.c deleted file mode 100644 index 6ae9f9b96b..0000000000 --- a/firmware/target/arm/s5l8700/usb-nano2g-6g.c +++ /dev/null | |||
@@ -1,117 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Michael Sparmann | ||
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 "usb.h" | ||
24 | #include "usb-s3c6400x.h" | ||
25 | #include "cpu.h" | ||
26 | |||
27 | #ifdef HAVE_USBSTACK | ||
28 | #include "usb_core.h" | ||
29 | #include "usb_drv.h" | ||
30 | |||
31 | void usb_enable(bool on) | ||
32 | { | ||
33 | if (on) usb_core_init(); | ||
34 | else usb_core_exit(); | ||
35 | } | ||
36 | |||
37 | #if CONFIG_CPU==S5L8701 | ||
38 | #include "power.h" | ||
39 | |||
40 | int usb_detect(void) | ||
41 | { | ||
42 | if (power_input_status() & POWER_INPUT_USB) | ||
43 | return USB_INSERTED; | ||
44 | return USB_EXTRACTED; | ||
45 | } | ||
46 | |||
47 | #elif CONFIG_CPU==S5L8702 | ||
48 | static int usb_status = USB_EXTRACTED; | ||
49 | |||
50 | int usb_detect(void) | ||
51 | { | ||
52 | return usb_status; | ||
53 | } | ||
54 | |||
55 | void usb_insert_int(void) | ||
56 | { | ||
57 | usb_status = USB_INSERTED; | ||
58 | #ifdef USB_STATUS_BY_EVENT | ||
59 | usb_status_event(USB_INSERTED); | ||
60 | #endif | ||
61 | } | ||
62 | |||
63 | void usb_remove_int(void) | ||
64 | { | ||
65 | usb_status = USB_EXTRACTED; | ||
66 | #ifdef USB_STATUS_BY_EVENT | ||
67 | usb_status_event(USB_EXTRACTED); | ||
68 | #endif | ||
69 | } | ||
70 | #endif /* S5L8702 */ | ||
71 | |||
72 | void usb_init_device(void) | ||
73 | { | ||
74 | /* Power up the core clocks to allow writing | ||
75 | to some registers needed to power it down */ | ||
76 | PCGCCTL = 0; | ||
77 | #if CONFIG_CPU==S5L8701 | ||
78 | PWRCON &= ~0x4000; | ||
79 | PWRCONEXT &= ~0x800; | ||
80 | INTMSK |= INTMSK_USB_OTG; | ||
81 | #elif CONFIG_CPU==S5L8702 | ||
82 | PWRCON(0) &= ~0x4; | ||
83 | PWRCON(1) &= ~0x8; | ||
84 | VIC0INTENABLE |= 1 << 19; | ||
85 | #endif | ||
86 | |||
87 | usb_drv_exit(); | ||
88 | } | ||
89 | |||
90 | #else /* !HAVE_USBSTACK */ | ||
91 | void usb_enable(bool on) | ||
92 | { | ||
93 | (void)on; | ||
94 | } | ||
95 | |||
96 | int usb_detect(void) | ||
97 | { | ||
98 | return USB_EXTRACTED; | ||
99 | } | ||
100 | |||
101 | void usb_init_device(void) | ||
102 | { | ||
103 | DCTL = DCTL_pwronprgdone | DCTL_sftdiscon; | ||
104 | |||
105 | ORSTCON = 1; /* Put the PHY into reset (needed to get current down) */ | ||
106 | PCGCCTL = 1; /* Shut down PHY clock */ | ||
107 | OPHYPWR = 0xF; /* PHY: Power down */ | ||
108 | |||
109 | #if CONFIG_CPU==S5L8701 | ||
110 | PWRCON |= 0x4000; | ||
111 | PWRCONEXT |= 0x800; | ||
112 | #elif CONFIG_CPU==S5L8702 | ||
113 | PWRCON(0) |= 0x4; | ||
114 | PWRCON(1) |= 0x8; | ||
115 | #endif | ||
116 | } | ||
117 | #endif | ||