/* m - bit mask * y - value to be written in the bitrange * x - input value whose bitrange to be modified
*/ #define FIELD_SET(m, y, x) \
(((x) & ~(m)) | \
FIELD_PREP((m), (y)))
/* scratchx(0) CSR used for ATF->non-secure SW communication. * This acts as the status register * Provides details on command ack/status, command response, error details
*/ #define EVTREG_ACK BIT_ULL(0) #define EVTREG_EVT_TYPE BIT_ULL(1) #define EVTREG_STAT BIT_ULL(2) #define EVTREG_ID GENMASK_ULL(8, 3)
/* Response to command IDs with command status as CGX_STAT_FAIL * * Not applicable for commands : * CGX_CMD_LINK_BRING_UP/DOWN/CGX_EVT_LINK_CHANGE
*/ #define EVTREG_ERRTYPE GENMASK_ULL(18, 9)
/* Response to cmd ID as CGX_CMD_GET_FW_VER with cmd status as * CGX_STAT_SUCCESS
*/ #define RESP_MAJOR_VER GENMASK_ULL(12, 9) #define RESP_MINOR_VER GENMASK_ULL(16, 13)
/* Response to cmd ID as CGX_CMD_GET_MAC_ADDR with cmd status as * CGX_STAT_SUCCESS
*/ #define RESP_MAC_ADDR GENMASK_ULL(56, 9)
/* Response to cmd ID as CGX_CMD_GET_MKEX_PRFL_SIZE with cmd status as * CGX_STAT_SUCCESS
*/ #define RESP_MKEX_PRFL_SIZE GENMASK_ULL(63, 9)
/* Response to cmd ID as CGX_CMD_GET_MKEX_PRFL_ADDR with cmd status as * CGX_STAT_SUCCESS
*/ #define RESP_MKEX_PRFL_ADDR GENMASK_ULL(63, 9)
/* Response to cmd ID as CGX_CMD_GET_FWD_BASE with cmd status as * CGX_STAT_SUCCESS
*/ #define RESP_FWD_BASE GENMASK_ULL(56, 9) #define RESP_LINKSTAT_LMAC_TYPE GENMASK_ULL(35, 28)
/* Response to cmd ID - CGX_CMD_LINK_BRING_UP/DOWN, event ID CGX_EVT_LINK_CHANGE * status can be either CGX_STAT_FAIL or CGX_STAT_SUCCESS * * In case of CGX_STAT_FAIL, it indicates CGX configuration failed * when processing link up/down/change command. * Both err_type and current link status will be updated * * In case of CGX_STAT_SUCCESS, err_type will be CGX_ERR_NONE and current * link status will be updated
*/ struct cgx_lnk_sts {
uint64_t reserved1:9;
uint64_t link_up:1;
uint64_t full_duplex:1;
uint64_t speed:4; /* cgx_link_speed */
uint64_t err_type:10;
uint64_t an:1; /* AN supported or not */
uint64_t fec:2; /* FEC type if enabled, if not 0 */
uint64_t port:8;
uint64_t reserved2:28;
};
/* scratchx(1) CSR used for non-secure SW->ATF communication * This CSR acts as a command register
*/ #define CMDREG_OWN BIT_ULL(0) #define CMDREG_ID GENMASK_ULL(7, 2)
/* Any command using enable/disable as an argument need * to set this bitfield. * Ex: Loopback, HiGig...
*/ #define CMDREG_ENABLE BIT_ULL(8)
/* command argument to be passed for cmd ID - CGX_CMD_SET_MTU */ #define CMDMTU_SIZE GENMASK_ULL(23, 8)
/* command argument to be passed for cmd ID - CGX_CMD_LINK_CHANGE */ #define CMDLINKCHANGE_LINKUP BIT_ULL(8) #define CMDLINKCHANGE_FULLDPLX BIT_ULL(9) #define CMDLINKCHANGE_SPEED GENMASK_ULL(13, 10)
#define CMDSETFEC GENMASK_ULL(9, 8) /* command argument to be passed for cmd ID - CGX_CMD_MODE_CHANGE */ #define CMDMODECHANGE_SPEED GENMASK_ULL(11, 8) #define CMDMODECHANGE_DUPLEX GENMASK_ULL(12, 12) #define CMDMODECHANGE_AN GENMASK_ULL(13, 13) /* this field categorize the mode ID(FLAGS) range to accommodate * more modes. * To specify mode ID range of 0 - 41, this field will be 0. * To specify mode ID range of 42 - 83, this field will be 1.
*/ #define CMDMODECHANGE_MODE_BASEIDX GENMASK_ULL(21, 20) #define CMDMODECHANGE_FLAGS GENMASK_ULL(63, 22)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.