A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

Firewire detection with reboot into diskmode for all iPods that support it (all but Nano and Video). * Hack for compiling iPod G3 removed. * Code cleanup.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14131 a1c6a512-1295-4272-9138-f99709370657

+113 -30
+4
apps/bitmaps/native/SOURCES
··· 31 31 usblogo.128x37x16.bmp 32 32 #endif 33 33 #elif LCD_DEPTH > 1 /* greyscale */ 34 + #ifdef IPOD_1G2G /* use firewire logo */ 35 + usblogo.fw.128x39x2.bmp 36 + #else 34 37 usblogo.128x33x2.bmp 38 + #endif 35 39 #else /* monochrome */ 36 40 #if LCD_WIDTH == 112 37 41 usblogo.100x20x1.bmp
apps/bitmaps/native/usblogo.fw.128x39x2.bmp

This is a binary file and will not be displayed.

+12 -11
firmware/SOURCES
··· 382 382 target/arm/sandisk/sansa-e200/lcd-as-e200.S 383 383 target/arm/sandisk/sansa-e200/adc-e200.c 384 384 target/arm/sandisk/sansa-e200/backlight-e200.c 385 - target/arm/usb-pp.c 385 + target/arm/usb-fw-pp502x.c 386 386 target/arm/sandisk/sansa-e200/button-e200.c 387 387 target/arm/sandisk/sansa-e200/power-e200.c 388 388 target/arm/i2s-pp.c ··· 497 497 target/arm/iriver/h10/button-h10.c 498 498 target/arm/iriver/h10/lcd-h10_20gb.c 499 499 target/arm/iriver/h10/power-h10.c 500 - target/arm/usb-pp.c 500 + target/arm/usb-fw-pp502x.c 501 501 #endif /* SIMULATOR */ 502 502 #endif /* IRIVER_H10 */ 503 503 ··· 512 512 target/arm/iriver/h10/button-h10.c 513 513 target/arm/iriver/h10/lcd-h10_5gb.c 514 514 target/arm/iriver/h10/power-h10.c 515 - target/arm/usb-pp.c 515 + target/arm/usb-fw-pp502x.c 516 516 #endif /* SIMULATOR */ 517 517 #endif /* IRIVER_H10_5GB */ 518 518 ··· 551 551 target/arm/tatung/tpj1022/button-tpj1022.c 552 552 target/arm/tatung/tpj1022/lcd-tpj1022.c 553 553 target/arm/tatung/tpj1022/power-tpj1022.c 554 - target/arm/usb-pp.c 554 + target/arm/usb-fw-pp502x.c 555 555 #endif /* SIMULATOR */ 556 556 #endif /* ELIO_TPJ1022 */ 557 557 ··· 567 567 target/arm/ipod/button-clickwheel.c 568 568 target/arm/ipod/lcd-gray.c 569 569 target/arm/ipod/power-ipod.c 570 - target/arm/usb-pp.c 570 + target/arm/usb-fw-pp502x.c 571 571 #endif /* SIMULATOR */ 572 572 #endif /* IPOD_4G */ 573 573 ··· 583 583 target/arm/ipod/button-clickwheel.c 584 584 target/arm/ipod/lcd-color_nano.c 585 585 target/arm/ipod/power-ipod.c 586 - target/arm/usb-pp.c 586 + target/arm/usb-fw-pp502x.c 587 587 #endif /* SIMULATOR */ 588 588 #endif /* IPOD_COLOR */ 589 589 ··· 599 599 target/arm/ipod/button-clickwheel.c 600 600 target/arm/ipod/lcd-color_nano.c 601 601 target/arm/ipod/power-ipod.c 602 - target/arm/usb-pp.c 602 + target/arm/usb-fw-pp502x.c 603 603 #endif /* SIMULATOR */ 604 604 #endif /* IPOD_NANO */ 605 605 ··· 615 615 target/arm/ipod/button-clickwheel.c 616 616 target/arm/ipod/power-ipod.c 617 617 target/arm/ipod/video/lcd-video.c 618 - target/arm/usb-pp.c 618 + target/arm/usb-fw-pp502x.c 619 619 #endif /* SIMULATOR */ 620 620 #endif /* IPOD_VIDEO */ 621 621 ··· 630 630 target/arm/ipod/button-1g-3g.c 631 631 target/arm/ipod/lcd-gray.c 632 632 target/arm/ipod/power-ipod.c 633 - target/arm/usb-pp.c 633 + target/arm/usb-fw-pp5002.c 634 634 #endif /* SIMULATOR */ 635 635 #endif /* IPOD_3G */ 636 636 ··· 644 644 target/arm/ipod/button-1g-3g.c 645 645 target/arm/ipod/lcd-gray.c 646 646 target/arm/ipod/power-ipod.c 647 + target/arm/usb-fw-pp5002.c 647 648 #endif /* SIMULATOR */ 648 649 #endif /* IPOD_1G2G */ 649 650 ··· 659 660 target/arm/ipod/button-mini1g.c 660 661 target/arm/ipod/lcd-gray.c 661 662 target/arm/ipod/power-ipod.c 662 - target/arm/usb-pp.c 663 + target/arm/usb-fw-pp502x.c 663 664 #endif /* SIMULATOR */ 664 665 #endif /* IPOD_MINI */ 665 666 ··· 675 676 target/arm/ipod/button-clickwheel.c 676 677 target/arm/ipod/lcd-gray.c 677 678 target/arm/ipod/power-ipod.c 678 - target/arm/usb-pp.c 679 + target/arm/usb-fw-pp502x.c 679 680 #endif /* SIMULATOR */ 680 681 #endif /* IPOD_MINI2G */ 681 682
+2 -1
firmware/export/config-ipod1g2g.h
··· 110 110 /* Offset ( in the firmware file's header ) to the real data */ 111 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 116 /* Virtual LED (icon) */ 116 117 #define CONFIG_LED LED_VIRTUAL
+2 -1
firmware/export/config-ipod3g.h
··· 110 110 /* Offset ( in the firmware file's header ) to the real data */ 111 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 116 /* Virtual LED (icon) */ 116 117 #define CONFIG_LED LED_VIRTUAL
-5
firmware/export/pp5002.h
··· 141 141 #define MMAP3_LOGICAL (*(volatile unsigned long *)(0xf000f018)) 142 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 144 #endif
+70
firmware/target/arm/usb-fw-pp5002.c
··· 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 + }
+23 -12
firmware/target/arm/usb-pp.c firmware/target/arm/usb-fw-pp502x.c
··· 86 86 87 87 udelay(0x186A0); 88 88 89 + dr_controller_setup(); 89 90 90 - dr_controller_setup(); 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 99 void usb_enable(bool on) 94 100 { 95 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 103 if (on) 98 104 { 99 105 #if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined (IRIVER_H10_5GB) 100 106 /* For the H10 and iPod, we can only do one thing with USB mode - reboot 101 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 109 #if defined(IRIVER_H10) || defined (IRIVER_H10_5GB) 112 110 if(button_status()==BUTTON_RIGHT) ··· 114 112 { 115 113 ata_sleepnow(); /* Immediately spindown the disk. */ 116 114 sleep(HZ*2); 117 - #ifdef IPOD_ARCH 118 - memcpy(storage_ptr, "diskmode\0\0hotstuff\0\0\1", 21); 115 + 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); 121 + #endif 119 122 #endif 123 + 120 124 system_reboot(); /* Reboot */ 121 125 } 122 126 #endif ··· 127 131 { 128 132 static bool prev_usbstatus1 = false; 129 133 bool usbstatus1,usbstatus2; 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 130 141 131 142 /* UDC_ID should have the bit format: 132 143 [31:24] = 0x0