Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp487573imm; Fri, 28 Sep 2018 01:44:22 -0700 (PDT) X-Google-Smtp-Source: ACcGV61AC03KsAMB6jOjg4hMmrKp9X5wGPkOF5Y7kwuz6tro7qOdlatxz8NTXinGDdyJmDNGPt2B X-Received: by 2002:a17:902:a58a:: with SMTP id az10-v6mr15259853plb.204.1538124262539; Fri, 28 Sep 2018 01:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538124262; cv=none; d=google.com; s=arc-20160816; b=WkxK9+yjWhGW1jm32wizL74ll0/rm0EVqV+J/iLinDd6sN+hAqUeYucHe4nqwKRY34 0ElSBsm/VmslrdDXuj60o42EWKf/3J1qvHauaCUKV2844B0lOa8Jb4xjkcuR3Jd4aLld M18vnXdg1qqMtIQQnGcN6cB6BGIfHnCDR5PGPkh/Sps89NZXu3I9AW3PmJqpOQQw8VA+ w4XFRp0WR1Ju9111oLpBC4OYGl9qlNphWyrNWB/Xqz46yj4kkReD0npkug51qamX4+us fks3OBjIhGV6i0eO81k0xxlR8R4FjhBYbRq00Se3l7iXfVilLOTUgFR/NeymjWE7qC+K 6szQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from; bh=jELQq5E6010RkAMszVMPaEFko1c0IsUoD0i0akAfttM=; b=n0b6BLnBWfIHuXiNF4UnyfKxumMcYdqjvkE21f8roFwVE36xvPl0WrU6AF4TPcDGUL hrFNLOTrolmPlrJ9crOJJIUjpUwQ+tlJy54+D8wqDeSgRKJeVJB9Y/zL85WhLqaZJGjq cAcYmGluB90f0hCq/ETvMrqKX7SrrxyCbe9rNmmYwSiVjoFilKbsZHqF5M73iNDqvZlG vcZkv0WgpvpFrtZ7ygvbxuppneq9dJyokiJd75flCdVdSqaBWvmHLv2097RzK47ckxxx +LPVDMzKajmtcJXgbqjiK3zm+TxpTfDDkC6dLo6sE2YPKBqvO6Oh/WhAeBOBQqAoyHHk KWYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2-v6si4045070plo.412.2018.09.28.01.44.06; Fri, 28 Sep 2018 01:44:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729349AbeI1PGb (ORCPT + 99 others); Fri, 28 Sep 2018 11:06:31 -0400 Received: from inva021.nxp.com ([92.121.34.21]:50764 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729206AbeI1PGY (ORCPT ); Fri, 28 Sep 2018 11:06:24 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E534B200071; Fri, 28 Sep 2018 10:43:41 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D901520000A; Fri, 28 Sep 2018 10:43:41 +0200 (CEST) Received: from fsr-fed2164-101.ea.freescale.net (fsr-fed2164-101.ea.freescale.net [10.171.82.91]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 7CC352039E; Fri, 28 Sep 2018 10:43:41 +0200 (CEST) From: Madalin Bucur To: leoyang.li@nxp.com Cc: roy.pledge@nxp.com, claudiu.manoil@nxp.com, catalin.marinas@arm.com, oss@buserror.net, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Madalin Bucur Subject: [PATCH v2 5/5] soc/fsl_qbman: export coalesce change API Date: Fri, 28 Sep 2018 11:43:24 +0300 Message-Id: <1538124204-31406-6-git-send-email-madalin.bucur@nxp.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1538124204-31406-1-git-send-email-madalin.bucur@nxp.com> References: <1538124204-31406-1-git-send-email-madalin.bucur@nxp.com> Reply-to: madalin.bucur@nxp.com X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Export the API required to control the QMan portal interrupt coalescing settings. Signed-off-by: Madalin Bucur --- drivers/soc/fsl/qbman/qman.c | 31 +++++++++++++++++++++++++++++++ include/soc/fsl/qman.h | 27 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index 99d0f87889b8..8ab75bb44c4d 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c @@ -1012,6 +1012,37 @@ static inline void put_affine_portal(void) static struct workqueue_struct *qm_portal_wq; +void qman_dqrr_set_ithresh(struct qman_portal *portal, u8 ithresh) +{ + if (!portal) + return; + + qm_dqrr_set_ithresh(&portal->p, ithresh); + portal->p.dqrr.ithresh = ithresh; +} +EXPORT_SYMBOL(qman_dqrr_set_ithresh); + +void qman_dqrr_get_ithresh(struct qman_portal *portal, u8 *ithresh) +{ + if (portal && ithresh) + *ithresh = portal->p.dqrr.ithresh; +} +EXPORT_SYMBOL(qman_dqrr_get_ithresh); + +void qman_portal_get_iperiod(struct qman_portal *portal, u32 *iperiod) +{ + if (portal && iperiod) + *iperiod = qm_in(&portal->p, QM_REG_ITPR); +} +EXPORT_SYMBOL(qman_portal_get_iperiod); + +void qman_portal_set_iperiod(struct qman_portal *portal, u32 iperiod) +{ + if (portal) + qm_out(&portal->p, QM_REG_ITPR, iperiod); +} +EXPORT_SYMBOL(qman_portal_set_iperiod); + int qman_wq_alloc(void) { qm_portal_wq = alloc_workqueue("qman_portal_wq", 0, 1); diff --git a/include/soc/fsl/qman.h b/include/soc/fsl/qman.h index d4dfefdee6c1..42f50eb51529 100644 --- a/include/soc/fsl/qman.h +++ b/include/soc/fsl/qman.h @@ -1186,4 +1186,31 @@ int qman_alloc_cgrid_range(u32 *result, u32 count); */ int qman_release_cgrid(u32 id); +/** + * qman_dqrr_get_ithresh - Get coalesce interrupt threshold + * @portal: portal to get the value for + * @ithresh: threshold pointer + */ +void qman_dqrr_get_ithresh(struct qman_portal *portal, u8 *ithresh); + +/** + * qman_dqrr_set_ithresh - Set coalesce interrupt threshold + * @portal: portal to set the new value on + * @ithresh: new threshold value + */ +void qman_dqrr_set_ithresh(struct qman_portal *portal, u8 ithresh); + +/** + * qman_dqrr_get_iperiod - Get coalesce interrupt period + * @portal: portal to get the value for + * @iperiod: period pointer + */ +void qman_portal_get_iperiod(struct qman_portal *portal, u32 *iperiod); +/* + * qman_dqrr_set_iperiod - Set coalesce interrupt period + * @portal: portal to set the new value on + * @ithresh: new period value + */ +void qman_portal_set_iperiod(struct qman_portal *portal, u32 iperiod); + #endif /* __FSL_QMAN_H */ -- 2.1.0