Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/qat/qat_common/adf_freebsd_admin.c
Show All 21 Lines | |||||
#include <linux/delay.h> | #include <linux/delay.h> | ||||
#define ADF_CONST_TABLE_VERSION_BYTE (0) | #define ADF_CONST_TABLE_VERSION_BYTE (0) | ||||
/* Keep version number in range 0-255 */ | /* Keep version number in range 0-255 */ | ||||
#define ADF_CONST_TABLE_VERSION (1) | #define ADF_CONST_TABLE_VERSION (1) | ||||
/* Admin Messages Registers */ | /* Admin Messages Registers */ | ||||
#define ADF_DH895XCC_ADMINMSGUR_OFFSET (0x3A000 + 0x574) | #define ADF_MAILBOX_STRIDE 0x1000 | ||||
#define ADF_DH895XCC_ADMINMSGLR_OFFSET (0x3A000 + 0x578) | |||||
#define ADF_DH895XCC_MAILBOX_BASE_OFFSET 0x20970 | |||||
#define ADF_DH895XCC_MAILBOX_STRIDE 0x1000 | |||||
#define ADF_ADMINMSG_LEN 32 | #define ADF_ADMINMSG_LEN 32 | ||||
#define FREEBSD_ALLIGNMENT_SIZE 64 | #define FREEBSD_ALLIGNMENT_SIZE 64 | ||||
#define ADF_INIT_CONFIG_SIZE 1024 | #define ADF_INIT_CONFIG_SIZE 1024 | ||||
static u8 const_tab[1024] __aligned(1024) = { | static u8 const_tab[1024] __aligned(1024) = { | ||||
ADF_CONST_TABLE_VERSION, | ADF_CONST_TABLE_VERSION, | ||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||
▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | adf_put_admin_msg_sync(struct adf_accel_dev *accel_dev, | ||||
struct adf_admin_comms *admin = accel_dev->admin; | struct adf_admin_comms *admin = accel_dev->admin; | ||||
struct adf_hw_device_data *hw_data = accel_dev->hw_device; | struct adf_hw_device_data *hw_data = accel_dev->hw_device; | ||||
struct resource *mailbox = admin->mailbox_addr; | struct resource *mailbox = admin->mailbox_addr; | ||||
struct admin_info admin_csrs_info; | struct admin_info admin_csrs_info; | ||||
hw_data->get_admin_info(&admin_csrs_info); | hw_data->get_admin_info(&admin_csrs_info); | ||||
int offset = ae * ADF_ADMINMSG_LEN * 2; | int offset = ae * ADF_ADMINMSG_LEN * 2; | ||||
int mb_offset = | int mb_offset = | ||||
ae * ADF_DH895XCC_MAILBOX_STRIDE + admin_csrs_info.mailbox_offset; | ae * ADF_MAILBOX_STRIDE + admin_csrs_info.mailbox_offset; | ||||
int times, received; | int times, received; | ||||
struct icp_qat_fw_init_admin_req *request = in; | struct icp_qat_fw_init_admin_req *request = in; | ||||
sx_xlock(&admin->lock); | sx_xlock(&admin->lock); | ||||
if (ADF_CSR_RD(mailbox, mb_offset) == 1) { | if (ADF_CSR_RD(mailbox, mb_offset) == 1) { | ||||
sx_xunlock(&admin->lock); | sx_xunlock(&admin->lock); | ||||
▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static int | static int | ||||
adf_set_fw_constants(struct adf_accel_dev *accel_dev) | adf_set_fw_constants(struct adf_accel_dev *accel_dev) | ||||
{ | { | ||||
struct icp_qat_fw_init_admin_req req; | struct icp_qat_fw_init_admin_req req; | ||||
struct icp_qat_fw_init_admin_resp resp; | struct icp_qat_fw_init_admin_resp resp; | ||||
struct adf_hw_device_data *hw_device = accel_dev->hw_device; | struct adf_hw_device_data *hw_device = accel_dev->hw_device; | ||||
u32 ae_mask = hw_device->ae_mask; | u32 ae_mask = hw_device->admin_ae_mask; | ||||
explicit_bzero(&req, sizeof(req)); | explicit_bzero(&req, sizeof(req)); | ||||
req.cmd_id = ICP_QAT_FW_CONSTANTS_CFG; | req.cmd_id = ICP_QAT_FW_CONSTANTS_CFG; | ||||
req.init_cfg_sz = sizeof(const_tab); | req.init_cfg_sz = sizeof(const_tab); | ||||
req.init_cfg_ptr = accel_dev->admin->const_tbl_addr; | req.init_cfg_ptr = accel_dev->admin->const_tbl_addr; | ||||
if (adf_send_admin(accel_dev, &req, &resp, ae_mask)) | if (adf_send_admin(accel_dev, &req, &resp, ae_mask)) | ||||
▲ Show 20 Lines • Show All 297 Lines • Show Last 20 Lines |