System information

5 Device Emulation
AHB-HPI
Bridge
USB Wrapper
Host
Computer
VNC
Server
USB ControllerARM CPU
Keycode
Buffer
USB
Firmware
...
SCSI
Command
CBW
Keycode Keycode
Interrupt Pipe
Figure 5.3: USB keyboard implementation. The VNC server takes the user interaction and
converts it to USB keycodes. These keycodes are written into the keycode buffer
inside the USB controller.
Device Controlling
Unlike the HID emulation, the ARM CPU is affected while providing a mass storage device.
At one hand, the data of the disk image has to be transferred from the CHARM system
to the USB controller. On the other hand, the incoming read and write requests of the
host have to be proceeded. Basically, the control unit of the emulated mass storage device
is a program running on the USB controller. The ARM CPU is used as a coprocessor
in this process. Figure 5.4 depicts the processing entities while mass storage emulation is
performed. On the right hand side of the picture, the host computer interfaces with the
CHARM USB mass storage device. The mass storage device provides three transfer pipes.
The bulk out pipe receives the commands. And the bulk in pipe provides the requested
data. Handshaking and configuration requests are transferred over the control pipe. The
USB controller in the middle controls all incoming and outgoing data to the host computer.
The ARM CPU has direct memory access to the USB Controller. The high level protocol
commands are processed by the ARM CPU.
Host
Computer
ARM
CPU
EZ-Host
USB
Controller
USBUSB Mass Storage
AHB
Bulk in
Bulk Out
Control
DMA
Figure 5.4: Overview of the processing units while mass storage emulation.
Normally, USB mass storage devices are SCSI devices, like CD-ROMs, hard drives and
floppy disks. The USB protocol encapsulates the SCSI commands for the device. The SCSI
70