Linux wireless drivers development
 help / color / mirror / Atom feed
From: Luciano Coelho <coelho@ti.com>
To: Ido Yariv <ido@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/5] wl12xx: Clean up and fix the 128x boot sequence
Date: Fri, 01 Apr 2011 13:43:31 +0300	[thread overview]
Message-ID: <1301654611.1988.475.camel@cumari> (raw)
In-Reply-To: <1301558821-17787-2-git-send-email-ido@wizery.com>

On Thu, 2011-03-31 at 10:06 +0200, Ido Yariv wrote:
> Clean up the boot sequence code & fix the following issues:
> 1. Always read the registers' values and set the relevant bits instead of
>    zeroing all other bits
> 2. Handle cases where wl1271_top_reg_read returns an error
> 3. Verify that the HW can detect the selected clock source
> 4. Remove 128x PG10 initialization code
> 5. Configure the MCS PLL to work in HP mode
> 
> Signed-off-by: Ido Yariv <ido@wizery.com>
> ---

This looks nice! Much easier to read now.  I checked it with the version
of the system initialization procedures that I got and it looks correct.
Except for some extra register reads in the two validation functions.  I
think I don't have the latest version of the initialization document,
since you mentioned to Shahar that in the one you have those registers
are read.

Anyway, this is fine, as you mentioned, reading the registers shouldn't
cause any problems here.

Reviewed-by: Luciano Coelho <coelho@ti.com>

And applied, thanks!

A couple of small comments below...


> +	/* Mask bits [2] & [8:4] in the sys_clk_cfg register */
> +	spare_reg = wl1271_top_reg_read(wl, WL_SPARE_REG);
> +	if (spare_reg == 0xFFFF)
> +		return -EFAULT;
> +	spare_reg |= (BIT(3) | BIT(5) | BIT(6));
> +	wl1271_top_reg_write(wl, WL_SPARE_REG, spare_reg);

The comments of masking bits 2 and 8-4 is quite cryptic here.  You
actually set bits 3, 5 and 6, so from the driver point of view the
comment doesn't make much sense.  Since it's in the initialization
document, I guess it's something the firmware does internally.  This
should be removed, but I'll keep it for now.


> +	/* Mask bits [3:1] in the sys_clk_cfg register */
> +	spare_reg = wl1271_top_reg_read(wl, WL_SPARE_REG);
> +	if (spare_reg == 0xFFFF)
> +		return -EFAULT;
> +	spare_reg |= BIT(2);
> +	wl1271_top_reg_write(wl, WL_SPARE_REG, spare_reg);

Same here, the comment is quite cryptic.  Also, the "sys_clk_cfg
register" is wrong, it should be in the "spare register".  In any case,
let's keep this comment for now, since it's a good way to map what is
going on with the system documentation.  Let's remove them later (maybe
a patch to remove all such information that is still spread around the
driver?).


> +	/* Set the input frequency according to the selected clock source */
> +	input_freq = (clk & 1) + 1;

Nice trick! :) Maybe some comments about what actually happens here
would have been nice, though.


-- 
Cheers,
Luca.


  reply	other threads:[~2011-04-01 10:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-31  8:06 [PATCH 0/5] wl12xx: Cleanups & fixes Ido Yariv
2011-03-31  8:06 ` [PATCH 1/5] wl12xx: Clean up and fix the 128x boot sequence Ido Yariv
2011-04-01 10:43   ` Luciano Coelho [this message]
2011-03-31  8:06 ` [PATCH 2/5] wl12xx: Clean up the block size alignment code Ido Yariv
2011-04-01 11:23   ` Luciano Coelho
2011-03-31  8:06 ` [PATCH 3/5] wl12xx: Clean up the dummy packet mechanism Ido Yariv
2011-03-31  8:07 ` [PATCH 4/5] wl12xx: Simplify TX blocks accounting Ido Yariv
2011-03-31  8:07 ` [PATCH 5/5] wl12xx: Handle platforms without level trigger interrupts Ido Yariv
2011-04-01 11:30 ` [PATCH 0/5] wl12xx: Cleanups & fixes Luciano Coelho

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=1301654611.1988.475.camel@cumari \
    --to=coelho@ti.com \
    --cc=ido@wizery.com \
    --cc=linux-wireless@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox