From patchwork Wed Aug 9 13:27:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 133260 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2813777vqr; Wed, 9 Aug 2023 06:52:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELSO1aIjBP+mBidUHDZ5dOOBe0y+Qt0rbtcfkEp9rzOQBRinmyYKAEtkSH4TCLoERx3Ob5 X-Received: by 2002:a05:6808:1b21:b0:3a7:3a47:b137 with SMTP id bx33-20020a0568081b2100b003a73a47b137mr3290247oib.54.1691589122513; Wed, 09 Aug 2023 06:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691589122; cv=none; d=google.com; s=arc-20160816; b=aE8bb2Wj/Ztm5oPu7cgY+r9z/ggamdWi+GUMdRBqUyVVPW1JaPBziT5LSO5YUlx5cn q31FNwKwHFOf8szQ/YHmGfk1VOPopN42SLNmLo0XbSxq9XWt2YLrQQ8G9/pMu8Wy3fiw UivJPsIboVJvnFWTV7JzRsK0tYeCV5jJt5OUHTZwOCrPyPQoRFXBHV6XrKJp9Szv2OrH 7YdCSO9P7SGtKWhrCc3vqVk1LHUyOR52ZGysQZFlg8JH8dHZ7+Wze7SkrRGzBS43dLId 82Lua3Y8DNmXgu+ITPmAIyII/v++kT5dI4NRe8TlsfCfXSlt83lsm7xNcnLcOQF93yi0 hrig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gAM2YMBHWF8qG5QhdoVjXo+Iay83Vxa5GZMC/ja3Hl8=; fh=OtJVFpZ5Y8/ND7g8QcUIbRSFhG4LznwcYYtG4zWKevM=; b=pa1W7PZyPH+RKumkkNWCHbIVn1GdygKgVDrY/cpPyLfpl9/Dk+00ZCVm7Hk+J+W3Jh MU+X510lV/HBUBfY3ae1eAG9mB6ZxWtK2A6r3oE/WLEUz8VhcqIAn5wH9FdpRLFMliAc mWJADJN2aMf/KDSMs3ZIU7xRYsma+zh6kRz+EkCc5B+wDqJT6nx8PTHP6My+k/f/YQRZ WDaheO4rXKwt95pb9z3KKK6KvMw8GqVetNkCZawjwBz+QDsZtFPT/2tbrHefn/u3OEZX RraZe8uQWbx5qqBrmQzqUXrdl7Niw9U/HAmky+jTz+E8KtRrPimAYeyirk2qKDB66Ive 35GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=pctvVETX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nk4-20020a17090b194400b002597ed3cc4fsi1403038pjb.189.2023.08.09.06.51.49; Wed, 09 Aug 2023 06:52:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=pctvVETX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231470AbjHIN3d (ORCPT + 99 others); Wed, 9 Aug 2023 09:29:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233190AbjHIN25 (ORCPT ); Wed, 9 Aug 2023 09:28:57 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 534AA2D57; Wed, 9 Aug 2023 06:28:38 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 061BD4000C; Wed, 9 Aug 2023 13:28:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1691587717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gAM2YMBHWF8qG5QhdoVjXo+Iay83Vxa5GZMC/ja3Hl8=; b=pctvVETXcJ6lLFpIFQCjSm3qw9RK1zzTwDd/LNCJ6leliyn+dQDUw6kkt5Ah251mcsWF+N mnVh0dbtnHxOco5ograTxqc8gQO8KmQXwfXUyu5AdjkYh+AWB60AyWo42KHwkZ2l4UJHGe 9Xnm5ISDZLht7Jt9OaV0v7kKXD5RSVDEvpRrAeZaO4XfCu9yPFZfX9A2VSVwso89LOht3A Ek7M1mnqbUdjoK17G8gcoGUYsmJH7E3c4FhQ84YkOlFjDsUieC8kWdLddfBiiMZ62wcSUV iFTTIcb+Um/HEVnH2r5kyVD5lYELSgib0x+HSRNflmAntPS4kW9LRy6CbWPt4Q== From: Herve Codina To: Herve Codina , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Linus Walleij , Qiang Zhao , Li Yang , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Christophe Leroy , Randy Dunlap Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Thomas Petazzoni Subject: [PATCH v3 14/28] soc: fsl: cpm1: qmc: Add support for disabling channel TSA entries Date: Wed, 9 Aug 2023 15:27:41 +0200 Message-ID: <20230809132757.2470544-15-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230809132757.2470544-1-herve.codina@bootlin.com> References: <20230809132757.2470544-1-herve.codina@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773759755455273614 X-GMAIL-MSGID: 1773759755455273614 In order to allow runtime timeslot route changes, disabling channel TSA entries needs to be supported. Add support for this new feature. Signed-off-by: Herve Codina Reviewed-by: Christophe Leroy --- drivers/soc/fsl/qe/qmc.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c index 07fa3c265858..90e6fffddab3 100644 --- a/drivers/soc/fsl/qe/qmc.c +++ b/drivers/soc/fsl/qe/qmc.c @@ -567,7 +567,8 @@ static void qmc_chan_read_done(struct qmc_chan *chan) spin_unlock_irqrestore(&chan->rx_lock, flags); } -static int qmc_chan_setup_tsa_64rxtx(struct qmc_chan *chan, const struct tsa_serial_info *info) +static int qmc_chan_setup_tsa_64rxtx(struct qmc_chan *chan, const struct tsa_serial_info *info, + bool enable) { unsigned int i; u16 curr; @@ -603,13 +604,14 @@ static int qmc_chan_setup_tsa_64rxtx(struct qmc_chan *chan, const struct tsa_ser continue; qmc_clrsetbits16(chan->qmc->scc_pram + QMC_GBL_TSATRX + (i * 2), - ~QMC_TSA_WRAP, val); + ~QMC_TSA_WRAP, enable ? val : 0x0000); } return 0; } -static int qmc_chan_setup_tsa_32rx_32tx(struct qmc_chan *chan, const struct tsa_serial_info *info) +static int qmc_chan_setup_tsa_32rx_32tx(struct qmc_chan *chan, const struct tsa_serial_info *info, + bool enable) { unsigned int i; u16 curr; @@ -650,7 +652,7 @@ static int qmc_chan_setup_tsa_32rx_32tx(struct qmc_chan *chan, const struct tsa_ continue; qmc_clrsetbits16(chan->qmc->scc_pram + QMC_GBL_TSATRX + (i * 2), - ~QMC_TSA_WRAP, val); + ~QMC_TSA_WRAP, enable ? val : 0x0000); } /* Set entries based on Tx stuff */ for (i = 0; i < info->nb_tx_ts; i++) { @@ -658,13 +660,13 @@ static int qmc_chan_setup_tsa_32rx_32tx(struct qmc_chan *chan, const struct tsa_ continue; qmc_clrsetbits16(chan->qmc->scc_pram + QMC_GBL_TSATTX + (i * 2), - ~QMC_TSA_WRAP, val); + ~QMC_TSA_WRAP, enable ? val : 0x0000); } return 0; } -static int qmc_chan_setup_tsa(struct qmc_chan *chan) +static int qmc_chan_setup_tsa(struct qmc_chan *chan, bool enable) { struct tsa_serial_info info; int ret; @@ -679,8 +681,8 @@ static int qmc_chan_setup_tsa(struct qmc_chan *chan) * and one for Tx) according to assigned TS numbers. */ return ((info.nb_tx_ts > 32) || (info.nb_rx_ts > 32)) ? - qmc_chan_setup_tsa_64rxtx(chan, &info) : - qmc_chan_setup_tsa_32rx_32tx(chan, &info); + qmc_chan_setup_tsa_64rxtx(chan, &info, enable) : + qmc_chan_setup_tsa_32rx_32tx(chan, &info, enable); } static int qmc_chan_command(struct qmc_chan *chan, u8 qmc_opcode) @@ -1146,7 +1148,7 @@ static int qmc_setup_chan(struct qmc *qmc, struct qmc_chan *chan) chan->qmc = qmc; - ret = qmc_chan_setup_tsa(chan); + ret = qmc_chan_setup_tsa(chan, true); if (ret) return ret;