From patchwork Thu Apr 14 08:58:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guy Mishol X-Patchwork-Id: 8833001 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7AF0A9F3A0 for ; Thu, 14 Apr 2016 09:02:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CB47202F0 for ; Thu, 14 Apr 2016 09:02:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C87352034A for ; Thu, 14 Apr 2016 09:02:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754571AbcDNJCd (ORCPT ); Thu, 14 Apr 2016 05:02:33 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:33895 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753571AbcDNJCb (ORCPT ); Thu, 14 Apr 2016 05:02:31 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id u3E92UvK000945 for ; Thu, 14 Apr 2016 04:02:30 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3E92UQp007013 for ; Thu, 14 Apr 2016 04:02:30 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Thu, 14 Apr 2016 04:02:29 -0500 Received: from wlsrv.emea.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3E92TiW007253; Thu, 14 Apr 2016 04:02:29 -0500 From: Guy Mishol To: CC: Guy Mishol Subject: [PATCH] wlcore/wl12xx: Fix fw logger over sdio Date: Thu, 14 Apr 2016 11:58:17 +0300 Message-ID: <1460624297-28420-1-git-send-email-guym@ti.com> X-Mailer: git-send-email 2.7.2 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The commit fb724ed5c617 ("wlcore: Fix regression in wlcore_set_partition()") fixed wl12xx functionality. However, it reverted the support in fw logger over sdio in wl18xx. This patch reverts the changes made and also fixes the original functionality issue introduced in wl12xx. Fixes: fb724ed5c617 ("wlcore: Fix regression in wlcore_set_partition()") Signed-off-by: Guy Mishol --- drivers/net/wireless/ti/wl12xx/main.c | 4 ++-- drivers/net/wireless/ti/wlcore/io.c | 17 ++++++++++++++--- drivers/net/wireless/ti/wlcore/io.h | 3 ++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c index a0d6ccc..2a52e894 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c @@ -553,8 +553,8 @@ static struct wlcore_partition_set wl12xx_ptable[PART_TABLE_LEN] = { .size = 0x00000004 }, .mem3 = { - .start = 0x00040404, - .size = 0x00000000 + .start = 0x00000000, + .size = 0x00040404 }, }, diff --git a/drivers/net/wireless/ti/wlcore/io.c b/drivers/net/wireless/ti/wlcore/io.c index 564ca75..1cc6d5a 100644 --- a/drivers/net/wireless/ti/wlcore/io.c +++ b/drivers/net/wireless/ti/wlcore/io.c @@ -175,14 +175,25 @@ int wlcore_set_partition(struct wl1271 *wl, if (ret < 0) goto out; - /* We don't need the size of the last partition, as it is - * automatically calculated based on the total memory size and - * the sizes of the previous partitions. + /* wl12xx only: We don't need the size of the last partition, + * as it is automatically calculated based on the total memory + * size and the sizes of the previous partitions. + * + * wl18xx re-defines the HW_PART3 addresses for logger over + * SDIO support. wl12xx is expecting the write to + * HW_PART3_START_ADDR at offset 24. This creates conflict + * between the addresses. + * In order to fix this the expected value is written to + * HW_PART3_SIZE_ADDR instead which is at offset 24 after changes. */ ret = wlcore_raw_write32(wl, HW_PART3_START_ADDR, p->mem3.start); if (ret < 0) goto out; + ret = wlcore_raw_write32(wl, HW_PART3_SIZE_ADDR, p->mem3.size); + if (ret < 0) + goto out; + out: return ret; } diff --git a/drivers/net/wireless/ti/wlcore/io.h b/drivers/net/wireless/ti/wlcore/io.h index 10cf374..704ce64 100644 --- a/drivers/net/wireless/ti/wlcore/io.h +++ b/drivers/net/wireless/ti/wlcore/io.h @@ -36,7 +36,8 @@ #define HW_PART1_START_ADDR (HW_PARTITION_REGISTERS_ADDR + 12) #define HW_PART2_SIZE_ADDR (HW_PARTITION_REGISTERS_ADDR + 16) #define HW_PART2_START_ADDR (HW_PARTITION_REGISTERS_ADDR + 20) -#define HW_PART3_START_ADDR (HW_PARTITION_REGISTERS_ADDR + 24) +#define HW_PART3_SIZE_ADDR (HW_PARTITION_REGISTERS_ADDR + 24) +#define HW_PART3_START_ADDR (HW_PARTITION_REGISTERS_ADDR + 28) #define HW_ACCESS_REGISTER_SIZE 4