Article updated
at 28 Oct 2017
Attention: this is a legacy library and thus not supported by Toradex anymore. We recommend that you use the new libraries for all Toradex modules. Please see the Toradex CE Libraries and Code Samples for up-to-date information.
Library to manage system clocks frequencies. More...
struct FRQPXAClocks struct FRQTEGClocks
|
enum |
tPXAClockIDs { PXACPUClockID, PXARunClockID, PXASysClockID, PXAMemClockID, PXASDRAMClockID, PXASRAMClockID, PXALCDClockID } |
|
PXA Clocks Definitions. More... |
|
enum |
tTEGClockIDs { TEGCPUClockID, TEGSysClockID, TEGAVPClockID, TEGAHBClockID, TEGAPBClockID, TEGVIDClockID, TEGEMCClockID, TEGClockIDMax } |
|
Tegra Clocks Definitions. More... |
|
|
void |
FRQGetLibVersion (DWORD *pVerMaj, DWORD *pVerMin, DWORD *pBuild) |
|
BOOL |
FRQInit () |
|
void |
FRQDeInit () |
|
Description: De-initialises the frequency library. More... |
|
BOOL |
FRQPXAClocks *pxaClocks) |
|
BOOL |
FRQTEGClocks *tegClocks) |
|
DWORD |
FRQGetTEGDFSState () |
|
BOOL |
FRQSetPXAFrequencies (MULTCFG multiplierConfig) |
|
DWORD |
FRQSetPXA270Voltage (DWORD core_voltage) |
|
BOOL |
FRQSetTEGFrequency (tTEGClockIDs tegClockID, DWORD frequency) |
|
BOOL |
FRQSetTEGDFSState (DWORD state) |
|
BOOL |
TegFrq_Boost (const tTegDfsBusyHint *hints, DWORD numHints, tTegDfsBusyHintSyncMode mode) |
|
void |
SetFreq (MULTCFG mp) |
|
MULTCFG |
GetFreq (void) |
|
void |
CalcSystemFreq (MULTCFG ms, DWORD *pCpuClk, DWORD *pRunClk, DWORD *pSysClk, DWORD *pMemClk, DWORD *pSdramClk, DWORD *pSramClk, DWORD *pLcdClk) |
|
DWORD |
SetVoltage (DWORD core_voltage) |
|
Library to manage system clocks frequencies.
- Copyright
- Copyright (c) 2012 Toradex AG
- Author
- andy.kiser
- Rev
- 2863
- Date
- 2015-06-26 17:18:52 +0200 (Fr, 26 Jun 2015)
- Target Platforms:
- PXAxxx, Txx
#define MDREFR_APD (1<<20) |
#define MDREFR_K0DB2 (1<<14) |
#define MDREFR_K0DB4 (1<<29) |
#define MDREFR_K1DB2 (1<<17) |
#define TEG_DFS_STATE_CLOSED_LOOP 3 |
#define TEG_DFS_STATE_STOPPED 2 |
PXA Clocks Definitions.
Enumerator |
PXACPUClockID |
|
PXARunClockID |
|
PXASysClockID |
|
PXAMemClockID |
|
PXASDRAMClockID |
|
PXASRAMClockID |
|
PXALCDClockID |
|
Tegra Clocks Definitions.
Enumerator |
TEGCPUClockID |
|
TEGSysClockID |
|
TEGAVPClockID |
|
TEGAHBClockID |
|
TEGAPBClockID |
|
TEGVIDClockID |
|
TEGEMCClockID |
|
TEGClockIDMax |
|
void CalcSystemFreq |
( |
MULTCFG |
ms, |
|
|
DWORD * |
pCpuClk, |
|
|
DWORD * |
pRunClk, |
|
|
DWORD * |
pSysClk, |
|
|
DWORD * |
pMemClk, |
|
|
DWORD * |
pSdramClk, |
|
|
DWORD * |
pSramClk, |
|
|
DWORD * |
pLcdClk |
|
) |
|
|
Calculate the different clocks in HZ
- Parameters
-
[in] |
ms |
Multiplier Configuration Structure |
[out] |
pCPUClk |
CPU Clock Speed (RunMode Clock * XN) |
[out] |
pRunClk |
RunMode Clock Speed |
[out] |
pSysClk |
System Clock Speed |
[out] |
pMemClk |
Memory Clock Speed |
[out] |
pSdramClk |
SDRAM Clock Speed |
[out] |
pSRamClk |
SRAM Clock Speed |
[out] |
pLcdClk |
LCD Clock Speed |
Description: De-initialises the frequency library.
void FRQGetLibVersion |
( |
DWORD * |
pVerMaj, |
|
|
DWORD * |
pVerMin, |
|
|
DWORD * |
pBuild |
|
) |
|
|
Description: Returns the library Version.
- Parameters
-
[out] |
pVerMaj |
Returns the major version number. Set this parameter to NULL if not required. |
[out] |
pVerMin |
Returns the minor version number. Set this parameter to NULL if not required. |
[out] |
pBuild |
Returns the build number. Set this parameter to NULL if not required. |
BOOL FRQGetPXAClocks |
( |
FRQPXAClocks * |
pxaClocks |
) |
|
Description: Returns the current PXA Clocks Frequencies.
- Parameters
-
in/out] |
pxaClocks Pointer to FRQPXAClocks structure that will be updated |
- Return values
-
TRUE |
Success |
FALSE |
Failure |
BOOL FRQGetTEGClocks |
( |
FRQTEGClocks * |
tegClocks |
) |
|
Description: Returns the current Tegra Clocks Frequencies.
- Parameters
-
in/out] |
tegClocks Pointer to FRQTEGClocks structure that will be updated |
- Return values
-
TRUE |
Success |
FALSE |
Failure |
DWORD FRQGetTEGDFSState |
( |
|
) |
|
Description: Returns the current state of DFS (Dynamic Frequency Switching).
- Return values
-
2 |
DFS Stopped |
3 |
DFS Closed Loop |
Description: Initialises the frequency library.
- Return values
-
TRUE |
Success |
FALSE |
Failure |
DWORD FRQSetPXA270Voltage |
( |
DWORD |
core_voltage |
) |
|
Set core voltage.
- Parameters
-
[in] |
core_voltage |
Voltage required in mV |
- Return values
-
Voltage |
set in mV Remarks: !!!this is working on PXA270 only!!! |
BOOL FRQSetPXAFrequencies |
( |
MULTCFG |
multiplierConfig |
) |
|
Description: Sets the PXA Multiplier Configuration.
- Parameters
-
[in] |
multiplierConfig |
Multiplier Configuration Structure |
- Return values
-
TRUE |
Success |
FALSE |
Failure |
BOOL FRQSetTEGDFSState |
( |
DWORD |
state |
) |
|
Description: Sets the state of DFS (Dynamic Frequency Switching).
- Parameters
-
[in] |
state |
New DFS State (2 = Stopped, 3 = Closed Loop) |
- Return values
-
TRUE |
Success |
FALSE |
Failure |
BOOL FRQSetTEGFrequency |
( |
tTEGClockIDs |
tegClockID, |
|
|
DWORD |
frequency |
|
) |
|
|
Description: Sets the given Tegra clock to the given frequency.
- Parameters
-
[in] |
tegClockID |
ID of the Tegra Clock to be set |
[in] |
frequency |
Frequency to set |
- Return values
-
TRUE |
Success |
FALSE |
Failure |
Get the actual processor frequencies
- Return values
-
Multiplier |
Configuration Structure |
void SetFreq |
( |
MULTCFG |
mp |
) |
|
Set the processor frequencies according to mp
- Parameters
-
[in] |
mp |
Multiplier Configuration Structure |
DWORD SetVoltage |
( |
DWORD |
core_voltage |
) |
|
Set core voltage.
- Parameters
-
[in] |
core_voltage |
Voltage in mV |
- Return values
-
Set |
voltage in mV Remarks: !!!this is working on PXA270 only!!! |
BOOL TegFrq_Boost |
( |
const tTegDfsBusyHint * |
hints, |
|
|
DWORD |
numHints, |
|
|
tTegDfsBusyHintSyncMode |
mode |
|
) |
|
|
Description: Request / Release Minimum Clock Frequencies
- Parameters
-
[in] |
hints |
Array of boost informations. Each array element contains
- Clock name
- How long will it be boosted (can be infinite)
- Clock Frequency -> used to turn off boosting
- finish boost immediately, or gradually See tegra_dma.h for details.
|
[in] |
numHints |
Number of array elments |
[in] |
mode |
TegDfsBusyHintSyncMode_Async = function returns immediately TegDfsBusyHintSyncMode_Sync = function only returns after boost is active. |
- Return values
-
TRUE |
Success |
FALSE |
Failure |