25.08.2015 Views

UM10139

UM10139 Volume 1: LPC214x User Manual - Fab@Home

UM10139 Volume 1: LPC214x User Manual - Fab@Home

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Philips SemiconductorsVolume 1<strong>UM10139</strong>Chapter 14: USB Device ControllerData to be sentby Host DriverData in packetsas seen on USBData to be stored in USBRAM by DMA Engine160 bytes64 bytes160 bytesDMA_buffer_start_address of DD164 bytes32 bytes100 bytes32 bytes64 bytes100 bytesDMA_buffer_start_address of DD24 bytesFig 54. Data transfer in ATLE modeFigure 54 shows a typical OUT transfer, where the host concatenates two DMA transferlengths of 160 bytes and 100 bytes respectively. As seen on USB, there would be fourpackets of 64 bytes (MPS = 64) and a short packet of 4 bytes in ATLE mode unlike Normalmode with five packets of 64, 64, 32, 64, 36 bytes in the given order.It is now responsibility of the DMA engine to separate these two transfers and put them inproper memory locations as pointed by the "DMA_buffer_start_address" field of DMADescriptor 1 (DD1) and DMA Descriptor 2 (DD2).There are two things in OUT transfer of ATLE mode, which differentiate it from the OUTtransfer in Normal mode of DMA operation. The first one is that the Device software doesnot know the "DMA_buffer_length" of the incoming transfer and hence this field in DD isprogrammed to 0. But by the NDIS protocol, device driver does know at which location inthe incoming data transfer, will the transfer length be stored. This value is programmed inthe field "Message_length_position" of the DD.It is responsibility of the hardware to read the two byte wide "DMA_buffer_length" at theoffset (from start of transfer) specified by "Message_length_position", from incoming dataand write it in "DMA_buffer_length" field of the DD. Once this information is extracted fromthe incoming data and updated in the DD, the transfer continues as in Normal mode ofoperation.It may happen that the message length position points to the last byte in the USB packet,which means that out of two bytes of buffer length, first (LS) byte is available in the currentpacket, and the second (MS) byte would follow in the next packet. To deal with suchsituations, the flags "LS_byte_extracted" and "MS_byte_extracted" are used by hardware.When the hardware reads the LS byte (which is the last byte of USB packet), it writes thecontents of LS byte in position (23:16) of "DMA_buffer_length" field, sets the flag"LS_byte_extracted" to 1 and updates the DD in System memory (since the packettransfer is over).9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2005. All rights reserved.User manual Rev. 01 — 15 August 2005 237

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!