diff --git a/kae_driver/plat_hpre_main.c b/kae_driver/plat_hpre_main.c index 76868a057277cafd73cd303a2b034b62649cc9d1..9e49a5181c558bb442cba13791c0a6a12813a6b0 100644 --- a/kae_driver/plat_hpre_main.c +++ b/kae_driver/plat_hpre_main.c @@ -9,7 +9,10 @@ #include #include "plat_qm.h" -#include "plat_hpre_main.h" + +struct plat_hpre { + struct hisi_plat_qm qm; +}; #define HPRE_SQE_SIZE 64 diff --git a/kae_driver/plat_hpre_main.h b/kae_driver/plat_hpre_main.h deleted file mode 100644 index f9490da519c0f127f78f0b9ac981bbe46b2e3996..0000000000000000000000000000000000000000 --- a/kae_driver/plat_hpre_main.h +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * SPDX-License-Identifier: GPL-2.0 - * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved. - */ - -#ifndef __HISI_HPRE_MAIN_H -#define __HISI_HPRE_MAIN_H - -#include "plat_qm.h" - -struct plat_hpre { - struct hisi_plat_qm qm; -}; - -#endif \ No newline at end of file diff --git a/kae_driver/plat_qm.c b/kae_driver/plat_qm.c index 394a23b46ae0a4194d07186823abced2400b6ad8..11236c9a5a72995990c5a9fa9ea11cf3c78df691 100644 --- a/kae_driver/plat_qm.c +++ b/kae_driver/plat_qm.c @@ -9,7 +9,6 @@ #include #include #include -#include "qm_common.h" #include "plat_qm.h" /* mailbox */ @@ -1318,4 +1317,4 @@ MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Leisen "); MODULE_AUTHOR("Guangwei Zhou "); MODULE_AUTHOR("Wangyuan "); -MODULE_DESCRIPTION("HiSilicon Accelerator queue manager Platform driver"); \ No newline at end of file +MODULE_DESCRIPTION("HiSilicon Accelerator queue manager Platform driver"); diff --git a/kae_driver/plat_qm.h b/kae_driver/plat_qm.h index b584b75e1d5932d0f6bccab21dde8119e0779fcd..edf38d15373eda2ff4fcec63f1fe5c4d203d210a 100644 --- a/kae_driver/plat_qm.h +++ b/kae_driver/plat_qm.h @@ -1,6 +1,5 @@ - +// SPDX-License-Identifier: GPL-2.0 /* - * SPDX-License-Identifier: GPL-2.0 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved. */ @@ -12,6 +11,73 @@ #define QM_Q_DEPTH 1024 +struct qm_cqe { + __le32 rsvd0; + __le16 cmd_id; + __le16 rsvd1; + __le16 sq_head; + __le16 sq_num; + __le16 rsvd2; + __le16 w7; +}; + +struct qm_eqe { + __le32 dw0; +}; + +struct qm_aeqe { + __le32 dw0; +}; + +struct qm_sqc { + __le16 head; + __le16 tail; + __le32 base_l; + __le32 base_h; + __le32 dw3; + __le16 w8; + __le16 rsvd0; + __le16 pasid; + __le16 w11; + __le16 cq_num; + __le16 w13; + __le32 rsvd1; +}; + +struct qm_cqc { + __le16 head; + __le16 tail; + __le32 base_l; + __le32 base_h; + __le32 dw3; + __le16 w8; + __le16 rsvd0; + __le16 pasid; + __le16 w11; + __le32 dw6; + __le32 rsvd1; +}; + +struct qm_eqc { + __le16 head; + __le16 tail; + __le32 base_l; + __le32 base_h; + __le32 dw3; + __le32 rsvd[2]; + __le32 dw6; +}; + +struct qm_aeqc { + __le16 head; + __le16 tail; + __le32 base_l; + __le32 base_h; + __le32 dw3; + __le32 rsvd[2]; + __le32 dw6; +}; + struct hisi_plat_qp { u32 qp_id; u16 sq_depth; @@ -79,4 +145,4 @@ int platform_start_qm(struct hisi_plat_qm *qm); int platform_stop_qm(struct hisi_plat_qm *qm, enum qm_stop_reason r); void platform_uninit_qm(struct hisi_plat_qm *qm); int platform_register_uacce(struct hisi_plat_qm *qm); -#endif /* !PLAT_QM_H */ \ No newline at end of file +#endif /* !PLAT_QM_H */ diff --git a/kae_driver/plat_sec.h b/kae_driver/plat_sec.h deleted file mode 100644 index 9993255aba085b49812feca7b670cfcb68c5b26f..0000000000000000000000000000000000000000 --- a/kae_driver/plat_sec.h +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * SPDX-License-Identifier: GPL-2.0 - * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved. - */ - -#ifndef __PLAT_SEC_H -#define __PLAT_SEC_H - -#include "plat_qm.h" - -struct sec_dev { - struct hisi_plat_qm qm; -}; - -#endif diff --git a/kae_driver/plat_sec_main.c b/kae_driver/plat_sec_main.c index 6bdd9a8be8e06a4a673e40a0845c1cf2579f2c41..efc1c71abcfa03f70c7b98cc57da60c668b20124 100644 --- a/kae_driver/plat_sec_main.c +++ b/kae_driver/plat_sec_main.c @@ -9,6 +9,11 @@ #define SEC_SQE_SIZE 128 +struct plat_sec { + struct hisi_plat_qm qm; +}; + + static int sec_qm_init(struct hisi_plat_qm *qm, struct platform_device *pdev) { qm->pdev = pdev; @@ -27,7 +32,7 @@ static int sec_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct hisi_plat_qm *qm; - struct sec_dev *sec; + struct plat_sec *sec; int ret; dev_info(dev, "SEC init ...\n");