You are on page 1of 31

USB Operation

QCT Software Team


80-V0548-1 Rev. E

Restricted Distribution: This document contains critical information about QUALCOMM products and may not be distributed to anyone that
is not an employee of QUALCOMM without the approval of Configuration Management.
Export of this technology may be controlled by the United States Government. Diversion contrary to U.S. law prohibited.

QUALCOMM Proprietary ®

All data and information contained in or disclosed by this document is confidential and proprietary information of QUALCOMM Incorporated,
and all rights therein are expressly reserved. By accepting this material the recipient agrees that this material and the information contained
therein is held in confidence and in trust and will not be used, copied, or reproduced in whole or in part, nor its contents revealed in any
manner to others without the express written permission of QUALCOMM Incorporated.

QUALCOMM is a registered trademark and registered service mark of QUALCOMM Incorporated. Other product and brand names may be
trademarks or registered trademarks of their respective owners.
QUALCOMM Incorporated
5775 Morehouse Dr.
San Diego, CA 92121-1714
Copyright © 1999-2002 QUALCOMM Incorporated. All rights reserved.

80-V0548-1 Rev. E Page 1 QUALCOMM Proprietary


December 2002
The following information
is licensed and
proprietary material.
Copyright © 1999-2002
Revision history
Version Date Description
X1 Sep 1999 Initial release
X2 Dec 2000 Updated to reflect changes in DMSS since the initial release
X3 Jun 2001 Updated to reflect changes made for DMSS 5105 Release 2.0 Commercial and Release 3.0
Alpha, DMSS 5100 Release 1.0 Commercial and Release 2.0 Alpha, and DMSS 3300
Release 2.2 Commercial
X4 Jun 2001 Updated to reflect changes made for DMSS 5500
X5 Sep 2001 Updated for AMSS 5200 Release 1.0, DMSS 5100 Release 2.0 Commercial, DMSS 5105
Release 3.0 Commercial, and DMSS 5500 Release 1.0 Commercial
A Mar 2002 Updated to reflect changes in DMSS 5500 Release 3.0 software and DMSS 6050
Release 1.0 software
B May 2002 Updated to reflect interim changes in AMSS 5200 software
C Jun 2002 Updated to reflect changes in DMSS 6050 software
D Sep 2002 Updated to reflect changes in DMSS 6100 and AMSS 6200 software
E Dec 2002 Updated to reflect changes in AMSS 6300 and AMSS 6200 software

80-V0548-1 Rev. E Page 2 QUALCOMM Proprietary


December 2002
Contents
• USB Overview
• MSM USB Legacy Modem Model
• MSM USB Composite Device Model
• USB Mass Storage Model
• USB Capabilities
• SIO Limitations
• SIO API
• Operation of the USB Driver
• USB Files
• DMSS Build Instructions for USB
• Default Port Mappings
• UI Port Mapping Options
• USB Performance
• USB Host Side Requirements
• Restrictions

80-V0548-1 Rev. E Page 3 QUALCOMM Proprietary


December 2002
USB Overview
• High-speed/half-duplex
– High-speed signaling mode 12 Mbps (low-speed signaling
mode 1.5 Mbps) – shared by all devices
• Tiered star topology simultaneously supporting up to
127 devices
• Hot attach/detachment
• Plug-and-play
– USB device descriptors
• 4-wire bus
– Data lines
» Differential pair (noise immune)
» Operates in both (IN/OUT) directions

80-V0548-1 Rev. E Page 4 QUALCOMM Proprietary


December 2002
USB Overview (cont.)
• 4-wire bus (cont.)
– Power and ground
– 5 m maximum length
• Asynchronous and isochronous capabilities
• Power conservation support
– Device power controlled by upstream traffic
» Auto power saving
» Remote wake-up
– Power negotiated on attach
» MSM USB device is self-powered
• Token-based bus controlled by the host
– Host-controlled, time-domain transfer multiplexing

80-V0548-1 Rev. E Page 5 QUALCOMM Proprietary


December 2002
MSM USB Legacy Modem Model
• MSM USB driver implements a Communication Device Class
(CDC) device
• Subclass implemented is the Abstract Control Model
– Device models a standard legacy modem
» Looks like another COM port on the host and on the device
» Emulates UART line coding
• Baud rate, stop bits, parity, data bits, break
» Supports standard UART control lines
• DTR, DSR, RFR, CD, RI
– Used by Data Services or Diagnostic Monitor, but not
simultaneously

80-V0548-1 Rev. E Page 6 QUALCOMM Proprietary


December 2002
MSM USB Composite Device Model
• MSM USB driver implements a CDC device in conjunction
with a com port
– Used by Data Services and Diagnostic Monitor
simultaneously
– Must define FEATURE_USB_DIAG
• Requires Windows® 2000-based QUALCOMM USB Host
Driver
• Supported with DMSS 6050, DMSS 6100, AMSS 6300,
AMSS 6200, and starting with DMSS 5500 Release 3.0,
AMSS 5200 Release 3.5, and AMSS 5200C Release 3.5

80-V0548-1 Rev. E Page 7 QUALCOMM Proprietary


December 2002
USB Mass Storage Model
• Available on the DMSS 3300, 5100, 5500, and AMSS
6200 USB software implementation only
• Optionally selectable device that satisfies the bulk-only
transport implementation for the SanDisk MMC storage
device
• Models the SanDisk Compact Flash reader device

80-V0548-1 Rev. E Page 8 QUALCOMM Proprietary


December 2002
USB Mass Storage Model (cont.)
• Used by the USB task to support file transfers from a host
PC to the MMC media
– Device receives (via the OUT bulk endpoint) and parses
SCSI commands that are encapsulated in a received
command block wrapper. The USB task then issues the
appropriate request to the MMC device driver
– Responses from the MMC device driver are then sent to the
host in a command status block via the IN bulk endpoint

80-V0548-1 Rev. E Page 9 QUALCOMM Proprietary


December 2002
USB Capabilities
• SIO support
– Packet and AT-command autodetection
– Escape character (+++) detection during async data calls
– Flash programming via the primary UART
» Flash programming over USB is only supported in DMSS 6050,
6100, AMSS 6300, AMSS 6200 and starting with DMSS 5500
Release 3.0
– Service programming on either the UART or USB port
– Support for either the UART or USB port
» DM can run on either the UART or USB port
» DM can switch between UARTs/USB port
“on-the-fly”
» Service programming on either the UART or USB port

80-V0548-1 Rev. E Page 10 QUALCOMM Proprietary


December 2002
USB Capabilities (cont.)
– 115.2 kbps support on either the UART or USB port for
packet, fax, and asynchronous data calls
– Each data service mode is independently available on either
the UART or USB port
» Data service modes:
• AT command (autodetect mode) processing
• Raw data processing
• Packet mode processing
– Code has been separated into two layers
» Generic interface layer
» UART/USB device layer

80-V0548-1 Rev. E Page 11 QUALCOMM Proprietary


December 2002
USB Capabilities (cont.)
• IS-856 Data Services support in DMSS 5500
– USB task controls processing of data through very fast burst
interface to/from IN/OUT FIFOS
» Provides optimized interface for HDR RX task to write data
through burst interface to large (4 kbyte) FL (USB IN) FIFO
» Dedicated queue for HDR RX task to supply DSM items for
burst IN FL FIFO processing
» Supports (1 kbyte) RL (USB OUT) FIFO for data transfers from
host to DSM items
– Satisfies IS-856 Data Services higher data rates

80-V0548-1 Rev. E Page 12 QUALCOMM Proprietary


December 2002
SIO Limitations
• Flash programming is restricted to the primary UART or
USB (DMSS 6050, 6100, AMSS 6300, AMSS 6200 and
starting with DMSS 5500 Release 3.0)
• Only one port at a time can support AT command
processing
• Only one port at a time can support raw data or
packet mode processing

80-V0548-1 Rev. E Page 13 QUALCOMM Proprietary


December 2002
SIO API
• USB ports are accessed through the SIO API
• SIO API presents a generic (more UNIX-like) interface
– sio_init() initializes the USB device controller if USB is
compiled in
– sio_open() is called by an application to gain control of a
USB port
– sio_transmit() is used to transmit data over a USB port
– sio_do_escaping()/sio_do_unescaping() are utility functions
that are used to expand and collapse control characters
within the data stream

80-V0548-1 Rev. E Page 14 QUALCOMM Proprietary


December 2002
SIO API (cont.)
– sio_ioctl() is used to perform I/O control, such as
enabling/disabling flow control
– sio_close() is called when an application is done using a
USB port
– sio_disable_device() disables the USB driver

80-V0548-1 Rev. E Page 15 QUALCOMM Proprietary


December 2002
Application
User Task (such as data services)
Subsystem Callback
functions

watermark

watermark
queue

queue
Operation
of the SIO Interface Layer
SIO USB
helper
USB Driver functions

USB
usb_open() usb_ioctl() usb_close() usb_write() usb_read()
Interface

Mass Storage
USB Device Management CDC Device Mgr Tx and Rx Buffers
Device Manager*
USB
Subsystem
MMC Device
Transfer Manager
Manager*

USB *Applies to
Transaction Manager DMSS 3300,
Task
5100, 5500 and
AMSS 6200 only

Burst Interface
FIFOs FIFOs
USB
Hardware

USB Core and Transceiver

80-V0548-1 Rev. E Page 16 QUALCOMM Proprietary


December 2002
Operation of the USB Driver (cont.)
• The SIO interface layer routes the function calls to the
appropriate physical layer driver
• The USB interface layer is the application side access to
the USB ports
• The USB device management handles the device
enumeration and power control
• The CDC device manager processes the RS-232
characteristics (except data). It processes the line coding
and the control line state

80-V0548-1 Rev. E Page 17 QUALCOMM Proprietary


December 2002
Operation of the USB Driver (cont.)
• The Tx and Rx buffers utilize small or large DSM items.
They are placed on and removed from queues that are
processed by the application (N/A for Mass Storage). The
Rx buffer uses large DSM items when available.
Applications choose the DSM item size for Tx
• The Transfer Manager ensures that the buffers are
completely sent or received before processing other
buffers
• The Transaction Manager services the USB hardware
FIFOs, excluding the burst interface FIFOs

80-V0548-1 Rev. E Page 18 QUALCOMM Proprietary


December 2002
Operation of the USB Driver (cont.)
• The USB task services the burst interface FIFOs when
signaled from the HDR RX task (DMSS 5500 only) or the
USB interrupt routine
• The Mass Storage Device Manager processes command
block wrappers received from the host and returns
command response wrappers
• The Mass Storage Device Manager interacts with the
MMC device driver to satisfy the actual I/O with the MMC
media
• All Mass Storage data is stored in static buffers owned by
the USB driver

80-V0548-1 Rev. E Page 19 QUALCOMM Proprietary


December 2002
USB Files
• sio.h – is the header file for SIO. It contains the definitions
of the SIO interface. This file is used by the application
software
• sio.c – contains the implementation of the SIO interface
• siousb.h is the USB device layer header file for SIO. It
defines the USB device layer interface functions. This file
is included by sio.c only and should not be included by
other files
• siousb.c – contains the USB device layer interface
functions, including the interface functions of SIO that
support the USB device driver

80-V0548-1 Rev. E Page 20 QUALCOMM Proprietary


December 2002
USB Files (cont.)
• usbdci.h – is the internal header file for the USB driver. It
contains the USB hardware addresses, as well as the
control data written and read from the USB hardware
• usbdc.h – is the USB external header file. This file
contains the definitions of the types used to interface with
the USB driver. It also contains the interface prototypes of
the USB driver
• usbdc.c – contains the USB device controller physical
device driver. It also contains the interface functions to the
device driver
• usbcdc.c and usbcdc.h – contain the implementation of
the USB CDC interface to the USB host

80-V0548-1 Rev. E Page 21 QUALCOMM Proprietary


December 2002
USB Files (cont.)
• usbqcdev.c and usbqcdev.h – contain the implementation
of the USB Composite Device interface to the USB host
– Only compiled in when FEATURE_USB_DIAG is defined
• The following are applicable to MMC support only:
– usbsdms.c and usbsdms.h – contain the implementation of
the SanDisk Mass Storage Device Class interface to the
USB host

80-V0548-1 Rev. E Page 22 QUALCOMM Proprietary


December 2002
DMSS Build Instructions for USB
• The following features are used to select USB functionality:
FEATURE_USB Enables use of the USB driver; if undefined, the USB driver is not
included
FEATURE_USB_CDC_ACM Enables the USB CDC ACM port; if undefined, the USB CDC ACM
port is not available through SIO
FEATURE_USB_HDR Enables use of IN/OUT burst interface FIFOs
FEATURE_MMC Enables Mass Storage Support
FEATURE_USB_DIAG Enables support for simultaneous Data Service and Diagnostic
Monitor Service via USB
(Only supported by DMSS 6050, DMSS 6100, AMSS 6300, AMSS
6200 and starting with DMSS 5500 Release 3.0, AMSS 5200
Release 3.5, and AMSS 5200C Release 3.5.)

80-V0548-1 Rev. E Page 23 QUALCOMM Proprietary


December 2002
Default Port Mappings

FEATURE_SERIAL_DEVICE_MAPPER defined

FEATURES (that is, FEATURE_…) DS DIAG HFK


DS, USB_CDC_ACM, SECOND_UART USB UART 1 UART 2
DS, SECOND_UART UART1 UART 2 —
DS UART1 — —
FEATURE_SERIAL_DEVICE_MAPPER defined
FEATURE_RUNTIME_DEVMAP defined

FEATURES (that is, FEATURE_…) DS DIAG HFK


DS, USB_CDC_ACM, SECOND_UART UART1 UART 2 —
DS, SECOND_UART UART1 UART 2 —
DS UART1 — UART 2

80-V0548-1 Rev. E Page 24 QUALCOMM Proprietary


December 2002
UI Port Mapping Options

FEATURE_SERIAL_DEVICE_MAPPER defined

FEATURES (that is, FEATURE_...) DAT DIAG OPT


DS, SECOND_UART U1 U2 —
DS U1 — HFK
No DS — U1 HFK
DS, USB_CDC_ACM USB U1 HFK

80-V0548-1 Rev. E Page 25 QUALCOMM Proprietary


December 2002
UI Port Mappings (cont.)
FEATURE_SERIAL_DEVICE_MAPPER defined
FEATURE_RUNTIME_DEVMAP defined
FEATURE_BT

FEATURES (that is, FEATURE_...) DS DIAG HFK


DS, USB_CDC_ACM, SECOND_UART, BT USB, U1, U2, U1, U2 U2
BT_NA
DS, USB_CDC_ACM, USB_DIAG, USB, U1, U2, U1, U2, U2
SECOND_UART, BT BT_NA USB_DIAG
DS, USB_CDC_ACM, SECOND_UART USB, U1, U2 U1, U2 U2
DS, USB_CDC_ACM, USB_DIAG, USB, U1, U2 U1, U2, U2
SECOND_UART USB_DIAG
DS, USB_CDC_ACM, BT USB, U1, BT_NA U1 U2
DS, USB_CDC_ACM, USB_DIAG, BT USB, U1, BT_NA U1, U2
USB_DIAG
DS, SECOND_UART, BT U1, U2, BT_NA U1, U2 U2
DS, USB_CDC_ACM USB, U1 U1 U2
DS, USB_CDC_ACM, USB_DIAG USB, U1 U1, U2
USB_DIAG
DS, SECOND_UART U1, U2 U1, U2 U2
DS, BT U1, BT_NA U1 U2

80-V0548-1 Rev. E Page 26 QUALCOMM Proprietary


December 2002
USB Performance
• Data rate is based on software speed (efficiency) within
the complete phone build
– In the DMSS 3100/3300, the USB driver is similar to the
UART driver; the data rates should be comparable to the
current UART configuration
– Improved performance is expected in all DMSS 5xxx and
DMSS 6xxx versions due to larger FIFO depths
– USB driver in DMSS 5500 satisfies performance
requirements for IS-856 Data Services
• Data rate is also based on the host side driver. The phone
can only send data to the PC as fast as the PC allows

80-V0548-1 Rev. E Page 27 QUALCOMM Proprietary


December 2002
USB Host Side Requirements
• The MSM USB driver operates with the Microsoft® Win98
Second Edition and Windows 2000 operating systems
Both operating systems contain the USB CDC host
drivers. The CDC host drivers use the Abstract Control
Model, which the MSM USB driver supports. Windows
2000-based QUALCOMM USB Host Driver is required to
satisfy the higher data rates for IS-856 Data Services
• The host side must have INF files that work with the MSM
USB interface. The INF files identify which host drivers to
load when the MSM USB driver enumerates with the host
• For CDC operation, the MSM is represented as a dial-up
modem and is assigned a COM port on the host side

80-V0548-1 Rev. E Page 28 QUALCOMM Proprietary


December 2002
USB Host Side Requirements (cont.)
• The Windows 2000-based QUALCOMM USB Host Driver
is required to support the USB Composite Device that
satisfies simultaneous data and diag communication
• For Mass Storage operation, the MSM is represented as a
removable disk on the host side
• For Mass Storage support, the host driver is provided by
SanDisk Corp

80-V0548-1 Rev. E Page 29 QUALCOMM Proprietary


December 2002
Restrictions
• USB is not operational on Rev 0 or Rev 1 of the
MSM5200 ASIC
• Procomm (Symantec) does not support USB port
devices with any host platform
• WinFax (Symantec) is not reliable over USB port devices
with the Microsoft® Win98 Second Edition

80-V0548-1 Rev. E Page 30 QUALCOMM Proprietary


December 2002
Questions?

https://support.cdmatech.com
80-V0548-1 Rev. E Page 31 QUALCOMM Proprietary
December 2002

You might also like