Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp409743pxj; Fri, 11 Jun 2021 02:08:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+WzUry3DRv/mFZYU9UKc/BK97kk6sFb5bhXYgjfoz2UCM53rfTDHdaqDAgK4en+Q6BYao X-Received: by 2002:a17:907:2cf6:: with SMTP id hz22mr2887896ejc.320.1623402522777; Fri, 11 Jun 2021 02:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623402522; cv=none; d=google.com; s=arc-20160816; b=01p0WJGMDf3FoQt9mjowvEx5o6en4ba2uhXRj3hQ1lFfAtZ5Vv+KDqQ8UtoEF2n/n/ g4Dv1bljOf/x4aQkciajrScSAngg9m2mvPc5Hd2/P/BRt+tgsl74GI8tZo80rNqoeg0q wdM2mh+Pm8LeHkDdtEDjnIFoWLBGcKLbX0qtXcNlchR40p3Xmr9652VdVo+Ugkx1Lh8u 19YfealO+MHwTjNEy9Wb4Cli0ZGPxSuA3KRk8pG4JPf4fkwrCFdcISkfZDpes65w1nBd /5/m13pFqCjUDEVBVzhvJsFWyh8aVeKuXU5WHzXTNRgWU7HY/Pan77ywrhUOAinffaZ0 Og+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=cQAMgauXail63jeEi0xzqamCvBZwK3+zK9h8/MEJLJ0=; b=zsKG+Jb44TEArTzgC0dmX2zraagcyEFJ2Sko1nDoziG9K2YZ1Wju8c6UKCJlfJjJpb s9HQ/KCMPNwj5WqkbknhqHhDBLkpmwefcNw/GA3RhOacUNxZ2VpyxWpuRVQp+YBEQig3 Uodi3MXkZ3gq9OC9QXicJoSLCbbX9UJk/B1WxJp23T9g3TDDdOmYU23bgVEG7NTibcQW OTpXWLbYm3bbf1bwSzVx2rlPpVPTP9wa55ypY6OZOYJwg1SqaXKfxs+Wl2HtTQEtL20Z SZW0JEwx/cMWp9kSogZSeiWQe5Kq85+0Xr91L7623JFYdwmJsV+I2Md0qG/QDmVE4pz3 lJxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cm8si4429985edb.480.2021.06.11.02.08.19; Fri, 11 Jun 2021 02:08:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231599AbhFKJJa (ORCPT + 99 others); Fri, 11 Jun 2021 05:09:30 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:9077 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231540AbhFKJJY (ORCPT ); Fri, 11 Jun 2021 05:09:24 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G1ZfV0FWtzZcm6; Fri, 11 Jun 2021 17:04:34 +0800 (CST) Received: from dggpeml500012.china.huawei.com (7.185.36.15) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 11 Jun 2021 17:07:09 +0800 Received: from huawei.com (10.69.192.56) by dggpeml500012.china.huawei.com (7.185.36.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 11 Jun 2021 17:07:09 +0800 From: Kai Ye To: CC: , , , Subject: [PATCH 8/8] crypto: hisilicon/zip - adds the max shaper type rate Date: Fri, 11 Jun 2021 17:06:50 +0800 Message-ID: <1623402410-63906-9-git-send-email-yekai13@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1623402410-63906-1-git-send-email-yekai13@huawei.com> References: <1623402410-63906-1-git-send-email-yekai13@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500012.china.huawei.com (7.185.36.15) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- drivers/crypto/hisilicon/zip/zip_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c index 9e4c49c..f8482ce 100644 --- a/drivers/crypto/hisilicon/zip/zip_main.c +++ b/drivers/crypto/hisilicon/zip/zip_main.c @@ -102,6 +102,8 @@ #define HZIP_PREFETCH_ENABLE (~(BIT(26) | BIT(17) | BIT(0))) #define HZIP_SVA_PREFETCH_DISABLE BIT(26) #define HZIP_SVA_DISABLE_READY (BIT(26) | BIT(30)) +#define HZIP_SHAPER_RATE_COMPRESS 252 +#define HZIP_SHAPER_RATE_DECOMPRESS 229 #define HZIP_DELAY_1_US 1 #define HZIP_POLL_TIMEOUT_US 1000 @@ -823,6 +825,7 @@ static void hisi_zip_qm_uninit(struct hisi_qm *qm) static int hisi_zip_probe_init(struct hisi_zip *hisi_zip) { + u32 type_rate = HZIP_SHAPER_RATE_COMPRESS; struct hisi_qm *qm = &hisi_zip->qm; int ret; @@ -830,6 +833,14 @@ static int hisi_zip_probe_init(struct hisi_zip *hisi_zip) ret = hisi_zip_pf_probe_init(hisi_zip); if (ret) return ret; + /* enable shaper type 0 */ + if (qm->ver >= QM_HW_V3) { + type_rate |= QM_SHAPER_ENABLE; + + /* ZIP need to enable shaper type 1 */ + type_rate |= HZIP_SHAPER_RATE_DECOMPRESS << QM_SHAPER_TYPE1_OFFSET; + qm->type_rate = type_rate; + } } return 0; -- 2.7.4