From: Daniel Golle <daniel@makrotopia.org>
To: Paul Burton <paul.burton@mips.com>
Cc: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
John Crispin <john@phrozen.org>,
Stanislaw Gruszka <sgruszka@redhat.com>,
Tom Psyborg <pozega.tomislav@gmail.com>,
Ralf Baechle <ralf@linux-mips.org>,
Gabor Juhos <juhosg@freemail.hu>
Subject: Re: [PATCH] mips: ralink: add accessors for MT7620 chipver and pkg
Date: Mon, 5 Nov 2018 21:19:35 +0100 [thread overview]
Message-ID: <20181105201935.GF1389@makrotopia.org> (raw)
In-Reply-To: <20181105183615.nbvnfapug6zm42pg@pburton-laptop>
Hi Paul,
thank you for the review!
On Mon, Nov 05, 2018 at 06:36:16PM +0000, Paul Burton wrote:
> Hi Daniel,
>
> On Fri, Nov 02, 2018 at 03:07:19AM +0100, Daniel Golle wrote:
> > The RT6352 wireless core included in all MT7620 chips is implemented
> > differently in MT7620A (TFBGA) and MT7620N (DR-QFN).
> > Hence provide accessor functions similar to the already existing
> > mt7620_get_eco() function which allow the rt2x00 wireless driver to
> > figure out which WiSoC it is being run on.
> >
> > Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> > ---
> > arch/mips/include/asm/mach-ralink/mt7620.h | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/arch/mips/include/asm/mach-ralink/mt7620.h b/arch/mips/include/asm/mach-ralink/mt7620.h
> > index 66af4ccb5c6c..d0310a92a63f 100644
> > --- a/arch/mips/include/asm/mach-ralink/mt7620.h
> > +++ b/arch/mips/include/asm/mach-ralink/mt7620.h
> > @@ -137,4 +137,16 @@ static inline int mt7620_get_eco(void)
> > return rt_sysc_r32(SYSC_REG_CHIP_REV) & CHIP_REV_ECO_MASK;
> > }
> >
> > +static inline int mt7620_get_chipver(void)
> > +{
> > + return (rt_sysc_r32(SYSC_REG_CHIP_REV) >> CHIP_REV_VER_SHIFT) &
> > + CHIP_REV_VER_MASK;
> > +}
> > +
> > +static inline int mt7620_get_pkg(void)
> > +{
> > + return (rt_sysc_r32(SYSC_REG_CHIP_REV) >> CHIP_REV_PKG_SHIFT) &
> > + CHIP_REV_PKG_MASK;
> > +}
> > +
> > #endif
>
> Is there an in-tree user for these?
Not yet, OpenWrt's out-of-tree Ethernet driver needs the already
existing int mt7620_get_eco(void) and is going to be upstreamed once
MT7530 DSA for has been completed to work with MT7621. See the driver
in [1].
The two newly introduced accessors are going to be used by the in-tree
rt2x00 driver which gained support for the RT6352 wireless core
included in that SoC recently. In order to be able to carry out tuning
in the same way the vendor driver does, rt2x00 will need to access the
pkg and chipver fields. See [2] for example.
>
> Looking at it I don't see any in-tree code which uses the existing
> mt7620_get_eco() function. I'm not fond of adding code which isn't used
> at all in-tree, I'd much rather we either:
>
> 1) Get the driver that needs these upstreamed, and these functions
> could be added at the same time.
>
> or
>
> 2) Keep functions only used by out-of-tree code out-of-tree.
I understand your concerns with regard to the mt7620_get_eco(void)
function which is currently only used by the out-of-tree Ethernet
driver. However, the to-be-introduced functions mt7620_get_pkg(void)
and mt7620_get_chipver(void) are to be used in-tree by
drivers/net/wireless/ralink/rt2x00 in the very near future. I just
wanted to consult whether the introductions of such accessors is
generally acceptable before implementing the changes in rt2x00.
Best regards
Daniel
[1]: git://git.openwrt.org/openwrt.git:/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/soc_mt7620.c
[2]: https://github.com/i80s/mtk-sources/blob/master/mt7620/src/chips/rt6352.c#L1019
>
> Thanks,
> Paul
next prev parent reply other threads:[~2018-11-05 20:20 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-12 8:56 [PATCH v4 0/8] rt2800: register programing tweaks and clean ups Stanislaw Gruszka
2018-10-12 8:56 ` [PATCH v4 1/8] rt2x00: remove unneeded check Stanislaw Gruszka
2018-10-12 8:56 ` [PATCH v4 2/8] rt2x00: remove confusing AGC register Stanislaw Gruszka
2018-10-12 8:56 ` [PATCH v4 3/8] rt2x00: update TX_SW_CFG2 value Stanislaw Gruszka
2018-10-12 8:56 ` [PATCH v4 4/8] rt2800: fix registers init for MT7620 Stanislaw Gruszka
2018-10-12 10:48 ` Tom Psyborg
2018-10-12 11:36 ` Stanislaw Gruszka
2018-10-12 11:51 ` Tom Psyborg
2018-10-12 12:03 ` Stanislaw Gruszka
2018-10-12 12:20 ` Tom Psyborg
2018-10-12 12:26 ` Stanislaw Gruszka
2018-10-12 12:41 ` Tom Psyborg
2018-10-16 8:09 ` Stanislaw Gruszka
2018-10-16 11:19 ` Felix Fietkau
2018-10-16 11:21 ` Stanislaw Gruszka
2018-10-16 11:25 ` Felix Fietkau
2018-10-16 11:32 ` Tom Psyborg
2018-10-16 15:49 ` Stanislaw Gruszka
2018-10-17 13:25 ` Tom Psyborg
2018-10-19 9:00 ` Stanislaw Gruszka
2018-10-19 14:21 ` Tom Psyborg
2018-10-20 9:44 ` Stanislaw Gruszka
2018-10-18 15:51 ` Tom Psyborg
2018-10-16 8:11 ` Stanislaw Gruszka
2018-10-16 10:38 ` Daniel Golle
2018-11-02 2:07 ` [PATCH] mips: ralink: add accessors for MT7620 chipver and pkg Daniel Golle
2018-11-05 18:36 ` Paul Burton
2018-11-05 20:19 ` Daniel Golle [this message]
2018-11-05 23:05 ` Paul Burton
2018-11-05 23:27 ` Tom Psyborg
2018-10-13 9:46 ` [PATCH v4 4/8] rt2800: fix registers init for MT7620 Kalle Valo
2018-10-16 8:02 ` Stanislaw Gruszka
2018-10-12 8:56 ` [PATCH v4 5/8] rt2800: enable TX_PIN_CFG_LNA_PE_ bits per band Stanislaw Gruszka
2018-10-12 8:56 ` [PATCH v4 6/8] rt2800: enable TX_PIN_CFG_RFRX_EN only for MT7620 Stanislaw Gruszka
2018-10-12 10:52 ` Tom Psyborg
2018-10-12 11:38 ` Stanislaw Gruszka
2018-10-12 8:56 ` [PATCH v4 7/8] rt2800: remove unneeded RT6352 check Stanislaw Gruszka
2018-10-12 8:56 ` [PATCH v4 8/8] rt2800: comment and simplify AGC init for RT6352 Stanislaw Gruszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181105201935.GF1389@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=john@phrozen.org \
--cc=juhosg@freemail.hu \
--cc=linux-mips@linux-mips.org \
--cc=paul.burton@mips.com \
--cc=pozega.tomislav@gmail.com \
--cc=ralf@linux-mips.org \
--cc=sgruszka@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.