|
47 | 47 | #ifndef __ICP_QAT_UCLO_H__ |
48 | 48 | #define __ICP_QAT_UCLO_H__ |
49 | 49 |
|
50 | | -#define ICP_QAT_AC_C_CPU_TYPE 0x00400000 |
| 50 | +#define ICP_QAT_AC_895XCC_DEV_TYPE 0x00400000 |
| 51 | +#define ICP_QAT_AC_C62X_DEV_TYPE 0x01000000 |
| 52 | +#define ICP_QAT_AC_C3XXX_DEV_TYPE 0x02000000 |
51 | 53 | #define ICP_QAT_UCLO_MAX_AE 12 |
52 | 54 | #define ICP_QAT_UCLO_MAX_CTX 8 |
53 | 55 | #define ICP_QAT_UCLO_MAX_UIMAGE (ICP_QAT_UCLO_MAX_AE * ICP_QAT_UCLO_MAX_CTX) |
54 | 56 | #define ICP_QAT_UCLO_MAX_USTORE 0x4000 |
55 | 57 | #define ICP_QAT_UCLO_MAX_XFER_REG 128 |
56 | 58 | #define ICP_QAT_UCLO_MAX_GPR_REG 128 |
57 | | -#define ICP_QAT_UCLO_MAX_NN_REG 128 |
58 | 59 | #define ICP_QAT_UCLO_MAX_LMEM_REG 1024 |
59 | 60 | #define ICP_QAT_UCLO_AE_ALL_CTX 0xff |
60 | 61 | #define ICP_QAT_UOF_OBJID_LEN 8 |
61 | 62 | #define ICP_QAT_UOF_FID 0xc6c2 |
62 | 63 | #define ICP_QAT_UOF_MAJVER 0x4 |
63 | 64 | #define ICP_QAT_UOF_MINVER 0x11 |
64 | | -#define ICP_QAT_UOF_NN_MODE_NOTCARE 0xff |
65 | 65 | #define ICP_QAT_UOF_OBJS "UOF_OBJS" |
66 | 66 | #define ICP_QAT_UOF_STRT "UOF_STRT" |
67 | | -#define ICP_QAT_UOF_GTID "UOF_GTID" |
68 | 67 | #define ICP_QAT_UOF_IMAG "UOF_IMAG" |
69 | 68 | #define ICP_QAT_UOF_IMEM "UOF_IMEM" |
70 | | -#define ICP_QAT_UOF_MSEG "UOF_MSEG" |
71 | 69 | #define ICP_QAT_UOF_LOCAL_SCOPE 1 |
72 | 70 | #define ICP_QAT_UOF_INIT_EXPR 0 |
73 | 71 | #define ICP_QAT_UOF_INIT_REG 1 |
74 | 72 | #define ICP_QAT_UOF_INIT_REG_CTX 2 |
75 | 73 | #define ICP_QAT_UOF_INIT_EXPR_ENDIAN_SWAP 3 |
| 74 | +#define ICP_QAT_SUOF_OBJ_ID_LEN 8 |
| 75 | +#define ICP_QAT_SUOF_FID 0x53554f46 |
| 76 | +#define ICP_QAT_SUOF_MAJVER 0x0 |
| 77 | +#define ICP_QAT_SUOF_MINVER 0x1 |
| 78 | +#define ICP_QAT_SIMG_AE_INIT_SEQ_LEN (50 * sizeof(unsigned long long)) |
| 79 | +#define ICP_QAT_SIMG_AE_INSTS_LEN (0x4000 * sizeof(unsigned long long)) |
| 80 | +#define ICP_QAT_CSS_FWSK_MODULUS_LEN 256 |
| 81 | +#define ICP_QAT_CSS_FWSK_EXPONENT_LEN 4 |
| 82 | +#define ICP_QAT_CSS_FWSK_PAD_LEN 252 |
| 83 | +#define ICP_QAT_CSS_FWSK_PUB_LEN (ICP_QAT_CSS_FWSK_MODULUS_LEN + \ |
| 84 | + ICP_QAT_CSS_FWSK_EXPONENT_LEN + \ |
| 85 | + ICP_QAT_CSS_FWSK_PAD_LEN) |
| 86 | +#define ICP_QAT_CSS_SIGNATURE_LEN 256 |
| 87 | +#define ICP_QAT_CSS_AE_IMG_LEN (sizeof(struct icp_qat_simg_ae_mode) + \ |
| 88 | + ICP_QAT_SIMG_AE_INIT_SEQ_LEN + \ |
| 89 | + ICP_QAT_SIMG_AE_INSTS_LEN) |
| 90 | +#define ICP_QAT_CSS_AE_SIMG_LEN (sizeof(struct icp_qat_css_hdr) + \ |
| 91 | + ICP_QAT_CSS_FWSK_PUB_LEN + \ |
| 92 | + ICP_QAT_CSS_SIGNATURE_LEN + \ |
| 93 | + ICP_QAT_CSS_AE_IMG_LEN) |
| 94 | +#define ICP_QAT_AE_IMG_OFFSET (sizeof(struct icp_qat_css_hdr) + \ |
| 95 | + ICP_QAT_CSS_FWSK_MODULUS_LEN + \ |
| 96 | + ICP_QAT_CSS_FWSK_EXPONENT_LEN + \ |
| 97 | + ICP_QAT_CSS_SIGNATURE_LEN) |
| 98 | +#define ICP_QAT_CSS_MAX_IMAGE_LEN 0x40000 |
76 | 99 |
|
77 | 100 | #define ICP_QAT_CTX_MODE(ae_mode) ((ae_mode) & 0xf) |
78 | 101 | #define ICP_QAT_NN_MODE(ae_mode) (((ae_mode) >> 0x4) & 0xf) |
@@ -112,6 +135,11 @@ enum icp_qat_uof_regtype { |
112 | 135 | ICP_NEIGH_REL, |
113 | 136 | }; |
114 | 137 |
|
| 138 | +enum icp_qat_css_fwtype { |
| 139 | + CSS_AE_FIRMWARE = 0, |
| 140 | + CSS_MMP_FIRMWARE = 1 |
| 141 | +}; |
| 142 | + |
115 | 143 | struct icp_qat_uclo_page { |
116 | 144 | struct icp_qat_uclo_encap_page *encap_page; |
117 | 145 | struct icp_qat_uclo_region *region; |
@@ -235,7 +263,7 @@ struct icp_qat_uof_filechunkhdr { |
235 | 263 | }; |
236 | 264 |
|
237 | 265 | struct icp_qat_uof_objhdr { |
238 | | - unsigned int cpu_type; |
| 266 | + unsigned int ac_dev_type; |
239 | 267 | unsigned short min_cpu_ver; |
240 | 268 | unsigned short max_cpu_ver; |
241 | 269 | short max_chunks; |
@@ -326,7 +354,7 @@ struct icp_qat_uof_image { |
326 | 354 | unsigned int img_name; |
327 | 355 | unsigned int ae_assigned; |
328 | 356 | unsigned int ctx_assigned; |
329 | | - unsigned int cpu_type; |
| 357 | + unsigned int ac_dev_type; |
330 | 358 | unsigned int entry_address; |
331 | 359 | unsigned int fill_pattern[2]; |
332 | 360 | unsigned int reloadable_size; |
@@ -374,4 +402,127 @@ struct icp_qat_uof_batch_init { |
374 | 402 | unsigned int size; |
375 | 403 | struct icp_qat_uof_batch_init *next; |
376 | 404 | }; |
| 405 | + |
| 406 | +struct icp_qat_suof_img_hdr { |
| 407 | + char *simg_buf; |
| 408 | + unsigned long simg_len; |
| 409 | + char *css_header; |
| 410 | + char *css_key; |
| 411 | + char *css_signature; |
| 412 | + char *css_simg; |
| 413 | + unsigned long simg_size; |
| 414 | + unsigned int ae_num; |
| 415 | + unsigned int ae_mask; |
| 416 | + unsigned int fw_type; |
| 417 | + unsigned long simg_name; |
| 418 | + unsigned long appmeta_data; |
| 419 | +}; |
| 420 | + |
| 421 | +struct icp_qat_suof_img_tbl { |
| 422 | + unsigned int num_simgs; |
| 423 | + struct icp_qat_suof_img_hdr *simg_hdr; |
| 424 | +}; |
| 425 | + |
| 426 | +struct icp_qat_suof_handle { |
| 427 | + unsigned int file_id; |
| 428 | + unsigned int check_sum; |
| 429 | + char min_ver; |
| 430 | + char maj_ver; |
| 431 | + char fw_type; |
| 432 | + char *suof_buf; |
| 433 | + unsigned int suof_size; |
| 434 | + char *sym_str; |
| 435 | + unsigned int sym_size; |
| 436 | + struct icp_qat_suof_img_tbl img_table; |
| 437 | +}; |
| 438 | + |
| 439 | +struct icp_qat_fw_auth_desc { |
| 440 | + unsigned int img_len; |
| 441 | + unsigned int reserved; |
| 442 | + unsigned int css_hdr_high; |
| 443 | + unsigned int css_hdr_low; |
| 444 | + unsigned int img_high; |
| 445 | + unsigned int img_low; |
| 446 | + unsigned int signature_high; |
| 447 | + unsigned int signature_low; |
| 448 | + unsigned int fwsk_pub_high; |
| 449 | + unsigned int fwsk_pub_low; |
| 450 | + unsigned int img_ae_mode_data_high; |
| 451 | + unsigned int img_ae_mode_data_low; |
| 452 | + unsigned int img_ae_init_data_high; |
| 453 | + unsigned int img_ae_init_data_low; |
| 454 | + unsigned int img_ae_insts_high; |
| 455 | + unsigned int img_ae_insts_low; |
| 456 | +}; |
| 457 | + |
| 458 | +struct icp_qat_auth_chunk { |
| 459 | + struct icp_qat_fw_auth_desc fw_auth_desc; |
| 460 | + u64 chunk_size; |
| 461 | + u64 chunk_bus_addr; |
| 462 | +}; |
| 463 | + |
| 464 | +struct icp_qat_css_hdr { |
| 465 | + unsigned int module_type; |
| 466 | + unsigned int header_len; |
| 467 | + unsigned int header_ver; |
| 468 | + unsigned int module_id; |
| 469 | + unsigned int module_vendor; |
| 470 | + unsigned int date; |
| 471 | + unsigned int size; |
| 472 | + unsigned int key_size; |
| 473 | + unsigned int module_size; |
| 474 | + unsigned int exponent_size; |
| 475 | + unsigned int fw_type; |
| 476 | + unsigned int reserved[21]; |
| 477 | +}; |
| 478 | + |
| 479 | +struct icp_qat_simg_ae_mode { |
| 480 | + unsigned int file_id; |
| 481 | + unsigned short maj_ver; |
| 482 | + unsigned short min_ver; |
| 483 | + unsigned int dev_type; |
| 484 | + unsigned short devmax_ver; |
| 485 | + unsigned short devmin_ver; |
| 486 | + unsigned int ae_mask; |
| 487 | + unsigned int ctx_enables; |
| 488 | + char fw_type; |
| 489 | + char ctx_mode; |
| 490 | + char nn_mode; |
| 491 | + char lm0_mode; |
| 492 | + char lm1_mode; |
| 493 | + char scs_mode; |
| 494 | + char lm2_mode; |
| 495 | + char lm3_mode; |
| 496 | + char tindex_mode; |
| 497 | + unsigned char reserved[7]; |
| 498 | + char simg_name[256]; |
| 499 | + char appmeta_data[256]; |
| 500 | +}; |
| 501 | + |
| 502 | +struct icp_qat_suof_filehdr { |
| 503 | + unsigned int file_id; |
| 504 | + unsigned int check_sum; |
| 505 | + char min_ver; |
| 506 | + char maj_ver; |
| 507 | + char fw_type; |
| 508 | + char reserved; |
| 509 | + unsigned short max_chunks; |
| 510 | + unsigned short num_chunks; |
| 511 | +}; |
| 512 | + |
| 513 | +struct icp_qat_suof_chunk_hdr { |
| 514 | + char chunk_id[ICP_QAT_SUOF_OBJ_ID_LEN]; |
| 515 | + u64 offset; |
| 516 | + u64 size; |
| 517 | +}; |
| 518 | + |
| 519 | +struct icp_qat_suof_strtable { |
| 520 | + unsigned int tab_length; |
| 521 | + unsigned int strings; |
| 522 | +}; |
| 523 | + |
| 524 | +struct icp_qat_suof_objhdr { |
| 525 | + unsigned int img_length; |
| 526 | + unsigned int reserved; |
| 527 | +}; |
377 | 528 | #endif |
0 commit comments