diff options
-rw-r--r-- | apps/bitmaps/native/SOURCES | 4 | ||||
-rw-r--r-- | apps/bitmaps/native/usblogo.fw.128x39x2.bmp | bin | 0 -> 5062 bytes | |||
-rw-r--r-- | firmware/SOURCES | 23 | ||||
-rw-r--r-- | firmware/export/config-ipod1g2g.h | 3 | ||||
-rw-r--r-- | firmware/export/config-ipod3g.h | 3 | ||||
-rw-r--r-- | firmware/export/pp5002.h | 5 | ||||
-rw-r--r-- | firmware/target/arm/usb-fw-pp5002.c | 70 | ||||
-rw-r--r-- | firmware/target/arm/usb-fw-pp502x.c (renamed from firmware/target/arm/usb-pp.c) | 35 |
8 files changed, 113 insertions, 30 deletions
diff --git a/apps/bitmaps/native/SOURCES b/apps/bitmaps/native/SOURCES index 62deb0afac..094b2d61b1 100644 --- a/apps/bitmaps/native/SOURCES +++ b/apps/bitmaps/native/SOURCES | |||
@@ -31,7 +31,11 @@ usblogo.176x48x16.bmp | |||
31 | usblogo.128x37x16.bmp | 31 | usblogo.128x37x16.bmp |
32 | #endif | 32 | #endif |
33 | #elif LCD_DEPTH > 1 /* greyscale */ | 33 | #elif LCD_DEPTH > 1 /* greyscale */ |
34 | #ifdef IPOD_1G2G /* use firewire logo */ | ||
35 | usblogo.fw.128x39x2.bmp | ||
36 | #else | ||
34 | usblogo.128x33x2.bmp | 37 | usblogo.128x33x2.bmp |
38 | #endif | ||
35 | #else /* monochrome */ | 39 | #else /* monochrome */ |
36 | #if LCD_WIDTH == 112 | 40 | #if LCD_WIDTH == 112 |
37 | usblogo.100x20x1.bmp | 41 | usblogo.100x20x1.bmp |
diff --git a/apps/bitmaps/native/usblogo.fw.128x39x2.bmp b/apps/bitmaps/native/usblogo.fw.128x39x2.bmp new file mode 100644 index 0000000000..bdf7af52b7 --- /dev/null +++ b/apps/bitmaps/native/usblogo.fw.128x39x2.bmp | |||
Binary files differ | |||
diff --git a/firmware/SOURCES b/firmware/SOURCES index 91cead088d..ccd6f11570 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -382,7 +382,7 @@ target/arm/sandisk/sansa-e200/lcd-e200.c | |||
382 | target/arm/sandisk/sansa-e200/lcd-as-e200.S | 382 | target/arm/sandisk/sansa-e200/lcd-as-e200.S |
383 | target/arm/sandisk/sansa-e200/adc-e200.c | 383 | target/arm/sandisk/sansa-e200/adc-e200.c |
384 | target/arm/sandisk/sansa-e200/backlight-e200.c | 384 | target/arm/sandisk/sansa-e200/backlight-e200.c |
385 | target/arm/usb-pp.c | 385 | target/arm/usb-fw-pp502x.c |
386 | target/arm/sandisk/sansa-e200/button-e200.c | 386 | target/arm/sandisk/sansa-e200/button-e200.c |
387 | target/arm/sandisk/sansa-e200/power-e200.c | 387 | target/arm/sandisk/sansa-e200/power-e200.c |
388 | target/arm/i2s-pp.c | 388 | target/arm/i2s-pp.c |
@@ -497,7 +497,7 @@ target/arm/iriver/h10/backlight-h10.c | |||
497 | target/arm/iriver/h10/button-h10.c | 497 | target/arm/iriver/h10/button-h10.c |
498 | target/arm/iriver/h10/lcd-h10_20gb.c | 498 | target/arm/iriver/h10/lcd-h10_20gb.c |
499 | target/arm/iriver/h10/power-h10.c | 499 | target/arm/iriver/h10/power-h10.c |
500 | target/arm/usb-pp.c | 500 | target/arm/usb-fw-pp502x.c |
501 | #endif /* SIMULATOR */ | 501 | #endif /* SIMULATOR */ |
502 | #endif /* IRIVER_H10 */ | 502 | #endif /* IRIVER_H10 */ |
503 | 503 | ||
@@ -512,7 +512,7 @@ target/arm/iriver/h10/backlight-h10.c | |||
512 | target/arm/iriver/h10/button-h10.c | 512 | target/arm/iriver/h10/button-h10.c |
513 | target/arm/iriver/h10/lcd-h10_5gb.c | 513 | target/arm/iriver/h10/lcd-h10_5gb.c |
514 | target/arm/iriver/h10/power-h10.c | 514 | target/arm/iriver/h10/power-h10.c |
515 | target/arm/usb-pp.c | 515 | target/arm/usb-fw-pp502x.c |
516 | #endif /* SIMULATOR */ | 516 | #endif /* SIMULATOR */ |
517 | #endif /* IRIVER_H10_5GB */ | 517 | #endif /* IRIVER_H10_5GB */ |
518 | 518 | ||
@@ -551,7 +551,7 @@ target/arm/tatung/tpj1022/backlight-tpj1022.c | |||
551 | target/arm/tatung/tpj1022/button-tpj1022.c | 551 | target/arm/tatung/tpj1022/button-tpj1022.c |
552 | target/arm/tatung/tpj1022/lcd-tpj1022.c | 552 | target/arm/tatung/tpj1022/lcd-tpj1022.c |
553 | target/arm/tatung/tpj1022/power-tpj1022.c | 553 | target/arm/tatung/tpj1022/power-tpj1022.c |
554 | target/arm/usb-pp.c | 554 | target/arm/usb-fw-pp502x.c |
555 | #endif /* SIMULATOR */ | 555 | #endif /* SIMULATOR */ |
556 | #endif /* ELIO_TPJ1022 */ | 556 | #endif /* ELIO_TPJ1022 */ |
557 | 557 | ||
@@ -567,7 +567,7 @@ target/arm/ipod/backlight-4g_color.c | |||
567 | target/arm/ipod/button-clickwheel.c | 567 | target/arm/ipod/button-clickwheel.c |
568 | target/arm/ipod/lcd-gray.c | 568 | target/arm/ipod/lcd-gray.c |
569 | target/arm/ipod/power-ipod.c | 569 | target/arm/ipod/power-ipod.c |
570 | target/arm/usb-pp.c | 570 | target/arm/usb-fw-pp502x.c |
571 | #endif /* SIMULATOR */ | 571 | #endif /* SIMULATOR */ |
572 | #endif /* IPOD_4G */ | 572 | #endif /* IPOD_4G */ |
573 | 573 | ||
@@ -583,7 +583,7 @@ target/arm/ipod/backlight-4g_color.c | |||
583 | target/arm/ipod/button-clickwheel.c | 583 | target/arm/ipod/button-clickwheel.c |
584 | target/arm/ipod/lcd-color_nano.c | 584 | target/arm/ipod/lcd-color_nano.c |
585 | target/arm/ipod/power-ipod.c | 585 | target/arm/ipod/power-ipod.c |
586 | target/arm/usb-pp.c | 586 | target/arm/usb-fw-pp502x.c |
587 | #endif /* SIMULATOR */ | 587 | #endif /* SIMULATOR */ |
588 | #endif /* IPOD_COLOR */ | 588 | #endif /* IPOD_COLOR */ |
589 | 589 | ||
@@ -599,7 +599,7 @@ target/arm/ipod/backlight-nano_video.c | |||
599 | target/arm/ipod/button-clickwheel.c | 599 | target/arm/ipod/button-clickwheel.c |
600 | target/arm/ipod/lcd-color_nano.c | 600 | target/arm/ipod/lcd-color_nano.c |
601 | target/arm/ipod/power-ipod.c | 601 | target/arm/ipod/power-ipod.c |
602 | target/arm/usb-pp.c | 602 | target/arm/usb-fw-pp502x.c |
603 | #endif /* SIMULATOR */ | 603 | #endif /* SIMULATOR */ |
604 | #endif /* IPOD_NANO */ | 604 | #endif /* IPOD_NANO */ |
605 | 605 | ||
@@ -615,7 +615,7 @@ target/arm/ipod/backlight-nano_video.c | |||
615 | target/arm/ipod/button-clickwheel.c | 615 | target/arm/ipod/button-clickwheel.c |
616 | target/arm/ipod/power-ipod.c | 616 | target/arm/ipod/power-ipod.c |
617 | target/arm/ipod/video/lcd-video.c | 617 | target/arm/ipod/video/lcd-video.c |
618 | target/arm/usb-pp.c | 618 | target/arm/usb-fw-pp502x.c |
619 | #endif /* SIMULATOR */ | 619 | #endif /* SIMULATOR */ |
620 | #endif /* IPOD_VIDEO */ | 620 | #endif /* IPOD_VIDEO */ |
621 | 621 | ||
@@ -630,7 +630,7 @@ target/arm/ipod/3g/backlight-3g.c | |||
630 | target/arm/ipod/button-1g-3g.c | 630 | target/arm/ipod/button-1g-3g.c |
631 | target/arm/ipod/lcd-gray.c | 631 | target/arm/ipod/lcd-gray.c |
632 | target/arm/ipod/power-ipod.c | 632 | target/arm/ipod/power-ipod.c |
633 | target/arm/usb-pp.c | 633 | target/arm/usb-fw-pp5002.c |
634 | #endif /* SIMULATOR */ | 634 | #endif /* SIMULATOR */ |
635 | #endif /* IPOD_3G */ | 635 | #endif /* IPOD_3G */ |
636 | 636 | ||
@@ -644,6 +644,7 @@ target/arm/ipod/1g2g/backlight-1g2g.c | |||
644 | target/arm/ipod/button-1g-3g.c | 644 | target/arm/ipod/button-1g-3g.c |
645 | target/arm/ipod/lcd-gray.c | 645 | target/arm/ipod/lcd-gray.c |
646 | target/arm/ipod/power-ipod.c | 646 | target/arm/ipod/power-ipod.c |
647 | target/arm/usb-fw-pp5002.c | ||
647 | #endif /* SIMULATOR */ | 648 | #endif /* SIMULATOR */ |
648 | #endif /* IPOD_1G2G */ | 649 | #endif /* IPOD_1G2G */ |
649 | 650 | ||
@@ -659,7 +660,7 @@ target/arm/ipod/backlight-mini1g_mini2g.c | |||
659 | target/arm/ipod/button-mini1g.c | 660 | target/arm/ipod/button-mini1g.c |
660 | target/arm/ipod/lcd-gray.c | 661 | target/arm/ipod/lcd-gray.c |
661 | target/arm/ipod/power-ipod.c | 662 | target/arm/ipod/power-ipod.c |
662 | target/arm/usb-pp.c | 663 | target/arm/usb-fw-pp502x.c |
663 | #endif /* SIMULATOR */ | 664 | #endif /* SIMULATOR */ |
664 | #endif /* IPOD_MINI */ | 665 | #endif /* IPOD_MINI */ |
665 | 666 | ||
@@ -675,7 +676,7 @@ target/arm/ipod/backlight-mini1g_mini2g.c | |||
675 | target/arm/ipod/button-clickwheel.c | 676 | target/arm/ipod/button-clickwheel.c |
676 | target/arm/ipod/lcd-gray.c | 677 | target/arm/ipod/lcd-gray.c |
677 | target/arm/ipod/power-ipod.c | 678 | target/arm/ipod/power-ipod.c |
678 | target/arm/usb-pp.c | 679 | target/arm/usb-fw-pp502x.c |
679 | #endif /* SIMULATOR */ | 680 | #endif /* SIMULATOR */ |
680 | #endif /* IPOD_MINI2G */ | 681 | #endif /* IPOD_MINI2G */ |
681 | 682 | ||
diff --git a/firmware/export/config-ipod1g2g.h b/firmware/export/config-ipod1g2g.h index 0eb3614dd6..37ebb32f86 100644 --- a/firmware/export/config-ipod1g2g.h +++ b/firmware/export/config-ipod1g2g.h | |||
@@ -110,7 +110,8 @@ | |||
110 | /* Offset ( in the firmware file's header ) to the real data */ | 110 | /* Offset ( in the firmware file's header ) to the real data */ |
111 | #define FIRMWARE_OFFSET_FILE_DATA 8 | 111 | #define FIRMWARE_OFFSET_FILE_DATA 8 |
112 | 112 | ||
113 | #define USB_NONE | 113 | #define USB_IPODSTYLE |
114 | /* actually firewire only, but handled like USB */ | ||
114 | 115 | ||
115 | /* Virtual LED (icon) */ | 116 | /* Virtual LED (icon) */ |
116 | #define CONFIG_LED LED_VIRTUAL | 117 | #define CONFIG_LED LED_VIRTUAL |
diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h index c3e63e87e3..466fb19601 100644 --- a/firmware/export/config-ipod3g.h +++ b/firmware/export/config-ipod3g.h | |||
@@ -110,7 +110,8 @@ | |||
110 | /* Offset ( in the firmware file's header ) to the real data */ | 110 | /* Offset ( in the firmware file's header ) to the real data */ |
111 | #define FIRMWARE_OFFSET_FILE_DATA 8 | 111 | #define FIRMWARE_OFFSET_FILE_DATA 8 |
112 | 112 | ||
113 | #define USB_NONE | 113 | #define USB_IPODSTYLE |
114 | /* actually both firewire and USB, USB isn't handled yet */ | ||
114 | 115 | ||
115 | /* Virtual LED (icon) */ | 116 | /* Virtual LED (icon) */ |
116 | #define CONFIG_LED LED_VIRTUAL | 117 | #define CONFIG_LED LED_VIRTUAL |
diff --git a/firmware/export/pp5002.h b/firmware/export/pp5002.h index 83f8456bf0..9d757ead7d 100644 --- a/firmware/export/pp5002.h +++ b/firmware/export/pp5002.h | |||
@@ -141,9 +141,4 @@ | |||
141 | #define MMAP3_LOGICAL (*(volatile unsigned long *)(0xf000f018)) | 141 | #define MMAP3_LOGICAL (*(volatile unsigned long *)(0xf000f018)) |
142 | #define MMAP3_PHYSICAL (*(volatile unsigned long *)(0xf000f01c)) | 142 | #define MMAP3_PHYSICAL (*(volatile unsigned long *)(0xf000f01c)) |
143 | 143 | ||
144 | /* FIXME: These are PP502x definitions, but without them, iPod 3rd gen | ||
145 | * doesn't compile. The correct values for 3rd gen are not yet known. */ | ||
146 | #define DEV_INIT (*(volatile unsigned long *)(0x70000020)) | ||
147 | #define INIT_USB 0x80000000 | ||
148 | |||
149 | #endif | 144 | #endif |
diff --git a/firmware/target/arm/usb-fw-pp5002.c b/firmware/target/arm/usb-fw-pp5002.c new file mode 100644 index 0000000000..e64d4f8f81 --- /dev/null +++ b/firmware/target/arm/usb-fw-pp5002.c | |||
@@ -0,0 +1,70 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 by Jens Arnold | ||
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 | #include "config.h" | ||
21 | #include "ata.h" | ||
22 | #include "cpu.h" | ||
23 | #include "string.h" | ||
24 | #include "system.h" | ||
25 | #include "usb.h" | ||
26 | #include "usb-target.h" | ||
27 | |||
28 | void usb_init_device(void) | ||
29 | { | ||
30 | /* TODO: add USB init for iPod 3rd gen */ | ||
31 | |||
32 | #if defined(IPOD_1G2G) || defined(IPOD_3G) | ||
33 | /* GPIO C bit 7 is firewire detect */ | ||
34 | GPIOC_ENABLE |= 0x80; | ||
35 | GPIOC_OUTPUT_EN &= ~0x80; | ||
36 | #endif | ||
37 | } | ||
38 | |||
39 | void usb_enable(bool on) | ||
40 | { | ||
41 | /* This device specific code will eventually give way to proper USB | ||
42 | handling, which should be the same for all PP5002 targets. */ | ||
43 | if (on) | ||
44 | { | ||
45 | #ifdef IPOD_ARCH | ||
46 | /* For iPod, we can only do one thing with USB mode atm - reboot | ||
47 | into the flash-based disk-mode. This does not return. */ | ||
48 | |||
49 | ata_sleepnow(); /* Immediately spindown the disk. */ | ||
50 | sleep(HZ*2); | ||
51 | |||
52 | memcpy((void *)0x40017f00, "diskmodehotstuff\1", 17); | ||
53 | |||
54 | system_reboot(); /* Reboot */ | ||
55 | #endif | ||
56 | } | ||
57 | } | ||
58 | |||
59 | bool usb_detect(void) | ||
60 | { | ||
61 | #if defined(IPOD_1G2G) || defined(IPOD_3G) | ||
62 | /* GPIO C bit 7 is firewire detect */ | ||
63 | if (!(GPIOC_INPUT_VAL & 0x80)) | ||
64 | return true; | ||
65 | #endif | ||
66 | |||
67 | /* TODO: add USB detection for iPod 3rd gen */ | ||
68 | |||
69 | return false; | ||
70 | } | ||
diff --git a/firmware/target/arm/usb-pp.c b/firmware/target/arm/usb-fw-pp502x.c index b497e86804..92e3dee562 100644 --- a/firmware/target/arm/usb-pp.c +++ b/firmware/target/arm/usb-fw-pp502x.c | |||
@@ -86,27 +86,25 @@ void usb_init_device(void) | |||
86 | 86 | ||
87 | udelay(0x186A0); | 87 | udelay(0x186A0); |
88 | 88 | ||
89 | |||
90 | dr_controller_setup(); | 89 | dr_controller_setup(); |
90 | |||
91 | #if defined(IPOD_COLOR) || defined(IPOD_4G) \ | ||
92 | || defined(IPOD_MINI) || defined(IPOD_MINI2G) | ||
93 | /* GPIO C bit 1 is firewire detect */ | ||
94 | GPIOC_ENABLE |= 0x02; | ||
95 | GPIOC_OUTPUT_EN &= ~0x02; | ||
96 | #endif | ||
91 | } | 97 | } |
92 | 98 | ||
93 | void usb_enable(bool on) | 99 | void usb_enable(bool on) |
94 | { | 100 | { |
95 | /* This device specific code will eventually give way to proper USB | 101 | /* This device specific code will eventually give way to proper USB |
96 | handling, which should be the same for all PortalPlayer targets. */ | 102 | handling, which should be the same for all PP502x targets. */ |
97 | if (on) | 103 | if (on) |
98 | { | 104 | { |
99 | #if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined (IRIVER_H10_5GB) | 105 | #if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined (IRIVER_H10_5GB) |
100 | /* For the H10 and iPod, we can only do one thing with USB mode - reboot | 106 | /* For the H10 and iPod, we can only do one thing with USB mode - reboot |
101 | into the flash-based disk-mode. This does not return. */ | 107 | into the flash-based disk-mode. This does not return. */ |
102 | |||
103 | /* The following code is copied from ipodlinux */ | ||
104 | #if defined(IPOD_COLOR) || defined(IPOD_3G) || \ | ||
105 | defined(IPOD_4G) || defined(IPOD_MINI) | ||
106 | unsigned char* storage_ptr = (unsigned char *)0x40017F00; | ||
107 | #elif defined(IPOD_NANO) || defined(IPOD_VIDEO) || defined(IPOD_MINI2G) | ||
108 | unsigned char* storage_ptr = (unsigned char *)0x4001FF00; | ||
109 | #endif | ||
110 | 108 | ||
111 | #if defined(IRIVER_H10) || defined (IRIVER_H10_5GB) | 109 | #if defined(IRIVER_H10) || defined (IRIVER_H10_5GB) |
112 | if(button_status()==BUTTON_RIGHT) | 110 | if(button_status()==BUTTON_RIGHT) |
@@ -114,9 +112,15 @@ void usb_enable(bool on) | |||
114 | { | 112 | { |
115 | ata_sleepnow(); /* Immediately spindown the disk. */ | 113 | ata_sleepnow(); /* Immediately spindown the disk. */ |
116 | sleep(HZ*2); | 114 | sleep(HZ*2); |
117 | #ifdef IPOD_ARCH | 115 | |
118 | memcpy(storage_ptr, "diskmode\0\0hotstuff\0\0\1", 21); | 116 | #ifdef IPOD_ARCH /* The following code is based on ipodlinux */ |
117 | #if CONFIG_CPU == PP5020 | ||
118 | memcpy((void *)0x40017f00, "diskmode\0\0hotstuff\0\0\1", 21); | ||
119 | #elif CONFIG_CPU == PP5022 | ||
120 | memcpy((void *)0x4001ff00, "diskmode\0\0hotstuff\0\0\1", 21); | ||
119 | #endif | 121 | #endif |
122 | #endif | ||
123 | |||
120 | system_reboot(); /* Reboot */ | 124 | system_reboot(); /* Reboot */ |
121 | } | 125 | } |
122 | #endif | 126 | #endif |
@@ -128,6 +132,13 @@ bool usb_detect(void) | |||
128 | static bool prev_usbstatus1 = false; | 132 | static bool prev_usbstatus1 = false; |
129 | bool usbstatus1,usbstatus2; | 133 | bool usbstatus1,usbstatus2; |
130 | 134 | ||
135 | #if defined(IPOD_COLOR) || defined(IPOD_4G) \ | ||
136 | || defined(IPOD_MINI) || defined(IPOD_MINI2G) | ||
137 | /* GPIO C bit 1 is firewire detect */ | ||
138 | if (!(GPIOC_INPUT_VAL & 0x02)) | ||
139 | return true; | ||
140 | #endif | ||
141 | |||
131 | /* UDC_ID should have the bit format: | 142 | /* UDC_ID should have the bit format: |
132 | [31:24] = 0x0 | 143 | [31:24] = 0x0 |
133 | [23:16] = 0x22 (Revision number) | 144 | [23:16] = 0x22 (Revision number) |