All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Psyborg <pozega.tomislav@gmail.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Daniel Golle <daniel@makrotopia.org>,
	linux-wireless@vger.kernel.org, Mathias Kresin <dev@kresin.me>,
	Felix Fietkau <nbd@nbd.name>
Subject: Re: [PATCH v3 4/4] rt2800: fix registers init for MT7620
Date: Wed, 10 Oct 2018 16:11:12 +0200	[thread overview]
Message-ID: <CAKR_QVJbtzpu6v4bZEz2UegWiAy1Ohooy-TciZcOeR_p+Z+yYg@mail.gmail.com> (raw)
In-Reply-To: <20181010124508.GA22330@redhat.com>

case 1:

	} else if (rt2x00_rt(rt2x00dev, RT5390) ||
		   rt2x00_rt(rt2x00dev, RT5392)) {
		rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
		rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606);
		rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
	} else if (rt2x00_rt(rt2x00dev, RT5592)) {
		rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
		rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000);
		rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
	} else if (rt2x00_rt(rt2x00dev, RT5350)) {
		rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
	} else if (rt2x00_rt(rt2x00dev, RT6352)) {
		rt2800_register_write(rt2x00dev, MIMO_PS_CFG, 0x00000002);
		rt2800_register_write(rt2x00dev, TX_PIN_CFG, 0x00150F0F);
		rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x06060606);
		rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0);
		rt2800_register_write(rt2x00dev, TX1_BB_GAIN_ATTEN, 0x0);
		rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, 0x6C6C666C);
		rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN, 0x6C6C666C);

does your 6352 wifi work?

case 2:

	} else if (rt2x00_rt(rt2x00dev, RT5390) ||
		   rt2x00_rt(rt2x00dev, RT5392)) {
	} else if (rt2x00_rt(rt2x00dev, RT5592)) {
		rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
		rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000);
		rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
	} else if (rt2x00_rt(rt2x00dev, RT5350)) {
		rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
	} else if (rt2x00_rt(rt2x00dev, RT6352)) {
		rt2800_register_write(rt2x00dev, MIMO_PS_CFG, 0x00000002);
		rt2800_register_write(rt2x00dev, TX_PIN_CFG, 0x00150F0F);
		rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x06060606);
		rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0);
		rt2800_register_write(rt2x00dev, TX1_BB_GAIN_ATTEN, 0x0);
		rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, 0x6C6C666C);
		rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN, 0x6C6C666C);

does your 6352 wifi still work?


On 10/10/2018, Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> Hello
>
> On Wed, Oct 10, 2018 at 02:06:58PM +0200, Daniel Golle wrote:
>> > > https://github.com/psyborg55/linux/commit/24b46d482590a87553df1de0b5c8032f363cb7cf
>> > >  ?
>> > >
>> > >  using this code to determine 7620 soc
>> > >
>> > >  if (rt == RT5390 && rt2x00_is_soc(rt2x00dev))
>> > >          rt = RT6352;
>> > >
>> > >  somehow did not work in rt2800_init_registers routine. i could
>> > > verify
>> > >  that by removing tx_sw_cfg registers from rt6352 and the wifi would
>> > >  still work, unless removed them from rt5390 also
>> >
>> > I tested by adding additional printk("Init RT6352 registers\n"); in
>> > if (rt2x00_rt(rt2x00dev, RT6352)) branch. The message was printed:
>> >
>> > [   68.049946] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 6352,
>> > rev 0500 detected
>> > [   68.065392] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 7620
>> > detected
>> > [   68.079777] ieee80211 phy0: Selected rate control algorithm
>> > 'minstrel_ht'
>> > [   68.177760] kmodloader: done loading kernel modules from
>> > /etc/modules.d/*
>> > [   68.825758] urandom_read: 5 callbacks suppressed
>> > [   68.825768] random: jshn: uninitialized urandom read (4 bytes read)
>> > [   77.792400] 8021q: adding VLAN 0 to HW filter on device eth0
>> > [   77.825045] br-lan: port 1(eth0.1) entered blocking state
>> > [   77.836032] br-lan: port 1(eth0.1) entered disabled state
>> > [   77.847156] device eth0.1 entered promiscuous mode
>> > [   77.856739] device eth0 entered promiscuous mode
>> > [   77.931043] br-lan: port 1(eth0.1) entered blocking state
>> > [   77.941861] br-lan: port 1(eth0.1) entered forwarding state
>> > [   77.953171] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
>> > [   78.849852] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes
>> > ready
>> > [   82.302306] Init RT6352 registers
>> >
>> > Perhaps rt2x00_is_soc(rt2x00dev) does not work on this particular
>> > system
>> > that you have and device is configured as RT5390 ? I.e. maybe this is
>> > PCIe device. This should be printed in :
>> >
>> > ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 6352, rev 0500
>> > detected
>> >
>> > line, you should have 'RT chipset 5390' instead.
>>
>> RT6352 is the pre-mediatek-merge name of MT7620A/N. It is always a SoC.
>> The RF part of both MT7620A and MT7620N identifies as RT5390. The
>> vendor driver also uses an equivalent check to destinguish between the
>> actual PCIe/USB RT5390xx and RT6352, see
>>
>> https://github.com/i80s/mtk-sources/blob/master/mt7620/src/include/rtmp_chip.h#L114
>
> Yes , but this does not explain why things do not work as
> expected for Tomislav, which IIUC use RT5390 configuration.
>
> Perhaps the check:
>
> 	if (rt == RT5390 && rt2x00_is_soc(rt2x00dev))
> 		rt = RT6352;
>
> should be some how modified to work on Tomislav's hardware ?
>
> Thanks
> Stanislaw
>

  reply	other threads:[~2018-10-10 14:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09 11:56 [PATCH v3 1/4] rt2x00: remove unneeded check Stanislaw Gruszka
2018-10-09 11:56 ` [PATCH v3 2/4] rt2x00: remove confusing AGC register Stanislaw Gruszka
2018-10-09 12:27   ` Daniel Golle
2018-10-09 12:47     ` Stanislaw Gruszka
2018-10-09 13:07       ` Daniel Golle
2018-10-09 13:23         ` Stanislaw Gruszka
2018-10-09 11:56 ` [PATCH v3 3/4] rt2x00: update TX_SW_CFG2 value Stanislaw Gruszka
2018-10-09 11:56 ` [PATCH v3 4/4] rt2800: fix registers init for MT7620 Stanislaw Gruszka
2018-10-09 23:27   ` Tom Psyborg
2018-10-10  7:14     ` Stanislaw Gruszka
2018-10-10 12:06       ` Daniel Golle
2018-10-10 12:45         ` Stanislaw Gruszka
2018-10-10 14:11           ` Tom Psyborg [this message]
2018-10-10 15:40             ` Stanislaw Gruszka
2018-10-10 20:03               ` Tom Psyborg
2018-10-11 10:05                 ` Stanislaw Gruszka
2018-10-11 12:39                   ` Tom Psyborg
2018-10-12  8:50                     ` Stanislaw Gruszka
2018-10-11 10:06 ` [PATCH v3 1/4] rt2x00: remove unneeded check 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=CAKR_QVJbtzpu6v4bZEz2UegWiAy1Ohooy-TciZcOeR_p+Z+yYg@mail.gmail.com \
    --to=pozega.tomislav@gmail.com \
    --cc=daniel@makrotopia.org \
    --cc=dev@kresin.me \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    --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.