This module defines an API for setting traffic priorities and access rights to SDRam
#define ALT_SDR_NUM_PORTS 10 |
Priority and Weight API
For any/all of the ports enumerated in ALT_SDR_PORT_NUM, this allows you set the priority for transactions and round-robin weight
#define ALT_SDR_CTL_PROTPORT_DENY_NONE 0 |
SDRam Rules API
Allows the developer to set rules that allow for one of the ports enumerated in ALT_SDR_PORT to be granted or denied access to blocks of memory conditionally based on whether transaction is TrustZone Secure or NonSecure
This type enumerated the memory ports in the CycloneV or ArriaV Soc Note that each port can be either a Read (R) or Write (W) only port
This type specifies the port rule id lower and upper bounds for each of the embedded devices
This type enumerates the values for security access The system boots in Trustzone Secure mode, but can be transitioned to nonsecure mode using a series of steps outlined by ARM. For the purposes of this API it would be best to specify SECURE when using this API unless you are specifically using technology that uses ARM Trustzone
This type enumerates the mask values for the various ports This allows the developer to specify as many (or few) ports as necessary in a single uint32
This type enumerated the memory ports in the CycloneV or ArriaV Soc Note that each port can be either a Read (R) or Write (W) only port
This type specifies the port rule id lower and upper bounds for each of the embedded devices
This type enumerates the values for security access The system boots in Trustzone Secure mode, but can be transitioned to nonsecure mode using a series of steps outlined by ARM. For the purposes of this API it would be best to specify SECURE when using this API unless you are specifically using technology that uses ARM Trustzone
This type enumerates the mask values for the various ports This allows the developer to specify as many (or few) ports as necessary in a single uint32
- Enumerator:
ALT_SDR_ACCESS_DATA_ALLOW |
If the default rule is to deny access to memory, then this value specifies that this rule will allow a specific region of memory to access the memory>
|
ALT_SDR_ACCESS_DATA_DENY |
If the feault rule is allow access to memory, then this value specifies that this rule will deny access to this region of memory>
|
ALT_STATUS_CODE alt_sdr_priority_set |
( |
ALT_SDR_PORT_t |
port, |
|
|
uint8_t |
priority, |
|
|
uint8_t |
weight |
|
) |
| |
Enables and sets the priority and weight for a given port
- Parameters
-
port | Which port is being set |
priority | 0(lowest)-7(highest) ***** WARNING ***** NO Traffic will be serviced from a lower priority port until all the traffic on all higher priority ports is complete |
weight | 0-31 Within the given priority, how large of a round-robin timeslice is given to this port |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_PRIORITY_WEIGHT_TOO_HIGH | This value will be returned if the sum of the weights for a given priority is greater than the maximum (127) |
ALT_E_ERROR | |
ALT_STATUS_CODE alt_sdr_priority_get |
( |
ALT_SDR_PORT_t |
port, |
|
|
bool * |
enabled, |
|
|
uint8_t * |
priority, |
|
|
uint8_t * |
weight |
|
) |
| |
Gets the QOS, priority and weight for a given port
- Parameters
-
port | Which port is being examined |
priority | *see the priority_set function above for description |
weight | *see the priority_set function above for description |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_BAD_ARG | One of the pointers passed in was NULLor the port value was invalid |
ALT_E_ERROR | |
Disables a port priority
- Parameters
-
port | Which port is being disabled |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_BAD_ARG | One of the pointers passed in was NULLor the port value was invalid |
ALT_E_ERROR | |
uint32_t alt_sdr_rule_set |
( |
uint32_t |
rulenum, |
|
|
ALT_SDR_RULE_t * |
ruleinfo |
|
) |
| |
Sets a rule to enforce the specified policy
- Parameters
-
rulenum | May be either ALT_SDR_CTL_RULE_NEW to use the next available rule or a specific rule number (less than ALT_SDR_MAX_RULE_NUM); |
ruleinfo | - specifies the details of this rule |
- Returns
- The rule ID for the newly created rule, or ALT_SDR_CTL_RULE_INVALID if the function fails
ALT_STATUS_CODE alt_sdr_rule_delete |
( |
uint32_t |
rulenum | ) |
|
Deletes a rule that was created using the alt_sdr_set_rule function The rulenum should be value returned by alt_sdr_set_rule when the rule was created
- Parameters
-
rulenum | The rule that was previously set |
- Return values
-
ALT_E_BAD_ARG | One of the pointers passed in was NULLor the port value was invalid |
ALT_E_ERROR | |
ALT_STATUS_CODE alt_sdr_rule_set_default |
( |
uint32_t |
defaultRule | ) |
|
Sets the default system-wide sdram rule. This will apply to all memory accesses that do not follow within the memory range of the individual rules specified by set_rule
- Return values
-
ALT_E_BAD_ARG | One of the pointers passed in was NULLor the port value was invalid |
ALT_E_ERROR | |