VxWorks Reference Manual : Libraries

cacheTiTms390Lib

NAME

cacheTiTms390Lib - TI TMS390 SuperSPARC cache management library

ROUTINES

cacheTiTms390LibInit( ) - initialize the TI TMS390 cache library
cacheTiTms390VirtToPhys( ) - translate a virtual address for cacheLib
cacheTiTms390PhysToVirt( ) - translate a physical address for drivers
cleanUpStoreBuffer( ) - clean up store buffer after a data store error interrupt

DESCRIPTION

This library contains architecture-specific cache library functions for the TI TMS390 SuperSPARC architecture. The on-chip cache architecture is explained in the first table below. Note, the data cache mode depends on whether there is an external Multicache Controller (MCC). Both on-chip caches support cache coherency via snooping and line locking. For memory allocation purposes, a cache line alignment size of 64 bytes is assumed. The MCC supports cache coherency via snooping, but does not support line locking.

Cache Line Size
Type SizeLinesSetsWays (Bytes) Mode

Instr20K 320 64 5 2*32 never written back
Data 16K 512 128 4 32 with MCC: Write-through
without MCC: Copy-back with write allocation
The cache operations provided are explained in the table below. Operations marked "Hardware" and "Software" are implemented as marked, and are fast and slow, respectively. Operations marked "NOP" return OK without doing anyting. Operations with another operation name perform that operation rather than their own. Partial operations marked "Entire" actually perform an "Entire" operation. When the MCC is installed, operations upon the data cache are performed upon both the data cache and the MCC. Lines "Data-Data" and "Data-MCC" desribe the data cache and MCC, respectively, portions of a data cache operation.

MCC: No No Yes Yes Yes
Cache Type: Instr Data Instr Data-Data Data-MCC

cacheInvalidate( ) entire H/W H/W H/W H/W S/W
partial Entire S/W Entire S/W S/W
cacheFlush( ) entire NOP Clear NOP NOP S/W
partial NOP Clear NOP NOP Clear
cacheClear( ) entire H/W S/W H/W H/W S/W
partial Entire S/W Entire S/W S/W
cacheLock( ) and entire S/W S/W S/W S/W NOP
cacheUnlock( ) partial S/W S/W S/W S/W NOP
The architecture of the optional Multicache Controller (MCC) is explained in the table below. The MCC supports cache coherency via snooping, and does not support line locking.

The MCC does not have a CACHE_TYPE value for cacheEnable( ) or cacheDisable( ). For enable and disable operations, the MCC is treated as an extension of both the on-chip data and instruction caches. If either the data or instruction caches are enabled, the MCC is enabled. If both the data and the instruction caches are disabled, the MCC is disabled. For invalidate, flush, and clear operations the MCC is treated as an extension of only the on-chip data cache. The cacheInvalidate( ), cacheFlush( ), and cacheClear( ) operations for the instruction cache operate only on the on-chip instruction cache. However these operations for the data cache operate on both the on-chip data cache and the MCC.

Block Size
Cache Type Size Blocks Ways (bytes) Mode

MCC on MBus 0, 1M 0, 8K 1 4*32 Copy-back
MCC on XBus 512K, 1M, 2M 2K, 4K, 8K 1 4*64 Copy-back
Any input peripheral that does not support cache coherency cay be accessed through either a cached buffer with a partial cacheTiTms390Invalidate( ) operation, or an uncached buffer without it. (cacheInvalidate( ) cannot be used; it is a NOP since it assumes cache coherency.) Choose whichever is faster for the application.

Any output peripheral that does not support cache coherency may be accessed through either a cached buffer with a partial cacheTiTms390Flush( ) operation, or an uncached buffer without it. (cacheFlush( ) cannot be used; it is a NOP since it assumes cache coherency.) Choose whichever is faster for the application.

Any peripheral that supports cache coherency should be accessed through a cached buffer without using any of the above operations. Using either an uncached buffer or any of the above operations will just slow the system down.

MMU (Memory Management Unit) support is needed to mark pages cacheable or non-cacheable. For more information, see the manual entry for vmLib.

For general information about caching, see the manual entry for cacheLib.

INCLUDE FILES

cacheLib.h

SEE ALSO

cacheTiTms390Lib, cacheLib, vmLib


Libraries : Routines

cacheTiTms390LibInit( )

NAME

cacheTiTms390LibInit( ) - initialize the TI TMS390 cache library

SYNOPSIS

STATUS cacheTiTms390LibInit
    (
    CACHE_MODE instMode, /* instruction cache mode */
    CACHE_MODE dataMode  /* data cache mode */
    )

DESCRIPTION

This routine initializes the function pointers for the TI TMS390 cache library. The board support package can select this cache library by assigning the function pointer sysCacheLibInit to cacheTiTms390LibInit( ).

The only available cache mode is CACHE_COPYBACK.

RETURNS

OK, or ERROR if cache control is not supported.

SEE ALSO

cacheTiTms390Lib


Libraries : Routines

cacheTiTms390VirtToPhys( )

NAME

cacheTiTms390VirtToPhys( ) - translate a virtual address for cacheLib

SYNOPSIS

void * cacheTiTms390VirtToPhys
    (
    void * address /* virtual address */
    )

DESCRIPTION

This routine performs a 32-bit virtual to 32-bit physical address translation in the current context.

RETURNS

The physical address translation bits [31:0] of a virtual address argument, or NULL if the virtual address is not valid, or the physical address does not fit in 32 bits.

RETURNS

N/A

SEE ALSO

cacheTiTms390Lib


Libraries : Routines

cacheTiTms390PhysToVirt( )

NAME

cacheTiTms390PhysToVirt( ) - translate a physical address for drivers

SYNOPSIS

void * cacheTiTms390PhysToVirt
    (
    void * address /* physical address */
    )

DESCRIPTION

This routine performs a 32-bit physical to 32-bit virtual address translation in the current context.

It works for only DRAM addresses of the first EMC.

It guesses likely virtual addresses, and checks its guesses with VM_TRANSLATE. A likely virtual address is the same as the physical address, or some multiple of 16M less. If any match, it succeeds. If all guesses are wrong, it fails.

RETURNS

The virtual address that maps to the physical address bits [31:0] argument, or NULL if it fails.

RETURNS

N/A

SEE ALSO

cacheTiTms390Lib


Libraries : Routines

cleanUpStoreBuffer( )

NAME

cleanUpStoreBuffer( ) - clean up store buffer after a data store error interrupt

SYNOPSIS

void cleanUpStoreBuffer
    (
    UINT mcntl,    /* Value of MMU Control Register */
    BOOL exception /* TRUE if exception, FALSE if int */
    )

DESCRIPTION

This routine cleans up the store buffer after a data store error interupt. The first queued store is retried. It is logged as either a recoverable or unrecoverable error. Then the store buffer is re-enabled and other queued stores are processed by the store buffer.

RETURNS

N/A

SEE ALSO

cacheTiTms390Lib