From patchwork Thu Oct 6 13:09:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sangwook X-Patchwork-Id: 4552 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 17F6023EFA for ; Thu, 6 Oct 2011 13:11:37 +0000 (UTC) Received: from mail-gx0-f180.google.com (mail-gx0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id CEF00A18D4F for ; Thu, 6 Oct 2011 13:11:36 +0000 (UTC) Received: by ggni2 with SMTP id i2so2559019ggn.11 for ; Thu, 06 Oct 2011 06:11:36 -0700 (PDT) Received: by 10.223.5.3 with SMTP id 3mr3522306fat.4.1317906695949; Thu, 06 Oct 2011 06:11:35 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.23.170 with SMTP id n10cs128262laf; Thu, 6 Oct 2011 06:11:35 -0700 (PDT) Received: by 10.236.156.33 with SMTP id l21mr3078402yhk.24.1317906694299; Thu, 06 Oct 2011 06:11:34 -0700 (PDT) Received: from mail-gy0-f178.google.com (mail-gy0-f178.google.com [209.85.160.178]) by mx.google.com with ESMTPS id b70si4365105yhn.74.2011.10.06.06.11.33 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Oct 2011 06:11:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.178 is neither permitted nor denied by best guess record for domain of sangwook.lee@linaro.org) client-ip=209.85.160.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.178 is neither permitted nor denied by best guess record for domain of sangwook.lee@linaro.org) smtp.mail=sangwook.lee@linaro.org Received: by gyf1 with SMTP id 1so2998141gyf.37 for ; Thu, 06 Oct 2011 06:11:33 -0700 (PDT) Received: by 10.236.129.228 with SMTP id h64mr2994887yhi.101.1317906693553; Thu, 06 Oct 2011 06:11:33 -0700 (PDT) Received: from localhost.localdomain (host109-149-107-208.range109-149.btcentralplus.com. [109.149.107.208]) by mx.google.com with ESMTPS id w16sm14716694anl.2.2011.10.06.06.11.31 (version=SSLv3 cipher=OTHER); Thu, 06 Oct 2011 06:11:32 -0700 (PDT) From: Sangwook Lee To: kvalo@qca.qualcomm.com Cc: linux-wireless@vger.kernel.orgs Subject: [PATCH] ath6kl: fix firmware start address for ar6003 hw2.0 Date: Thu, 6 Oct 2011 14:09:26 +0100 Message-Id: <1317906566-31089-1-git-send-email-sangwook.lee@linaro.org> X-Mailer: git-send-email 1.7.4.1 From: Kalle Valo Sangwook found out that commit 639d0b89 ("ath6kl: read firmware start address from hardware") broke firmware boot on ar6003 hw2.0 as it seems it's not posible to automatically query the address from hardware. So we need to hardcode the address for hw2.0. Reported-by: Sangwook Lee Tested-by: Sangwook Lee Signed-off-by: Kalle Valo --- Kalle: I slightly changed again. without running ath6kl_bmi_read() before, ath6kl_bmi_execute() failed with hw2.0 board, but I am not clear about this reason. drivers/net/wireless/ath/ath6kl/init.c | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index b277111..07a6a44 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c @@ -1183,6 +1183,7 @@ static int ath6kl_upload_board_file(struct ath6kl *ar) static int ath6kl_upload_otp(struct ath6kl *ar) { u32 address, param; + bool from_hw = false; int ret; if (WARN_ON(ar->fw_otp == NULL)) @@ -1201,25 +1202,28 @@ static int ath6kl_upload_otp(struct ath6kl *ar) } /* read firmware start address */ - ret = ath6kl_bmi_read(ar, - ath6kl_get_hi_item_addr(ar, - HI_ITEM(hi_app_start)), - (u8 *) &address, sizeof(address)); + ret = ath6kl_bmi_read(ar, ath6kl_get_hi_item_addr(ar, + HI_ITEM(hi_app_start)), (u8 *) &address, sizeof(address)); if (ret) { ath6kl_err("Failed to read hi_app_start: %d\n", ret); return ret; } - ar->hw.app_start_override_addr = address; + if (ar->hw.app_start_override_addr == 0) { + ar->hw.app_start_override_addr = address; + from_hw = true; + } - ath6kl_dbg(ATH6KL_DBG_BOOT, "app_start_override_addr 0x%x\n", + ath6kl_dbg(ATH6KL_DBG_BOOT, "app_start_override_addr%s 0x%x\n", + from_hw ? " (from hw)" : "", ar->hw.app_start_override_addr); /* execute the OTP code */ - ath6kl_dbg(ATH6KL_DBG_BOOT, "executing OTP at 0x%x\n", address); + ath6kl_dbg(ATH6KL_DBG_BOOT, "executing OTP at 0x%x\n", + ar->hw.app_start_override_addr); param = 0; - ath6kl_bmi_execute(ar, address, ¶m); + ath6kl_bmi_execute(ar, ar->hw.app_start_override_addr, ¶m); return ret; } @@ -1421,6 +1425,10 @@ static int ath6kl_init_hw_params(struct ath6kl *ar) ar->hw.app_load_addr = AR6003_REV2_APP_LOAD_ADDRESS; ar->hw.board_ext_data_addr = AR6003_REV2_BOARD_EXT_DATA_ADDRESS; ar->hw.reserved_ram_size = AR6003_REV2_RAM_RESERVE_SIZE; + + /* hw2.0 needs override address hardcoded */ + ar->hw.app_start_override_addr = 0x944C00; + break; case AR6003_REV3_VERSION: ar->hw.dataset_patch_addr = AR6003_REV3_DATASET_PATCH_ADDRESS;