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

Table 8-39. DSP DM Memory Content of the Polled Locations

DSP 1 Address

DSP 2 Address

Contents

0x00000

0x20000

Write JUMP Opcode here

0x00001

0x20001

Write NOP Opcode here (a don’t care)

0x00002

0x20002

Write JUMP Address here

Some facts to keep in mind on the behavior of the USB Data Endpoints:

•  DSP Data Endpoints follow a pre-increment addressing scheme. The first address written is: Write Pointer + 1 + Base Address

•  The Read and Write pointers control data movement in and out of the DSP Memory Buffers and are not allowed to move past one another. Therefore, to download instructions to DM, the Read Pointer must be positioned so that it does not interfere with the auto-incrementing/auto-rolling nature of the Write Pointer. Since this example calls for 3 writes to DM, the Read Pointer must be positioned at least 4 locations greater than the starting Write Pointer value.

•  The Size value indicates the length of the memory buffer and is used as a trigger mechanism for both the Write and Read pointers to automatically roll back to the top of the buffer as indicated by the Base Address value.

The following is an outline of the steps involved using EndPoints 4 and 5 to download these Jump patches:

1.  Program EndPoints 4 and 5 Data Memory Buffer Registers as follows:

Base Address = 0x00000  for DSP 1, 0x20000 for DSP 2

Size Value = 0x0003  (Causes Write Pointer to roll back to top: location 0x00000 for DSP 1, 0x20000 for DSP 2)

Read Pointer = 0x0010  (A non-essential value that allows the

Write Pointer to increment and roll properly.)

Write Pointer = 0x0000  

2.  Program EndPoints 4 and 5 Pipe Traits:

Type:                    BULK

Direction:             OUT

Maxpacketsize:        64 (Could also be 8,16, or 32)

Steps 1 and 2 can be performed only after MCU RAM-based firmware has been downloaded and the device has been enumerated for a second time. These steps could be programming steps executed as part of MCU startup code. See the section on device initialization process for more details on USB interface configuration.

3.  Start USB OUT transaction of a 6-byte packet that contains the NOP Opcode, the Jump Address and the Jump Opcode.

a.  Data packet bytes 1 and 2 are the NOP Opcode and are written to DM locations 0x00001 for DSP 1 or 0x20001 for DSP 2.

b.  Data packet bytes 3 and 4 are the Jump Address and are written to DM locations 0x00002 for DSP 1 or 0x20002 for DSP 2.

c.  Data packet bytes 5 and 6 are the Jump Opcode and are written to DM locations 0x00000 for DSP 1 or 0x20000 for DSP 2.

Once the Jump Opcode is loaded, the DSPs vector to the desired address and begin executing user code. This code can re-program the DSP Memory Buffer Register values of Endpoints 4 and 5 for normal buffer use.

be sure to load the Jump Address location before loading the Jump Opcode to insure the DSP has a valid address for vectoring. The above programming sequence of the endpoint memory buffer registers provides for this behavior.

MC U RO M Firm wa re Struc ture

The MCU ROM firmware is structured into the following three main sections:

•  Device, Configuration, Interface, and String Descriptor tables for the default USB config device that is enumerated during initial attachment to the USB bus.

•  Code to support all the standard USB commands except:

•  Set Descriptor

•  Sync Frame

•  Get Descriptor support for Interface Descriptor

•  Code to support the following vendor specific commands:

•  USB REGIO – Write and Read of chip registers (both MCU space and DSP space)

•  USB MCUCODE – Download of MCU firmware into PM RAM.