All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: Christian Lamparter <chunkeey@web.de>
Cc: Luis Rodriguez <Luis.Rodriguez@Atheros.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"jal2@gmx.de" <jal2@gmx.de>,
	Peter Grabienski <Peter.Grabienski@Atheros.com>,
	Stephen Chen <Stephen.Chen@Atheros.com>,
	Michael Fortin <Michael.Fortin@Atheros.com>,
	Johnny Cheng <Johnny.Cheng@Atheros.com>,
	Yuan-Gu Wei <Yuan-Gu.Wei@Atheros.com>,
	"otus-devel@lists.madwifi-project.org"
	<otus-devel@lists.madwifi-project.org>
Subject: Re: [RFT 1/2] ar9170: add initial support for 1-stage firmware
Date: Thu, 28 May 2009 12:26:01 -0700	[thread overview]
Message-ID: <20090528192601.GD20870@tesla> (raw)
In-Reply-To: <200905281803.44198.chunkeey@web.de>

On Thu, May 28, 2009 at 09:03:43AM -0700, Christian Lamparter wrote:
> On Thursday 28 May 2009 03:48:45 Luis R. Rodriguez wrote:
> > You can get the stage 1 firmware from here:
> >
> > http://www.kernel.org/pub/linux/kernel/people/mcgrof/firmware/ar9170/ar9170.fw
> >
> > Its license:
> >
> > http://www.kernel.org/pub/linux/kernel/people/mcgrof/firmware/ar9170/LICENSE
> >
> > It seems with some devices this works, with some others
> > I see only scan working. We shall not push this firmware
> > into the linux-firmware tree until these issues have been
> > resolved.
> >
> > Cc: Peter Grabienski <Peter.Grabienski@Atheros.com>
> > Cc: Stephen Chen <Stephen.Chen@Atheros.com>
> > Cc: Michael Fortin <Michael.Fortin@Atheros.com>
> > Cc: Johnny Cheng <Johnny.Cheng@Atheros.com>
> > Cc: Yuan-Gu Wei <Yuan-Gu.Wei@atheros.com>
> > Cc: Joerg Albert <jal2@gmx.de>
> > Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> > ---
> >  drivers/net/wireless/ath/ar9170/phy.c |   13 ++++++++++---
> >  drivers/net/wireless/ath/ar9170/usb.c |   22 +++++++++++++++++-----
> >  2 files changed, 27 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ath/ar9170/phy.c b/drivers/net/wireless/ath/ar9170/phy.c
> > index 6ce2075..0675dc8 100644
> > --- a/drivers/net/wireless/ath/ar9170/phy.c
> > +++ b/drivers/net/wireless/ath/ar9170/phy.c
> > @@ -39,6 +39,7 @@
> >  #include <linux/bitrev.h>
> >  #include "ar9170.h"
> >  #include "cmd.h"
> > +#include "usb.h"
> >
> >  static int ar9170_init_power_cal(struct ar9170 *ar)
> >  {
> > @@ -996,6 +997,10 @@ static int ar9170_set_power_cal(struct ar9170 *ar, u32 freq, enum ar9170_bw bw)
> >       int idx, i, n;
> >       u8 ackpower, ackchains, f;
> >       u8 pwr_freqs[AR5416_MAX_NUM_TGT_PWRS];
> > +     struct ar9170_usb *aru;
> > +
> > +     /* All ar9170 devices are USB */
> > +     aru = container_of(ar, struct ar9170_usb, common);
> >
> >       if (freq < 3000)
> >               f = freq - 2300;
> > @@ -1102,9 +1107,11 @@ static int ar9170_set_power_cal(struct ar9170 *ar, u32 freq, enum ar9170_bw bw)
> >       else
> >               ackpower = ar->power_5G_leg[0] & 0x3f;
> >
> > -     ar9170_regwrite(0x1c3694, ackpower << 20 | ackchains << 26);
> > -     ar9170_regwrite(0x1c3bb4, ackpower << 5 | ackchains << 11 |
> > -                               ackpower << 21 | ackchains << 27);
> > +     if (aru->init_values)  {
> > +             ar9170_regwrite(0x1c3694, ackpower << 20 | ackchains << 26);
> > +             ar9170_regwrite(0x1c3bb4, ackpower << 5 | ackchains << 11 |
> > +                                       ackpower << 21 | ackchains << 27);
> > +     }
> >
> >       ar9170_regwrite_finish();
> >       return ar9170_regwrite_result();
> I guess you can drop this changes. see hpmain.c line 4039, 4061, 4069
> 
> --> #if_N_def ZM_OTUS_LINUX_PHASE_2 <--
> zfDelayWriteInternalReg(dev, 0x1c3694, ((hpPriv->tPow2x2g[0]&0x3f) << 20) | (0x5<<26));
> zfDelayWriteInternalReg(dev, 0x1c3bb4, ((hpPriv->tPow2x2g[0]&0x3f) << 5 ) | (0x5<<11) |
>                                            ((hpPriv->tPow2x2g[0]&0x3f) << 21) | (0x5<<27)  );
> #endif
> so, the current ar9170 code is actually _wrong_ (but works!)...
> and we should not touch these fields with the 2-stage firmware.

Oh, hm, yeah good catch, but to match would actually need to call it
when stage-1 firmware is used.

> OT: since the firmware will (inevitably end up in the firmware-git-tree)
> we should convert it to ihex, so it can be downloaded with the git-web.
> (this can be done by: objcopy -I binary -O ihex ar9170.fw ar9170.fw.ihex )

Sure, whatever works best. If you download it from gitweb you then
have to do the conversion back though.

> And for future: it might be a good idea to add a little header/tail on the
> firmware files. e.g.:
>         - firmware version and variant (e.g. 1-stage or 2-stage firmware)
>         - supported hardware variants/interfaces
>         - maybe API revision / feature bitmap
>         - maybe more: e.g: vendor string / build / build-date / build no. etc.

I think some version strings exist, but yeah you're right.

  Luis

  reply	other threads:[~2009-05-28 19:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28  1:48 [RFT 0/2] ar9170: initial stage 1 firmware support / AVM fritz Luis R. Rodriguez
2009-05-28  1:48 ` [RFT 1/2] ar9170: add initial support for 1-stage firmware Luis R. Rodriguez
2009-05-28 16:03   ` Christian Lamparter
2009-05-28 19:26     ` Luis R. Rodriguez [this message]
2009-05-28 21:16       ` [otus-devel] " Luis R. Rodriguez
2009-05-28  1:48 ` [RFT 2/2] ar9170: add AVM FRITZ devices Luis R. Rodriguez
2009-05-28  7:17   ` Marcel Holtmann
2009-05-28 15:22     ` Pavel Roskin
2009-05-28 19:29       ` Luis R. Rodriguez

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=20090528192601.GD20870@tesla \
    --to=lrodriguez@atheros.com \
    --cc=Johnny.Cheng@Atheros.com \
    --cc=Luis.Rodriguez@Atheros.com \
    --cc=Michael.Fortin@Atheros.com \
    --cc=Peter.Grabienski@Atheros.com \
    --cc=Stephen.Chen@Atheros.com \
    --cc=Yuan-Gu.Wei@Atheros.com \
    --cc=chunkeey@web.de \
    --cc=jal2@gmx.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=otus-devel@lists.madwifi-project.org \
    /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.