/* * Load Image is completed in two stages: * * 1) When the VK device boot-up, M7 CPU runs and executes the BootROM. * The Secure Boot Loader (SBL) as part of the BootROM will run * to open up ITCM for host to push BOOT1 image. * SBL will authenticate the image before jumping to BOOT1 image. * * 2) Because BOOT1 image is a secured image, we also called it the * Secure Boot Image (SBI). At second stage, SBI will initialize DDR * and wait for host to push BOOT2 image to DDR. * SBI will authenticate the image before jumping to BOOT2 image. *
*/ /* Location of registers of interest in BAR0 */
/* Alert bit definitions detectd on host */ #define ERR_LOG_HOST_INTF_V_FAIL BIT(13) #define ERR_LOG_HOST_HB_FAIL BIT(14) #define ERR_LOG_HOST_PCIE_DWN BIT(15)
#define BAR_CARD_ERR_MEM 0x468 /* defines for mem err, all fields have same width */ #define BCM_VK_MEM_ERR_FIELD_MASK 0xff #define BCM_VK_ECC_MEM_ERR_SHIFT 0 #define BCM_VK_UECC_MEM_ERR_SHIFT 8 /* threshold of event occurrence and logs start to come out */ #define BCM_VK_ECC_THRESHOLD 10 #define BCM_VK_UECC_THRESHOLD 1
#define BAR_CARD_PWR_AND_THRE 0x46c /* defines for power and temp threshold, all fields have same width */ #define BCM_VK_PWR_AND_THRE_FIELD_MASK 0xff #define BCM_VK_LOW_TEMP_THRE_SHIFT 0 #define BCM_VK_HIGH_TEMP_THRE_SHIFT 8 #define BCM_VK_PWR_STATE_SHIFT 16
#define BAR_CARD_STATIC_INFO 0x470
#define BAR_INTF_VER 0x47c #define BAR_INTF_VER_MAJOR_SHIFT 16 #define BAR_INTF_VER_MASK 0xffff /* * major and minor semantic version numbers supported * Please update as required on interface changes
*/ #define SEMANTIC_MAJOR 1 #define SEMANTIC_MINOR 0
/* * first door bell reg, ie for queue = 0. Only need the first one, as * we will use the queue number to derive the others
*/ #define VK_BAR0_REGSEG_DB_BASE 0x484 #define VK_BAR0_REGSEG_DB_REG_GAP 8 /* * DB register gap, * DB1 at 0x48c and DB2 at 0x494
*/
/* reset register and specific values */ #define VK_BAR0_RESET_DB_NUM 3 #define VK_BAR0_RESET_DB_SOFT 0xffffffff #define VK_BAR0_RESET_DB_HARD 0xfffffffd #define VK_BAR0_RESET_RAMPDUMP 0xa0000000
/* indicate if msgq ctrl in BAR1 is populated */ #define VK_BAR1_MSGQ_DEF_RDY 0x60c0 /* ready marker value for the above location, normal boot2 */ #define VK_BAR1_MSGQ_RDY_MARKER 0xbeefcafe /* ready marker value for the above location, normal boot2 */ #define VK_BAR1_DIAG_RDY_MARKER 0xdeadcafe /* number of msgqs in BAR1 */ #define VK_BAR1_MSGQ_NR 0x60c4 /* BAR1 queue control structure offset */ #define VK_BAR1_MSGQ_CTRL_OFF 0x60c8
/* BAR1 ucode and boot1 version tag */ #define VK_BAR1_UCODE_VER_TAG 0x6170 #define VK_BAR1_BOOT1_VER_TAG 0x61b0 #define VK_BAR1_VER_TAG_SIZE 64
/* Memory to hold the DMA buffer memory address allocated for boot2 download */ #define VK_BAR1_DMA_BUF_OFF_HI 0x61e0 #define VK_BAR1_DMA_BUF_OFF_LO (VK_BAR1_DMA_BUF_OFF_HI + 4) #define VK_BAR1_DMA_BUF_SZ (VK_BAR1_DMA_BUF_OFF_HI + 8)
/* * Control structure of logging messages from the card. This * buffer is for logmsg that comes from vk
*/ struct bcm_vk_peer_log {
u32 rd_idx;
u32 wr_idx;
u32 buf_size;
u32 mask;
};
/* max buf size allowed */ #define BCM_VK_PEER_LOG_BUF_MAX SZ_16K /* max size per line of peer log */ #define BCM_VK_PEER_LOG_LINE_MAX 256
/* * single entry for processing type + utilization
*/ #define BCM_VK_PROC_TYPE_TAG_LEN 8 struct bcm_vk_proc_mon_entry_t { char tag[BCM_VK_PROC_TYPE_TAG_LEN];
u32 used;
u32 max; /**< max capacity */
};
/** * Structure for run time utilization
*/ #define BCM_VK_PROC_MON_MAX 8 /* max entries supported */ struct bcm_vk_proc_mon_info {
u32 num; /**< no of entries */
u32 entry_size; /**< per entry size */ struct bcm_vk_proc_mon_entry_t entries[BCM_VK_PROC_MON_MAX];
};
/* heart beat mechanism control structure */ struct bcm_vk_hb_ctrl hb_ctrl; /* house-keeping variable of error logs */
spinlock_t host_alert_lock; /* protection to access host_alert struct */ struct bcm_vk_alert host_alert; struct bcm_vk_alert peer_alert; /* bits set by the card */ struct bcm_vk_alert_cnts alert_cnts;
/* offset of the peer log control in BAR2 */
u32 peerlog_off; struct bcm_vk_peer_log peerlog_info; /* record of peer log info */ /* offset of processing monitoring info in BAR2 */
u32 proc_mon_off;
};
/* a macro to get an individual field with mask and shift */ #define BCM_VK_EXTRACT_FIELD(_field, _reg, _mask, _shift) \
(_field = (((_reg) >> (_shift)) & (_mask)))
/* alerts that could be generated from peer */ #define BCM_VK_PEER_ERR_NUM 12 externstruct bcm_vk_entry const bcm_vk_peer_err[BCM_VK_PEER_ERR_NUM]; /* alerts detected by the host */ #define BCM_VK_HOST_ERR_NUM 3 externstruct bcm_vk_entry const bcm_vk_host_err[BCM_VK_HOST_ERR_NUM];
/* * check if PCIe interface is down on read. Use it when it is * certain that _val should never be all ones.
*/ #define BCM_VK_INTF_IS_DOWN(val) ((val) == 0xffffffff)
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.