Skip to content

Commit 38a9eb8

Browse files
yekai123123herbertx
authored andcommitted
crypto: hisilicon/zip - adds the max shaper type rate
The ZIP driver support configure each function's QoS in the Host for Kunpeng930. The ZIP driver needs to configure the maximum shaper type rate. Signed-off-by: Kai Ye <yekai13@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent c02f530 commit 38a9eb8

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/crypto/hisilicon/zip/zip_main.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@
102102
#define HZIP_PREFETCH_ENABLE (~(BIT(26) | BIT(17) | BIT(0)))
103103
#define HZIP_SVA_PREFETCH_DISABLE BIT(26)
104104
#define HZIP_SVA_DISABLE_READY (BIT(26) | BIT(30))
105+
#define HZIP_SHAPER_RATE_COMPRESS 252
106+
#define HZIP_SHAPER_RATE_DECOMPRESS 229
105107
#define HZIP_DELAY_1_US 1
106108
#define HZIP_POLL_TIMEOUT_US 1000
107109

@@ -823,13 +825,22 @@ static void hisi_zip_qm_uninit(struct hisi_qm *qm)
823825

824826
static int hisi_zip_probe_init(struct hisi_zip *hisi_zip)
825827
{
828+
u32 type_rate = HZIP_SHAPER_RATE_COMPRESS;
826829
struct hisi_qm *qm = &hisi_zip->qm;
827830
int ret;
828831

829832
if (qm->fun_type == QM_HW_PF) {
830833
ret = hisi_zip_pf_probe_init(hisi_zip);
831834
if (ret)
832835
return ret;
836+
/* enable shaper type 0 */
837+
if (qm->ver >= QM_HW_V3) {
838+
type_rate |= QM_SHAPER_ENABLE;
839+
840+
/* ZIP need to enable shaper type 1 */
841+
type_rate |= HZIP_SHAPER_RATE_DECOMPRESS << QM_SHAPER_TYPE1_OFFSET;
842+
qm->type_rate = type_rate;
843+
}
833844
}
834845

835846
return 0;

0 commit comments

Comments
 (0)