]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
wlcore/wl12xx: Fix fw logger over sdio
authorGuy Mishol <guym@ti.com>
Thu, 14 Apr 2016 08:58:17 +0000 (11:58 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 11 May 2016 18:26:15 +0000 (21:26 +0300)
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 <guym@ti.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ti/wl12xx/main.c
drivers/net/wireless/ti/wlcore/io.c
drivers/net/wireless/ti/wlcore/io.h

index 58b9d3c3a8332c5360b855deff5d9b00e874c8e3..22009e14a8fc1cb9b0ab4f5bb0c6adcb273a371a 100644 (file)
@@ -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
                },
        },
 
index 564ca750c5ee8895a702e9a9ea145e75391e02bf..1cc6d5ab042ea29cd628cad7511055a0bbfff54f 100644 (file)
@@ -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;
 }
index 10cf3747694d5bf46b865fc68a990b5b4c7c5a59..704ce646763812b45b6cd4477d4282d5820be7a5 100644 (file)
@@ -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