Hardware Libraries  20.1
Arria 10 SoC Hardware Manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
MMU Virtual Address to Physical Address

Description

                         Translation

This section providees functions to support the translation from the virtual address to physical address.

Data Structures

struct  ALT_MMU_VA_TO_PA_COALESCE_s
 

Typedefs

typedef struct
ALT_MMU_VA_TO_PA_COALESCE_s 
ALT_MMU_VA_TO_PA_COALESCE_t
 

Functions

uintptr_t alt_mmu_va_to_pa (const void *va, uint32_t *seglength, uint32_t *dfsr)
 
ALT_STATUS_CODE alt_mmu_va_to_pa_coalesce_begin (ALT_MMU_VA_TO_PA_COALESCE_t *coalesce, const void *va, size_t size)
 
ALT_STATUS_CODE alt_mmu_va_to_pa_coalesce_next (ALT_MMU_VA_TO_PA_COALESCE_t *coalesce, uintptr_t *segpa, uint32_t *segsize)
 
ALT_STATUS_CODE alt_mmu_va_to_pa_coalesce_end (ALT_MMU_VA_TO_PA_COALESCE_t *coalesce)
 

Data Structure Documentation

struct ALT_MMU_VA_TO_PA_COALESCE_s

This type defines the structure used by the VA to PA coalescing API. The fields are internal to the coalescing API and thus not documented.

Typedef Documentation

This type defines the structure used by the VA to PA coalescing API. The fields are internal to the coalescing API and thus not documented.

Function Documentation

uintptr_t alt_mmu_va_to_pa ( const void *  va,
uint32_t *  seglength,
uint32_t *  dfsr 
)

Given a virtual address, this API attempts to determine the corresponding physical address and segment length. There are no alignment restrictions on the incoming virtual address.

If the translation succeeds, the corresponding physical address will be returned, seglength will be populated with the physical memory segment length, and dfsr will be populated with 0.

If the translation is not possible, dfsr will contain the reason for the translation failure and returned value will be undefined. dfsr is the short-descriptor translation table format of the Data Fault Status Register equivalent value for the translation fault.

For a complete understanding of the DFSR bit field assignments, consult the following reference(s):

  • ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition (ARM DDI 0406C), section B4.1.52 "DFSR, Data Fault Status Register, VMSA"
Parameters
vaThe virtual address to query.
seglength[out] A pointer to the length of the physical address segment corresponding to the given virtual address.
dfsr[out] A pointer to the DFSR value.
Returns
The physical address of the translation if it is successful.
ALT_STATUS_CODE alt_mmu_va_to_pa_coalesce_begin ( ALT_MMU_VA_TO_PA_COALESCE_t coalesce,
const void *  va,
size_t  size 
)

Starts a translation of a Virtual address segment to phyisical segments. This API attemps to coalesce multiple contiguous physical segments and report them back in as few segments as possible.

Parameters
coalescePointer to the coalescing tracking structure.
vaVirtual address of the memory to be translated into physical segments and coalesced.
sizeSize of the virtual address segment.
Return values
ALT_E_SUCCESSSuccessful status.
ALT_E_ERRORError in virtual to physical translation.
ALT_STATUS_CODE alt_mmu_va_to_pa_coalesce_next ( ALT_MMU_VA_TO_PA_COALESCE_t coalesce,
uintptr_t *  segpa,
uint32_t *  segsize 
)

Reports the next coalesced physical segment in the virtual to physical address translation.

Parameters
coalescePointer to the coalescing tracking structure.
segpa[out] The next coalesced physical segment address.
segsize[out] The next coalesced physical segment size.
Return values
ALT_E_SUCCESSSuccessful status.
ALT_E_ERRORError in virtual to physical translation.
ALT_STATUS_CODE alt_mmu_va_to_pa_coalesce_end ( ALT_MMU_VA_TO_PA_COALESCE_t coalesce)

Completes the coalescing operation. This is used for error detection.

Parameters
coalescePointer to the coalescing tracking structure.
Return values
ALT_E_SUCCESSSuccessful status.
ALT_E_ERRORIncomplete virtual address segment translation.