All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Chan" <mchan@broadcom.com>
To: "David Miller" <davem@davemloft.net>
Cc: "waldi@debian.org" <waldi@debian.org>,
	"ben@decadent.org.uk" <ben@decadent.org.uk>,
	"davem@davemloft.org" <davem@davemloft.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] bnx2: Use request_firmware()
Date: Mon, 23 Mar 2009 14:47:59 -0700	[thread overview]
Message-ID: <1237844879.18617.20.camel@HP1> (raw)
In-Reply-To: <20090320.155030.164080684.davem@davemloft.net>


On Fri, 2009-03-20 at 15:50 -0700, David Miller wrote:
> From: Bastian Blank <waldi@debian.org>
> Date: Fri, 20 Mar 2009 00:25:41 +0100
> 
> > On Thu, Mar 19, 2009 at 04:04:44PM -0700, Michael Chan wrote:
> > > Thanks Ben and Bastian.  I will review this and test it out.  I think I
> > > will add some logic to check firmware versions to guarantee some level
> > > of compatibility.
> > 
> > The firmware version is coded into the filenames.
> 
> Michael and co. please do not make such a big deal about
> this.
> 
> This patch is perfectly fine as-is.
> 

Yes, the patch looks good.  I just noticed one problem while reviewing.
The following logic to let the firmware know about the host CPU's page
size is missing and I'll need to add it back.  Otherwise it will only
work on CPUs with 4K page size.

+static int
+load_rv2p_fw(struct bnx2 *bp, u32 rv2p_proc,
+            const struct bnx2_fw_file_section *fw_section)
+{
+       u32 rv2p_code_len, file_offset;
+       __be32 *rv2p_code;
        int i;
        u32 val;
 
-       if (rv2p_proc == RV2P_PROC2 && CHIP_NUM(bp) == CHIP_NUM_5709) {
-               val = le32_to_cpu(rv2p_code[XI_RV2P_PROC2_MAX_BD_PAGE_LOC]);
-               val &= ~XI_RV2P_PROC2_BD_PAGE_SIZE_MSK;
-               val |= XI_RV2P_PROC2_BD_PAGE_SIZE;
-               rv2p_code[XI_RV2P_PROC2_MAX_BD_PAGE_LOC] = cpu_to_le32(val);
-       }
+       rv2p_code_len = be32_to_cpu(fw_section->len);
+       file_offset = be32_to_cpu(fw_section->offset);
+
+       rv2p_code = (__be32 *)(bp->firmware->data + file_offset);


I'd also like to add the version information to the bnx2_fw_file_entry
struct instead of embedding it in the file name.  It is more flexible
this way as each section can have different versions and can be updated
separately.  So it will look something like:

struct bnx2_fw_file_entry {
	__be32 start_addr;
	__be32 version;
	struct bnx2_fw_file_section text;
	struct bnx2_fw_file_section data;
	struct bnx2_fw_file_section sbss;
	struct bnx2_fw_file_section bss;
	struct bnx2_fw_file_section rodata;
};


I'll generate an incremental patch on top of this one for review.
Thanks.

 



  reply	other threads:[~2009-03-23 22:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19 22:29 [PATCH] bnx2: Use request_firmware() Ben Hutchings
2009-03-19 23:04 ` Michael Chan
2009-03-19 23:25   ` Bastian Blank
2009-03-20 22:50     ` David Miller
2009-03-23 21:47       ` Michael Chan [this message]
2009-03-23 22:02         ` David Miller
2009-03-23 22:29         ` Bastian Blank
2009-03-23 23:24           ` Michael Chan
2009-03-24  0:14             ` Rick Jones
2009-03-24  1:11               ` Michael Chan
2009-03-24  1:26                 ` Rick Jones
2009-03-24  1:44                   ` Michael Chan
2009-03-24  4:27                   ` Ben Hutchings
2009-03-24  7:42                 ` Bastian Blank
2009-03-24 15:27                   ` Michael Chan
2009-03-23 22:32         ` Bastian Blank
2009-03-23 23:28           ` Michael Chan
2009-04-01 18:01             ` Michael Chan
2009-04-02  8:05               ` David Miller
     [not found] <1238778120-8132-1-git-send-email-mchan@broadcom.com>
2009-04-04 23:51 ` David Miller

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=1237844879.18617.20.camel@HP1 \
    --to=mchan@broadcom.com \
    --cc=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=davem@davemloft.org \
    --cc=netdev@vger.kernel.org \
    --cc=waldi@debian.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.