Table Of Contents
I created this topic for discussion of the future USB-On-The-Go (USB OTG) support in RockBox
. The discussion will be based on iriver H3x0 for the moment, because
- i have iriver H340
- the other device the RockBox port is working on with USB host caps is IaudioX5, but we don't have the specific chip's documentation atm.
H3x0 has Philips ISP1362 USB OTG controller
, which features 2 hardware ports - the first can be used as Device, as Host, and as OTG port, while the second can be used only as Host port. It seems like the iriver uses the first one, because on the US iriver it's used as device port. This chip fully supports USB 1.1 specifications + OnTheGo Supplement to USB 2.0 specs.
Also, it supports all standard transfer modes (Control (ok, it's needed for USB to work AT ALL), Isochronous (used mostly for real-time transfers like audio & video), INT (used mostly for devices like HID - Humain Interface Device like keyboards, mice, joysticks, for other devices too (like some of USB Mass Storage protocols) and Bulk (used for USB Mass storage, printers, scanners).
The only restriction i know till now is the current with which the chip can supply the usb ports - it's lower than the standard 500mA;
We will need support for AT LEAST 2 device classes:
- USB mass storage
- Still Image (PTP - picture transfer protocol, many cameras use this for transfering the images to a computer)
and maybe the protocol used in older Canon cameras (reverse engineered afaik)
- Some Canon cameras (eg S45 ~late 2002) support both PTP or the default "normal" (canon protocol) as chosen in Menu -> Tools -> Communication. Source code for gphoto2 may provide insight into PTP and canon protocol when needed. -- TroyMartinez - 07 Aug 2005
- There is also a small app used to capture images from a camera. It would be WAY cool if it was ported to Rockbox. Sourceforge `capture` page, original author's website. Capture relies on libptp and uses some Canon (and Nikon?) extensions for capturing. -- AlexandreBourget - 29 Aug 2005
- To be able to "mount" the USB device in the way MMC is mounted in Archos Ondio ... (as soon as we have a working MSD class, this should be fairly simple -- Jens Arnold 21 Apr 2006)
- To be able to use for example keyboard for text input (needs new USB device class support - HID) (alternative: Most HIDs support two classes, the full-fledged HID class and the much simpler bootkeyboard resp. bootmouse class. The boot* classes don't support fancy extras like multimedia keys or extra mouse buttons, but will be much easier to implement. -- JensArnold - 21 Apr 2006)
- Connecting an USB TV tuner(or DMB) to watch TV on the H300
- Connecting a WLAN adapter to listen to web radio or to use the player as SIP phone
- To have a tiny interface to the capture utility, and capture still photos remotely using the H300. Also control flash type, aperture, shutter speed, and have everything dumped right onto the iRiver disk -- AlexandreBourget - 29 Aug 2005
- To support a more expansive list of MP3 players and UMS storage devices, maybe even ones with custom protocols.
- Support multiple devices at the same time. The example is a multi-card-reader where you want more than access only the first card. -- PeterDHoye - 28 Nov 2005 (This will most probably require the hub class, and multi-function device support. Handling multiple cards with multivolume + hotplug should then be easy. -- JensArnold 21 Apr 2006)
- USB Webcam support (to use it as a mass storage video camera, with e.g. Trust Spacecam 320 driver) - RonaldTeune - 27 Dec 2005
Questions & Discussion
- DO we really need full OTG support? I mean: Do we need the port to act like a OTG port in terms of being capable to switch between the Device & Host Mode on request by the other device? In fact, do we need Device caps generally?
- Will all these protocols be compiled in the rockbox statically? Or there will be some kind of "protocol plugins" ? Let's start a discussion about the way USB support will be realised in RockBox
Below is information that we need to implement USBOTG.
- This is a demo program that comes with a Philips ISP1362 evaluation board. It's a DOS program, written with portability in mind and comes with full sources. There's no license included but the readme mentions something about free distribution and modification.
- The ISP1362 is connected to CS3 on the coldfire, we use 0xc0000000 as base address. This results in following register mapping (unconfirmed):
- HC data port: 0xc0000000
- HC cmd port: 0xc0000002
- DC data port: 0xc0000004
- DC cmd port: 0xc0000006
- discovered IO connections (so far, unconfirmed):
- GPIO0 pin 0: kept 0 during usbotg, not clear what's on it
- GPIO0 pin 28: input from usbhost plug pin 4 (device ID: whether the connected device is slave or host)
- GPIO0 pin 29: connected to ID (0 = host, 1 = peripheral)
- GPIO1 pin 21 (53): connected to /H_PSW1 (external chargepump control)
- other IO connections discovered
- Pin 55 (vbus) of the ISP1362 is connected directly to pin 1 of the usb connector. In host mode it is used for VBUS sensing (input).
- Pin 53 is connected to the DC/DC converter enable pin (charge pump)
- some usefull links:
Since amiconn got the driver working, no test code here so far.
Copyright © by the contributing authors.