From patchwork Fri Apr 1 04:40:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anirban Chakraborty X-Patchwork-Id: 89181 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 091BFB6F81 for ; Fri, 1 Apr 2011 15:41:20 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752426Ab1DAElP (ORCPT ); Fri, 1 Apr 2011 00:41:15 -0400 Received: from ch1outboundpool.messaging.microsoft.com ([216.32.181.182]:29250 "EHLO ch1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751942Ab1DAElP convert rfc822-to-8bit (ORCPT ); Fri, 1 Apr 2011 00:41:15 -0400 Received: from mail191-ch1-R.bigfish.com (216.32.181.173) by CH1EHSOBE013.bigfish.com (10.43.70.63) with Microsoft SMTP Server id 14.1.225.8; Fri, 1 Apr 2011 04:41:13 +0000 Received: from mail191-ch1 (localhost.localdomain [127.0.0.1]) by mail191-ch1-R.bigfish.com (Postfix) with ESMTP id 2165613A0230; Fri, 1 Apr 2011 04:41:14 +0000 (UTC) X-SpamScore: 11 X-BigFish: VPS11(zzzz1202hzz8275bhz2ei2a8h637h668h839h1a1r61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:avexcashub1.qlogic.com; RD:avexcashub2.qlogic.com; EFVD:NLI Received: from mail191-ch1 (localhost.localdomain [127.0.0.1]) by mail191-ch1 (MessageSwitch) id 1301632873746708_8127; Fri, 1 Apr 2011 04:41:13 +0000 (UTC) Received: from CH1EHSMHS033.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.251]) by mail191-ch1.bigfish.com (Postfix) with ESMTP id A9638E10051; Fri, 1 Apr 2011 04:41:13 +0000 (UTC) Received: from avexcashub1.qlogic.com (198.70.193.64) by CH1EHSMHS033.bigfish.com (10.43.70.33) with Microsoft SMTP Server (TLS) id 14.1.225.8; Fri, 1 Apr 2011 04:41:13 +0000 Received: from n5102mn2hhgf91.qlogic.org (10.1.7.24) by avexcashub2.qlogic.org (10.1.4.162) with Microsoft SMTP Server (TLS) id 8.1.436.0; Thu, 31 Mar 2011 21:41:12 -0700 Date: Thu, 31 Mar 2011 21:40:16 -0700 From: Anirban Chakraborty X-X-Sender: anirban@n5102mn2hhgf91.qlogic.org To: David Miller , "netdev@vger.kernel.org" CC: Dept_NX_Linux_NIC_Driver Subject: [PATCH 7/9 net-next-2.6] qlcnic: Use flt method to determine flash fw region Message-ID: User-Agent: Alpine 2.00 (OSX 1167 2008-08-23) MIME-Version: 1.0 X-OriginatorOrg: qlogic.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sritej Velaga Use flash layout table to get flash fw starting address and its size. If that fails, use legacy method. Signed-off-by: Sritej Velaga Signed-off-by: Anirban Chakraborty --- drivers/net/qlcnic/qlcnic.h | 3 ++- drivers/net/qlcnic/qlcnic_init.c | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) -- 1.7.4.1 This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index 9d2e630..d9dd2c4 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h @@ -292,6 +292,7 @@ struct uni_data_desc{ /* Flash Defines and Structures */ #define QLCNIC_FLT_LOCATION 0x3F1000 #define QLCNIC_FW_IMAGE_REGION 0x74 +#define QLCNIC_BOOTLD_REGION 0X72 struct qlcnic_flt_header { u16 version; u16 len; @@ -306,7 +307,7 @@ struct qlcnic_flt_entry { u8 reserved1; u32 size; u32 start_addr; - u32 end_add; + u32 end_addr; }; /* Magic number to let user know flash is programmed */ diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c index 74ec96d..4ec0eeb 100644 --- a/drivers/net/qlcnic/qlcnic_init.c +++ b/drivers/net/qlcnic/qlcnic_init.c @@ -1130,9 +1130,20 @@ qlcnic_load_firmware(struct qlcnic_adapter *adapter) } else { u64 data; u32 hi, lo; - - size = (QLCNIC_IMAGE_START - QLCNIC_BOOTLD_START) / 8; - flashaddr = QLCNIC_BOOTLD_START; + int ret; + struct qlcnic_flt_entry bootld_entry; + + ret = qlcnic_get_flt_entry(adapter, QLCNIC_BOOTLD_REGION, + &bootld_entry); + if (!ret) { + size = bootld_entry.size / 8; + flashaddr = bootld_entry.start_addr; + } else { + size = (QLCNIC_IMAGE_START - QLCNIC_BOOTLD_START) / 8; + flashaddr = QLCNIC_BOOTLD_START; + dev_info(&pdev->dev, + "using legacy method to get flash fw region"); + } for (i = 0; i < size; i++) { if (qlcnic_rom_fast_read(adapter,