Host (pci/usb) port. Over view. Host Port Selection. Configuration Spaces. PCI Configuration Space, страница 25

The device-specific attributes returned by the GET DEVICE DESCRIPTOR command are contained in this register. The DSP can change the attributes by writing to this register during the Serial EEPROM initialization. The default attributes are 0xFA80, which corresponds to bus-powered, no remote wake-up, and maximum power = 500mA.

Table 8-38. USB Descriptor Device Attributes

SP

1 = self-powered, 0 = bus-powered (default = 0)

RW

1 = have remote wake-up capability, 0 = no remote wake-up capability (default = 0)

C[7:0]

Power consumption from bus expressed in 2mA units (default = 0xFA 500mA)

DSP C od e Downloa d

Since EP0 has a maximum packet size of 8, downloading DSP code on

EP0 can be inefficient when operating on a UHCI controller, which permits only a fixed number of control transactions per frame. Therefore to gain better throughput for code download, downloading of DSP code involves synchronizing a control SETUP command on EP0 with BULK OUT commands on Endpoints 1, 2, or 3. Each Endpoint has an associated DSP download address that is set by using the following SETUP command.

Since three possible interfaces are supported, each interface has its own DSP download address and uses its own BULK pipe to download code. The driver for each interface must set the download address before using the BULK pipe to download DSP code. The download address increments as each byte of data is sent on the BULK pipe to the DSP.

Since DSP instructions are 3 bytes long and USB BULK pipes have even number packet sizes, the instructions to be downloaded must be formatted into 4-byte groups with the least significant byte always zero. The USB interface strips off the least significant bits and formats the DSP instruction before writing it into the program memory. For example, to write the 3-byte opcode, 0x400000, to DSP program memory, the driver sends 0x40000000 down the BULK pipe.

The following example illustrates the proper order of commands and synchronizing that the driver must follow:

1.  Device enumerates with two interfaces. Each interface has the capability to download DSP code and can initiate at any time.

2.  The driver for Interface 1 begins code download by sending the USB REGIO (write) command with the starting download address. The driver must wait for this command to finish before starting code download.

3.  The driver for Interface 2 begins code download by sending the USB REGIO (write) command with the starting download address. The driver must wait for this command to finish before starting code download.

4.  Each driver now streams the code to be downloaded to the DSP:

Driver 1 onto BULK EP1 for Interface 1, and Driver 2 onto BULK EP2 for Interface 2. The code is written to the DSP in three-byte instructions starting at the location specified by the USB REGIO (Write) command. The driver waits for each command to finish before sending a new code download address.

5.  If there is more code to be downloaded at a different starting address, the driver begins the entire sequence, again using steps 1-4.

G e ne ra l C om m e nts

DSP code download is available only after the ADSP-2192 has re-enumerated using application-specific, MCU RAM-based firmware. The DSP code download functionality is not available in the MCU boot ROM for the default CONFIG device.

After setting the download addresses using the USB REGIO (write) command, code download can be initiated for any length using normal BULK traffic.

Sta rting DSP C od e Ex e c ution

During the code download phase, both DSPs execute a command polling loop out of DSP ROM. This command polling loop monitors 2 locations of DSP DM, waiting for a Jump instruction to be inserted, which would vector off the respective DSP to the user-application code. In order to write to these locations in DSP DM, two of the 8 USB Data Endpoints would have to be programmed as OUT pipes for downloading the jump code patches; one endpoint is targeted for DSP 1, and the other endpoint is targeted for DSP 2.