2011-10-05 14:16:44

by Sangwook Lee

[permalink] [raw]
Subject: [PATCH] ath6kl:Fix execution address of OTP AR6003 HW2.0

Fix OTP execution address for AR6003 HW2.0

ath6kl: writing otp to 0x543180 (3689 B)
ath6kl: bmi LZ stream start: addr: 0x543180)
ath6kl: bmi send LZ data: len: 3688)
ath6kl: bmi send LZ data: len: 4)
ath6kl: bmi LZ stream start: addr: 0x0)
ath6kl: bmi read memory: device: addr: 0x54061c, len: 4
ath6kl: app_start_override_addr 0x0
ath6kl: executing OTP at 0x0
ath6kl: bmi execute: addr: 0x0, param: 0)
ath6kl: bmi_recv_buf FIFO empty
ath6kl: Unable to read from the device: -22

Signed-off-by: Sangwook Lee <[email protected]>
---
drivers/net/wireless/ath/ath6kl/init.c | 3 +++
drivers/net/wireless/ath/ath6kl/target.h | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index b277111..bfe802b 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1211,6 +1211,9 @@ static int ath6kl_upload_otp(struct ath6kl *ar)
return ret;
}

+ if (ar->version.target_ver == AR6003_REV2_VERSION)
+ address = AR6003_REV2_APP_START_OVERRIDE;
+
ar->hw.app_start_override_addr = address;

ath6kl_dbg(ATH6KL_DBG_BOOT, "app_start_override_addr 0x%x\n",
diff --git a/drivers/net/wireless/ath/ath6kl/target.h b/drivers/net/wireless/ath/ath6kl/target.h
index c9a7605..253c489 100644
--- a/drivers/net/wireless/ath/ath6kl/target.h
+++ b/drivers/net/wireless/ath/ath6kl/target.h
@@ -331,6 +331,7 @@ struct host_interest {
(((target_type) == TARGET_TYPE_AR6003) ? AR6003_VTOP(vaddr) : \
(((target_type) == TARGET_TYPE_AR6004) ? AR6004_VTOP(vaddr) : 0))

+#define AR6003_REV2_APP_START_OVERRIDE 0x944C00
#define AR6003_REV2_APP_LOAD_ADDRESS 0x543180
#define AR6003_REV2_BOARD_EXT_DATA_ADDRESS 0x57E500
#define AR6003_REV2_DATASET_PATCH_ADDRESS 0x57e884
--
1.7.4.1



2011-10-06 10:50:17

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath6kl:Fix execution address of OTP AR6003 HW2.0

On 10/05/2011 05:14 PM, Sangwook Lee wrote:
> Fix OTP execution address for AR6003 HW2.0
>
> ath6kl: writing otp to 0x543180 (3689 B)
> ath6kl: bmi LZ stream start: addr: 0x543180)
> ath6kl: bmi send LZ data: len: 3688)
> ath6kl: bmi send LZ data: len: 4)
> ath6kl: bmi LZ stream start: addr: 0x0)
> ath6kl: bmi read memory: device: addr: 0x54061c, len: 4
> ath6kl: app_start_override_addr 0x0
> ath6kl: executing OTP at 0x0
> ath6kl: bmi execute: addr: 0x0, param: 0)
> ath6kl: bmi_recv_buf FIFO empty
> ath6kl: Unable to read from the device: -22

Ah, now I understand. So this patch broke it:

commit 639d0b8996aa5913402b846932d57a51a23a40c9
Author: Kalle Valo <[email protected]>
Date: Mon Sep 12 12:48:09 2011 +0300

ath6kl: read firmware start address from hardware

It's actually possible to read the firmware start address from hardware,
that way there's no need to hardcode the address in hardware.


So the firmware start address detections doesn't actually work with hw
2.0, too bad.

Actually I would like to fix this a bit differently, can you please try
the attached patch? Compile tested only. If it works, please send me a
Tested-by tag.

BTW, do you still need to enable debug logs to get hw2.0 working properly?

Kalle


Attachments:
0001-ath6kl-fix-firmware-start-address-for-ar6003-hw2.0.patch (2.82 kB)

2011-10-06 11:03:02

by Sangwook Lee

[permalink] [raw]
Subject: Re: [PATCH] ath6kl:Fix execution address of OTP AR6003 HW2.0

Hi Kalle

On 6 October 2011 11:48, Kalle Valo <[email protected]> wrote:
> On 10/05/2011 05:14 PM, Sangwook Lee wrote:
>> Fix OTP execution address for AR6003 HW2.0
>>
>> ath6kl: writing otp to 0x543180 (3689 B)
>> ath6kl: bmi LZ stream start: addr: 0x543180)
>> ath6kl: bmi send LZ data: len: 3688)
>> ath6kl: bmi send LZ data: len: 4)
>> ath6kl: bmi LZ stream start: addr: 0x0)
>> ath6kl: bmi read memory: device: addr: 0x54061c, len: 4
>> ath6kl: app_start_override_addr 0x0
>> ath6kl: executing OTP at 0x0
>> ath6kl: bmi execute: addr: 0x0, param: 0)
>> ath6kl: bmi_recv_buf FIFO empty
>> ath6kl: Unable to read from the device: -22
>
> Ah, now I understand. So this patch broke it:
>
> commit 639d0b8996aa5913402b846932d57a51a23a40c9
> Author: Kalle Valo <[email protected]>
> Date: ? Mon Sep 12 12:48:09 2011 +0300
>
> ? ?ath6kl: read firmware start address from hardware
>
> ? ?It's actually possible to read the firmware start address from hardware,
> ? ?that way there's no need to hardcode the address in hardware.
>
>
> So the firmware start address detections doesn't actually work with hw
> 2.0, too bad.
>
> Actually I would like to fix this a bit differently, can you please try
> the attached patch? Compile tested only. If it works, please send me a
> Tested-by tag.

Yes I will do it.

>
> BTW, do you still need to enable debug logs to get hw2.0 working properly?
Yes, I still have to use debug but want to fix it now, so please let me debug
as based on your last advice and then report to you.

>
> Kalle
>

Sangwook