02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5<br />

Driver <strong>Guide</strong>lines<br />

■<br />

■<br />

Memory that is of unknown origin. This memory is associated with the<br />

CACHE_USER_xxxx macros and is outside the control of the driver. In other<br />

words, the driver does not really know how the memory was allocated, but the<br />

CACHE_USER_xxxx macros assume the memory was allocated using malloc( ).<br />

Memory that is of a fixed or special purpose. This memory is a special region<br />

that is provided by the target hardware and is intended for the exclusive use<br />

of a DMA-type device. This is usually done for performance reasons. This<br />

memory is not part of the system pool, and thus is not associated with the<br />

malloc( ) routine, the cacheDmaMalloc( ) routine, the data section, or the bss<br />

section. There are no cache macros associated with this type of memory. The<br />

hardware usually provides a means to make this entire region non-cacheable.<br />

5<br />

Driver Attributes<br />

This section lists the driver attributes you need to be aware of when planning your<br />

cacheLib strategy. Each attribute is given a name to simplify later discussion.<br />

Other than write pipelining, the attributes are of concern only to a DMA-type of<br />

device.<br />

WRITE_PIPING<br />

The CPU uses write pipelining. Write pipelining means that write operations of<br />

the CPU are held in a pipeline until the optimum state of the external bus<br />

occurs. Write pipelining is used on RISC architectures, such as MIPS. This<br />

technique can seriously affect your driver because it can delay the delivery of<br />

commands or data to the device your driver controls.<br />

This attribute is TRUE if the driver is to be run on a CPU that has a write pipe.<br />

USER_DATA_UNKNOWN<br />

The user data is in an unknown state. This attribute is TRUE if your driver<br />

passes data by address directly between the device and the driver’s user. In<br />

this case, data handed to the driver by the user is of an unknown cache state.<br />

An example of this is a pointer to a data buffer given to a SCSI disk driver for<br />

writing to the disk. In this case, the driver does not know if the buffer has been<br />

flushed to memory, or is still in cache. Conversely, data that is obtained from<br />

the device must be coherent between cache and memory before the pointer to<br />

that data can be given to the user for consumption.<br />

MMU_TAGGING<br />

The hardware provides MMU tagging of cache regions.This attribute is TRUE<br />

if an MMU that allows tagging of memory regions as non-cacheable is<br />

available on the target hardware.<br />

105

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

Saved successfully!

Ooh no, something went wrong!