Message ID | 20230726150225.483464-16-herve.codina@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp499145vqo; Wed, 26 Jul 2023 09:01:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlFz91RcgyHQq0IZqQJAAQLGkoO3iSwKxw23rI8TwRDxwfI744btiuUaqiWLM8pIquL8g+GI X-Received: by 2002:a17:907:a056:b0:99b:484b:21b5 with SMTP id gz22-20020a170907a05600b0099b484b21b5mr2171819ejc.8.1690387301360; Wed, 26 Jul 2023 09:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690387301; cv=none; d=google.com; s=arc-20160816; b=u/s17nOofVD/W1O0JaUZL+IFjsOInVHqsqn+SjMhEzjNYFXTmPEy1RwkphfFPL9icT 70Yv0ACUqajSpT3ZMWS6M4oJBDrL+sID7MhQT/02OLBxZdKDepAtjCqjA3CFS2RggB7t kVi2nZvCQ2511ltbvaBfxWFFDvxcGwn5FzK0xxPTf3U9CzoWJlawsurU6Yd6BwSRalpq pEHl2iN13K3KZvy0jQtlwX8rqAwKPwrTP6ItsCi8fBuHAAfeBwOaAgDzBo6QB/xH6JiL O4AAnkGkRT7gXcere0sQlitfoOUMOfQBOgI/uswNrXng6O1df5LdCKpAile2FI5S4192 BsKw== 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=GBt50e+s29lg78AAaNK/5LXVHKyVi9N5D9KoMPA4Iqc=; fh=OtJVFpZ5Y8/ND7g8QcUIbRSFhG4LznwcYYtG4zWKevM=; b=zRrdrQ9xfuEAohsH3WyJP6FTyby8SVG+oigsgv0Uecfd+KDassz6m3J3q4f+BpcJMT PFYIr1mX6sfZfwggLlqxpyR1Ulu9fwiceE8moPT6UOyxg9di1d5k533kvb9AOrK9+5TF QmvP9Z4R+A8Q/kdoYxgNcBYlU9X0c3U6dgtRzd/LygAtpYVNfvysiX3WlbwSp73w/BeM JKNo0uI1/4OxSnLPAQJh0JiDnwpadEwY3tVKGPZ8yYki1kAxkjXgqafp9YHgEocHa3eo 0JHFIdby6I63UFIVnvYd1i/ZZYWV1nQ7vUkjcoLRUNLRZBIDyGC6QPm1AWgRpT1S6jGM wfzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=HOTKwtep; 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 s6-20020a170906a18600b0098d5b116e6fsi9755266ejy.856.2023.07.26.09.01.09; Wed, 26 Jul 2023 09:01:41 -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=HOTKwtep; 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 S234761AbjGZPEj (ORCPT <rfc822;kloczko.tomasz@gmail.com> + 99 others); Wed, 26 Jul 2023 11:04:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234757AbjGZPEM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Jul 2023 11:04:12 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81F333581; Wed, 26 Jul 2023 08:03:35 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 900581C000D; Wed, 26 Jul 2023 15:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1690383813; 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=GBt50e+s29lg78AAaNK/5LXVHKyVi9N5D9KoMPA4Iqc=; b=HOTKwtepgjDI5abcuVg8KB0ultpgrNFyvNU1rzpy3RseAZ4blkgsclcjHDE76K7hBIBsiw 91pbBo6Kmz4T0KJa7p202DD2zQixJ/Ub5Ej4ICPBfxzWu5dez1003gzIbaGZ7AZpNMCQ1u d7izLYuIGGipF8gmjCx7p55iHn8iOKeR8dOSxkFAXyqEr4TQgrOXEkSlsJUlAgAfcSV8D+ 0J8pRflISZqzr+bZ1TD8IqAGQ987w4yzmd89mOkq2g0ApibmhA+EQqtMQF5YBnxhBdT/U/ 4xRwSiV+RFSK4AfCNGEARAkf56mmSjdSgE91nNXu1j1hvdZox1l/RDP3DvqmnQ== From: Herve Codina <herve.codina@bootlin.com> To: Herve Codina <herve.codina@bootlin.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Andrew Lunn <andrew@lunn.ch>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Lee Jones <lee@kernel.org>, Linus Walleij <linus.walleij@linaro.org>, Qiang Zhao <qiang.zhao@nxp.com>, Li Yang <leoyang.li@nxp.com>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Shengjiu Wang <shengjiu.wang@gmail.com>, Xiubo Li <Xiubo.Lee@gmail.com>, Fabio Estevam <festevam@gmail.com>, Nicolin Chen <nicoleotsuka@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, Randy Dunlap <rdunlap@infradead.org> 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 <thomas.petazzoni@bootlin.com> Subject: [PATCH v2 15/28] soc: fsl: cpm1: qmc: Introduce is_tsa_64rxtx flag Date: Wed, 26 Jul 2023 17:02:11 +0200 Message-ID: <20230726150225.483464-16-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230726150225.483464-1-herve.codina@bootlin.com> References: <20230726150225.483464-1-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772499554422721274 X-GMAIL-MSGID: 1772499554422721274 |
Series |
Add support for QMC HDLC, framer infrastruture and PEF2256 framer
|
|
Commit Message
Herve Codina
July 26, 2023, 3:02 p.m. UTC
In order to support runtime timeslot route changes, some operations will
be different according the routing table used (common Rx and Tx table or
one table for Rx and one for Tx).
The is_tsa_64rxtx flag is introduced to avoid extra computation to
determine the table format each time we need it.
It is set once at initialization.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
drivers/soc/fsl/qe/qmc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
Le 26/07/2023 à 17:02, Herve Codina a écrit : > In order to support runtime timeslot route changes, some operations will > be different according the routing table used (common Rx and Tx table or > one table for Rx and one for Tx). > > The is_tsa_64rxtx flag is introduced to avoid extra computation to > determine the table format each time we need it. > It is set once at initialization. > > Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> > --- > drivers/soc/fsl/qe/qmc.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c > index c8ddd2a54bee..dc113463fbc7 100644 > --- a/drivers/soc/fsl/qe/qmc.c > +++ b/drivers/soc/fsl/qe/qmc.c > @@ -216,6 +216,7 @@ struct qmc { > u16 __iomem *int_curr; > dma_addr_t int_dma_addr; > size_t int_size; > + bool is_tsa_64rxtx; > struct list_head chan_head; > struct qmc_chan *chans[64]; > }; > @@ -696,7 +697,7 @@ static int qmc_chan_setup_tsa(struct qmc_chan *chan, bool enable) > * Setup one common 64 entries table or two 32 entries (one for Tx > * and one for Tx) according to assigned TS numbers. > */ > - if (info.nb_tx_ts > 32 || info.nb_rx_ts > 32) > + if (chan->qmc->is_tsa_64rxtx) > return qmc_chan_setup_tsa_64rxtx(chan, &info, enable); > > ret = qmc_chan_setup_tsa_32rx(chan, &info, enable); > @@ -1053,6 +1054,7 @@ static int qmc_init_tsa_64rxtx(struct qmc *qmc, const struct tsa_serial_info *in > * Everything was previously checked, Tx and Rx related stuffs are > * identical -> Used Rx related stuff to build the table > */ > + qmc->is_tsa_64rxtx = true; > > /* Invalidate all entries */ > for (i = 0; i < 64; i++) > @@ -1081,6 +1083,7 @@ static int qmc_init_tsa_32rx_32tx(struct qmc *qmc, const struct tsa_serial_info > * Use a Tx 32 entries table and a Rx 32 entries table. > * Everything was previously checked. > */ > + qmc->is_tsa_64rxtx = false; > > /* Invalidate all entries */ > for (i = 0; i < 32; i++) {
diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c index c8ddd2a54bee..dc113463fbc7 100644 --- a/drivers/soc/fsl/qe/qmc.c +++ b/drivers/soc/fsl/qe/qmc.c @@ -216,6 +216,7 @@ struct qmc { u16 __iomem *int_curr; dma_addr_t int_dma_addr; size_t int_size; + bool is_tsa_64rxtx; struct list_head chan_head; struct qmc_chan *chans[64]; }; @@ -696,7 +697,7 @@ static int qmc_chan_setup_tsa(struct qmc_chan *chan, bool enable) * Setup one common 64 entries table or two 32 entries (one for Tx * and one for Tx) according to assigned TS numbers. */ - if (info.nb_tx_ts > 32 || info.nb_rx_ts > 32) + if (chan->qmc->is_tsa_64rxtx) return qmc_chan_setup_tsa_64rxtx(chan, &info, enable); ret = qmc_chan_setup_tsa_32rx(chan, &info, enable); @@ -1053,6 +1054,7 @@ static int qmc_init_tsa_64rxtx(struct qmc *qmc, const struct tsa_serial_info *in * Everything was previously checked, Tx and Rx related stuffs are * identical -> Used Rx related stuff to build the table */ + qmc->is_tsa_64rxtx = true; /* Invalidate all entries */ for (i = 0; i < 64; i++) @@ -1081,6 +1083,7 @@ static int qmc_init_tsa_32rx_32tx(struct qmc *qmc, const struct tsa_serial_info * Use a Tx 32 entries table and a Rx 32 entries table. * Everything was previously checked. */ + qmc->is_tsa_64rxtx = false; /* Invalidate all entries */ for (i = 0; i < 32; i++) {