summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tatung/tpj1022
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2006-12-20 15:28:32 +0000
committerBarry Wardell <rockbox@barrywardell.net>2006-12-20 15:28:32 +0000
commit4b54302b0713be2995a33cfa30d1615fc206f1eb (patch)
treeca05677c3d23d5091c9abd4949732c6ea91519e7 /firmware/target/arm/tatung/tpj1022
parent57228769a2a0da43042d57048215ad67cd49e443 (diff)
downloadrockbox-4b54302b0713be2995a33cfa30d1615fc206f1eb.tar.gz
rockbox-4b54302b0713be2995a33cfa30d1615fc206f1eb.zip
Combine USB code for all PortalPlayer targets since they most likely all use the same USB hardware. Add register defines for the USB hardware addresses, based off the Freescale i.MX31 datasheet. Use usb_init() from the iPod code, but modified to use the new register defines rather than oul/inl on the hardware addresses.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11823 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/tatung/tpj1022')
-rw-r--r--firmware/target/arm/tatung/tpj1022/usb-target.h27
-rw-r--r--firmware/target/arm/tatung/tpj1022/usb-tpj1022.c107
2 files changed, 0 insertions, 134 deletions
diff --git a/firmware/target/arm/tatung/tpj1022/usb-target.h b/firmware/target/arm/tatung/tpj1022/usb-target.h
deleted file mode 100644
index 7a17f7bacf..0000000000
--- a/firmware/target/arm/tatung/tpj1022/usb-target.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Barry Wardelll
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20/* Based off x5 version */
21
22#ifndef USB_TARGET_H
23#define USB_TARGET_H
24
25bool usb_init_device(void);
26
27#endif
diff --git a/firmware/target/arm/tatung/tpj1022/usb-tpj1022.c b/firmware/target/arm/tatung/tpj1022/usb-tpj1022.c
deleted file mode 100644
index b238de4369..0000000000
--- a/firmware/target/arm/tatung/tpj1022/usb-tpj1022.c
+++ /dev/null
@@ -1,107 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Barry Wardell
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20/* Code from the iPod port but commented out. USB detection custom made based
21 on GPIO analysis */
22
23#include "config.h"
24#include "cpu.h"
25#include "kernel.h"
26#include "thread.h"
27#include "system.h"
28#include "debug.h"
29#include "ata.h"
30#include "fat.h"
31#include "disk.h"
32#include "panic.h"
33#include "lcd.h"
34#include "adc.h"
35#include "usb.h"
36#include "button.h"
37#include "sprintf.h"
38#include "string.h"
39#include "hwcompat.h"
40#ifdef HAVE_MMC
41#include "ata_mmc.h"
42#endif
43
44void usb_init_device(void)
45{
46#if 0
47 int r0;
48 outl(inl(0x70000084) | 0x200, 0x70000084);
49
50 outl(inl(0x7000002C) | 0x3000000, 0x7000002C);
51 outl(inl(0x6000600C) | 0x400000, 0x6000600C);
52
53 outl(inl(0x60006004) | 0x400000, 0x60006004); /* reset usb start */
54 outl(inl(0x60006004) & ~0x400000, 0x60006004); /* reset usb end */
55
56 outl(inl(0x70000020) | 0x80000000, 0x70000020);
57 while ((inl(0x70000028) & 0x80) == 0);
58
59 outl(inl(0xc5000184) | 0x100, 0xc5000184);
60 while ((inl(0xc5000184) & 0x100) != 0);
61
62 outl(inl(0xc50001A4) | 0x5F000000, 0xc50001A4);
63 if ((inl(0xc50001A4) & 0x100) == 0) {
64 outl(inl(0xc50001A8) & ~0x3, 0xc50001A8);
65 outl(inl(0xc50001A8) | 0x2, 0xc50001A8);
66 outl(inl(0x70000028) | 0x4000, 0x70000028);
67 outl(inl(0x70000028) | 0x2, 0x70000028);
68 } else {
69 outl(inl(0xc50001A8) | 0x3, 0xc50001A8);
70 outl(inl(0x70000028) &~0x4000, 0x70000028);
71 outl(inl(0x70000028) | 0x2, 0x70000028);
72 }
73 outl(inl(0xc5000140) | 0x2, 0xc5000140);
74 while((inl(0xc5000140) & 0x2) != 0);
75 r0 = inl(0xc5000184);
76
77 /* Note from IPL source (referring to next 5 lines of code:
78 THIS NEEDS TO BE CHANGED ONCE THERE IS KERNEL USB */
79 outl(inl(0x70000020) | 0x80000000, 0x70000020);
80 outl(inl(0x6000600C) | 0x400000, 0x6000600C);
81 while ((inl(0x70000028) & 0x80) == 0);
82 outl(inl(0x70000028) | 0x2, 0x70000028);
83
84 udelay(0x186A0);
85#endif
86}
87
88bool usb_detect(void)
89{
90 return false;
91}
92
93void usb_enable(bool on)
94{
95 (void)on;
96#if 0
97 /* For the ipod, we can only do one thing with USB mode - reboot
98 into Apple's flash-based disk-mode. This does not return. */
99 if (on)
100 {
101 /* The following code is copied from ipodlinux */
102 unsigned char* storage_ptr = (unsigned char *)0x40017F00;
103 memcpy(storage_ptr, "diskmode\0\0hotstuff\0\0\1", 21);
104 DEV_RS |= 4; /* Reboot */
105 }
106#endif
107}