PDK API Guide for J721E
SPINLOCK Functions

Introduction

===========================================================================

Functions

uint32_t SPINLOCKRevision (uint32_t baseAddr)
 This API provides the SPINLOCK_REVISION of the SPINLOCK module.
. More...
 
uint32_t SPINLOCKGetNumLocks (uint32_t baseAddr)
 This API provides returns the number of locks supported.
. More...
 
uint32_t SPINLOCKSystatus (uint32_t baseAddr)
 This API provides the status of each bank of 32 locks that can be read from the SPINLOCK_SYSTATUS register.
. More...
 
uint32_t SPINLOCKSystatusIU0 (uint32_t baseAddr)
 This API provides the lock status of the Spinlock module.
. More...
 
uint32_t SPINLOCKSystatusIU (uint32_t baseAddr, uint32_t lockGroup)
 This API provides the lock status of the specified group of lock registers.
. More...
 
void SPINLOCKModuleReset (uint32_t baseAddr)
 This API performs the module reset of the Spinlock module. It also waits until the reset process is complete.
. More...
 
uint32_t SPINLOCKLockStatusSet (uint32_t baseAddr, uint32_t lockNumber)
 This API performs the Read operation for Lock status of the SPINLOCK_LOCK_REG, in order to acquire a Spinlock.
. More...
 
void SPINLOCKLockStatusFree (uint32_t baseAddr, uint32_t lockNumber)
 This API performs the write operation for Lock status of the SPINLOCK_LOCK_REG, in order to Free the lock.
If lockNumber is invalid (out of range), no operation is performed.
Lock state :
Write 0x0: Set the lock to Not Taken(Free).
Write 0x1: No update to the lock value.
. More...
 

Function Documentation

◆ SPINLOCKRevision()

uint32_t SPINLOCKRevision ( uint32_t  baseAddr)

This API provides the SPINLOCK_REVISION of the SPINLOCK module.
.

Parameters
baseAddrMemory address of SPINLOCK module.
Returns
Revision Number.

◆ SPINLOCKGetNumLocks()

uint32_t SPINLOCKGetNumLocks ( uint32_t  baseAddr)

This API provides returns the number of locks supported.
.

Parameters
baseAddrMemory address of SPINLOCK module.
Returns
Number of locks.

◆ SPINLOCKSystatus()

uint32_t SPINLOCKSystatus ( uint32_t  baseAddr)

This API provides the status of each bank of 32 locks that can be read from the SPINLOCK_SYSTATUS register.
.

Parameters
baseAddrMemory address of SPINLOCK module.
Returns
Current Status of the lock.
Reset done status :
Read 0x0: Reset in progress.
Read 0x1: Reset is completed.

◆ SPINLOCKSystatusIU0()

uint32_t SPINLOCKSystatusIU0 ( uint32_t  baseAddr)

This API provides the lock status of the Spinlock module.
.

Parameters
baseAddrMemory address of SPINLOCK module.
Returns
Lock status.
In-Use flag 0, covering lock registers 0 - 31.
Read 0x0: All lock registers 0-31 are in the Not Taken state.(Free)
Read 0x1: At least one of the lock registers 0-31 is in the Taken state.

◆ SPINLOCKSystatusIU()

uint32_t SPINLOCKSystatusIU ( uint32_t  baseAddr,
uint32_t  lockGroup 
)

This API provides the lock status of the specified group of lock registers.
.

Parameters
baseAddrMemory address of SPINLOCK module.
lockGroupThe lock group. Each lock group contains 32 lock registers. Group 0 contains lock registers 0-31, group 1 contains lock registers 32-63, etc. There are a maximum of 8 lock groups.
Returns
Lock status.
Read 0x0: All lock registers in the lock group are in the Not Taken state.(Free)
Read 0x1: At least one of the lock registers in the lock group is in the Takenstate.
Read CSL_SPINLOCK_ERROR_RETURN: lockGroup is invalid (out of range).

◆ SPINLOCKModuleReset()

void SPINLOCKModuleReset ( uint32_t  baseAddr)

This API performs the module reset of the Spinlock module. It also waits until the reset process is complete.
.

Parameters
baseAddrMemory address of SPINLOCK module.
Returns
None.

◆ SPINLOCKLockStatusSet()

uint32_t SPINLOCKLockStatusSet ( uint32_t  baseAddr,
uint32_t  lockNumber 
)

This API performs the Read operation for Lock status of the SPINLOCK_LOCK_REG, in order to acquire a Spinlock.
.

Parameters
baseAddrMemory address of SPINLOCK module.
lockNumberLock number in Spinlock module that should be acquired.
Returns
Status of the Lock Register.
Lock state :
Read 0x0: Lock was previously NOT Taken(Free). The requester is granted the lock.
Read 0x1: Lock was previously Taken(Not Free). The requester is not granted the lock and must retry.
Read CSL_SPINLOCK_ERROR_RETURN: lockNumber is invalid ` (out of range).

◆ SPINLOCKLockStatusFree()

void SPINLOCKLockStatusFree ( uint32_t  baseAddr,
uint32_t  lockNumber 
)

This API performs the write operation for Lock status of the SPINLOCK_LOCK_REG, in order to Free the lock.
If lockNumber is invalid (out of range), no operation is performed.
Lock state :
Write 0x0: Set the lock to Not Taken(Free).
Write 0x1: No update to the lock value.
.

Parameters
baseAddrMemory address of SPINLOCK module.
lockNumberLock number in Spinlock module that should be released.
Returns
None.