Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of wl1271 |
| 3 | * |
Luciano Coelho | 2f826f5 | 2010-03-26 12:53:21 +0200 | [diff] [blame] | 4 | * Copyright (C) 2008-2010 Nokia Corporation |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 5 | * |
| 6 | * Contact: Luciano Coelho <luciano.coelho@nokia.com> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License |
| 10 | * version 2 as published by the Free Software Foundation. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 20 | * 02110-1301 USA |
| 21 | * |
| 22 | */ |
| 23 | |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 24 | #include <linux/slab.h> |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 25 | |
Shahar Levi | 00d2010 | 2010-11-08 11:20:10 +0000 | [diff] [blame] | 26 | #include "acx.h" |
| 27 | #include "reg.h" |
| 28 | #include "boot.h" |
| 29 | #include "io.h" |
| 30 | #include "event.h" |
Arik Nemtsov | ae113b5 | 2010-10-16 18:45:07 +0200 | [diff] [blame] | 31 | #include "rx.h" |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 32 | |
| 33 | static struct wl1271_partition_set part_table[PART_TABLE_LEN] = { |
| 34 | [PART_DOWN] = { |
| 35 | .mem = { |
| 36 | .start = 0x00000000, |
| 37 | .size = 0x000177c0 |
| 38 | }, |
| 39 | .reg = { |
| 40 | .start = REGISTERS_BASE, |
| 41 | .size = 0x00008800 |
| 42 | }, |
Juuso Oikarinen | 451de97 | 2009-10-12 15:08:46 +0300 | [diff] [blame] | 43 | .mem2 = { |
| 44 | .start = 0x00000000, |
| 45 | .size = 0x00000000 |
| 46 | }, |
| 47 | .mem3 = { |
| 48 | .start = 0x00000000, |
| 49 | .size = 0x00000000 |
| 50 | }, |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 51 | }, |
| 52 | |
| 53 | [PART_WORK] = { |
| 54 | .mem = { |
| 55 | .start = 0x00040000, |
| 56 | .size = 0x00014fc0 |
| 57 | }, |
| 58 | .reg = { |
| 59 | .start = REGISTERS_BASE, |
Juuso Oikarinen | 451de97 | 2009-10-12 15:08:46 +0300 | [diff] [blame] | 60 | .size = 0x0000a000 |
| 61 | }, |
| 62 | .mem2 = { |
| 63 | .start = 0x003004f8, |
| 64 | .size = 0x00000004 |
| 65 | }, |
| 66 | .mem3 = { |
| 67 | .start = 0x00040404, |
| 68 | .size = 0x00000000 |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 69 | }, |
| 70 | }, |
| 71 | |
| 72 | [PART_DRPW] = { |
| 73 | .mem = { |
| 74 | .start = 0x00040000, |
| 75 | .size = 0x00014fc0 |
| 76 | }, |
| 77 | .reg = { |
| 78 | .start = DRPW_BASE, |
| 79 | .size = 0x00006000 |
Juuso Oikarinen | 451de97 | 2009-10-12 15:08:46 +0300 | [diff] [blame] | 80 | }, |
| 81 | .mem2 = { |
| 82 | .start = 0x00000000, |
| 83 | .size = 0x00000000 |
| 84 | }, |
| 85 | .mem3 = { |
| 86 | .start = 0x00000000, |
| 87 | .size = 0x00000000 |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 88 | } |
| 89 | } |
| 90 | }; |
| 91 | |
| 92 | static void wl1271_boot_set_ecpu_ctrl(struct wl1271 *wl, u32 flag) |
| 93 | { |
| 94 | u32 cpu_ctrl; |
| 95 | |
| 96 | /* 10.5.0 run the firmware (I) */ |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 97 | cpu_ctrl = wl1271_read32(wl, ACX_REG_ECPU_CONTROL); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 98 | |
| 99 | /* 10.5.1 run the firmware (II) */ |
| 100 | cpu_ctrl |= flag; |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 101 | wl1271_write32(wl, ACX_REG_ECPU_CONTROL, cpu_ctrl); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 102 | } |
| 103 | |
Levi, Shahar | 4b7fac7 | 2011-01-23 07:27:22 +0100 | [diff] [blame] | 104 | static void wl1271_parse_fw_ver(struct wl1271 *wl) |
| 105 | { |
| 106 | int ret; |
| 107 | |
| 108 | ret = sscanf(wl->chip.fw_ver_str + 4, "%u.%u.%u.%u.%u", |
| 109 | &wl->chip.fw_ver[0], &wl->chip.fw_ver[1], |
| 110 | &wl->chip.fw_ver[2], &wl->chip.fw_ver[3], |
| 111 | &wl->chip.fw_ver[4]); |
| 112 | |
| 113 | if (ret != 5) { |
| 114 | wl1271_warning("fw version incorrect value"); |
| 115 | memset(wl->chip.fw_ver, 0, sizeof(wl->chip.fw_ver)); |
| 116 | return; |
| 117 | } |
| 118 | } |
| 119 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 120 | static void wl1271_boot_fw_version(struct wl1271 *wl) |
| 121 | { |
| 122 | struct wl1271_static_data static_data; |
| 123 | |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 124 | wl1271_read(wl, wl->cmd_box_addr, &static_data, sizeof(static_data), |
| 125 | false); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 126 | |
Levi, Shahar | 4b7fac7 | 2011-01-23 07:27:22 +0100 | [diff] [blame] | 127 | strncpy(wl->chip.fw_ver_str, static_data.fw_version, |
| 128 | sizeof(wl->chip.fw_ver_str)); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 129 | |
| 130 | /* make sure the string is NULL-terminated */ |
Levi, Shahar | 4b7fac7 | 2011-01-23 07:27:22 +0100 | [diff] [blame] | 131 | wl->chip.fw_ver_str[sizeof(wl->chip.fw_ver_str) - 1] = '\0'; |
| 132 | |
| 133 | wl1271_parse_fw_ver(wl); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf, |
| 137 | size_t fw_data_len, u32 dest) |
| 138 | { |
Juuso Oikarinen | 451de97 | 2009-10-12 15:08:46 +0300 | [diff] [blame] | 139 | struct wl1271_partition_set partition; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 140 | int addr, chunk_num, partition_limit; |
Juuso Oikarinen | 1fba497 | 2009-10-08 21:56:32 +0300 | [diff] [blame] | 141 | u8 *p, *chunk; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 142 | |
| 143 | /* whal_FwCtrl_LoadFwImageSm() */ |
| 144 | |
| 145 | wl1271_debug(DEBUG_BOOT, "starting firmware upload"); |
| 146 | |
Luciano Coelho | 73d0a13 | 2009-08-11 11:58:27 +0300 | [diff] [blame] | 147 | wl1271_debug(DEBUG_BOOT, "fw_data_len %zd chunk_size %d", |
| 148 | fw_data_len, CHUNK_SIZE); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 149 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 150 | if ((fw_data_len % 4) != 0) { |
| 151 | wl1271_error("firmware length not multiple of four"); |
| 152 | return -EIO; |
| 153 | } |
| 154 | |
Juuso Oikarinen | 1fba497 | 2009-10-08 21:56:32 +0300 | [diff] [blame] | 155 | chunk = kmalloc(CHUNK_SIZE, GFP_KERNEL); |
Juuso Oikarinen | ed317788 | 2009-10-13 12:47:57 +0300 | [diff] [blame] | 156 | if (!chunk) { |
Juuso Oikarinen | 1fba497 | 2009-10-08 21:56:32 +0300 | [diff] [blame] | 157 | wl1271_error("allocation for firmware upload chunk failed"); |
| 158 | return -ENOMEM; |
| 159 | } |
| 160 | |
Juuso Oikarinen | 451de97 | 2009-10-12 15:08:46 +0300 | [diff] [blame] | 161 | memcpy(&partition, &part_table[PART_DOWN], sizeof(partition)); |
| 162 | partition.mem.start = dest; |
| 163 | wl1271_set_partition(wl, &partition); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 164 | |
| 165 | /* 10.1 set partition limit and chunk num */ |
| 166 | chunk_num = 0; |
| 167 | partition_limit = part_table[PART_DOWN].mem.size; |
| 168 | |
| 169 | while (chunk_num < fw_data_len / CHUNK_SIZE) { |
| 170 | /* 10.2 update partition, if needed */ |
| 171 | addr = dest + (chunk_num + 2) * CHUNK_SIZE; |
| 172 | if (addr > partition_limit) { |
| 173 | addr = dest + chunk_num * CHUNK_SIZE; |
| 174 | partition_limit = chunk_num * CHUNK_SIZE + |
| 175 | part_table[PART_DOWN].mem.size; |
Juuso Oikarinen | 451de97 | 2009-10-12 15:08:46 +0300 | [diff] [blame] | 176 | partition.mem.start = addr; |
| 177 | wl1271_set_partition(wl, &partition); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | /* 10.3 upload the chunk */ |
| 181 | addr = dest + chunk_num * CHUNK_SIZE; |
| 182 | p = buf + chunk_num * CHUNK_SIZE; |
Juuso Oikarinen | 1fba497 | 2009-10-08 21:56:32 +0300 | [diff] [blame] | 183 | memcpy(chunk, p, CHUNK_SIZE); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 184 | wl1271_debug(DEBUG_BOOT, "uploading fw chunk 0x%p to 0x%x", |
| 185 | p, addr); |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 186 | wl1271_write(wl, addr, chunk, CHUNK_SIZE, false); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 187 | |
| 188 | chunk_num++; |
| 189 | } |
| 190 | |
| 191 | /* 10.4 upload the last chunk */ |
| 192 | addr = dest + chunk_num * CHUNK_SIZE; |
| 193 | p = buf + chunk_num * CHUNK_SIZE; |
Juuso Oikarinen | 1fba497 | 2009-10-08 21:56:32 +0300 | [diff] [blame] | 194 | memcpy(chunk, p, fw_data_len % CHUNK_SIZE); |
Luciano Coelho | 73d0a13 | 2009-08-11 11:58:27 +0300 | [diff] [blame] | 195 | wl1271_debug(DEBUG_BOOT, "uploading fw last chunk (%zd B) 0x%p to 0x%x", |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 196 | fw_data_len % CHUNK_SIZE, p, addr); |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 197 | wl1271_write(wl, addr, chunk, fw_data_len % CHUNK_SIZE, false); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 198 | |
Juuso Oikarinen | 1fba497 | 2009-10-08 21:56:32 +0300 | [diff] [blame] | 199 | kfree(chunk); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 200 | return 0; |
| 201 | } |
| 202 | |
| 203 | static int wl1271_boot_upload_firmware(struct wl1271 *wl) |
| 204 | { |
| 205 | u32 chunks, addr, len; |
Juuso Oikarinen | ed317788 | 2009-10-13 12:47:57 +0300 | [diff] [blame] | 206 | int ret = 0; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 207 | u8 *fw; |
| 208 | |
| 209 | fw = wl->fw; |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 210 | chunks = be32_to_cpup((__be32 *) fw); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 211 | fw += sizeof(u32); |
| 212 | |
| 213 | wl1271_debug(DEBUG_BOOT, "firmware chunks to be uploaded: %u", chunks); |
| 214 | |
| 215 | while (chunks--) { |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 216 | addr = be32_to_cpup((__be32 *) fw); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 217 | fw += sizeof(u32); |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 218 | len = be32_to_cpup((__be32 *) fw); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 219 | fw += sizeof(u32); |
| 220 | |
| 221 | if (len > 300000) { |
| 222 | wl1271_info("firmware chunk too long: %u", len); |
| 223 | return -EINVAL; |
| 224 | } |
| 225 | wl1271_debug(DEBUG_BOOT, "chunk %d addr 0x%x len %u", |
| 226 | chunks, addr, len); |
Juuso Oikarinen | ed317788 | 2009-10-13 12:47:57 +0300 | [diff] [blame] | 227 | ret = wl1271_boot_upload_firmware_chunk(wl, fw, len, addr); |
| 228 | if (ret != 0) |
| 229 | break; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 230 | fw += len; |
| 231 | } |
| 232 | |
Juuso Oikarinen | ed317788 | 2009-10-13 12:47:57 +0300 | [diff] [blame] | 233 | return ret; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 234 | } |
| 235 | |
| 236 | static int wl1271_boot_upload_nvs(struct wl1271 *wl) |
| 237 | { |
| 238 | size_t nvs_len, burst_len; |
| 239 | int i; |
| 240 | u32 dest_addr, val; |
Juuso Oikarinen | 152ee6e | 2010-02-18 13:25:42 +0200 | [diff] [blame] | 241 | u8 *nvs_ptr, *nvs_aligned; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 242 | |
Juuso Oikarinen | 152ee6e | 2010-02-18 13:25:42 +0200 | [diff] [blame] | 243 | if (wl->nvs == NULL) |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 244 | return -ENODEV; |
| 245 | |
Juuso Oikarinen | 02fabb0 | 2010-08-19 04:41:15 +0200 | [diff] [blame] | 246 | /* |
| 247 | * FIXME: the LEGACY NVS image support (NVS's missing the 5GHz band |
| 248 | * configurations) can be removed when those NVS files stop floating |
| 249 | * around. |
| 250 | */ |
| 251 | if (wl->nvs_len == sizeof(struct wl1271_nvs_file) || |
| 252 | wl->nvs_len == WL1271_INI_LEGACY_NVS_FILE_SIZE) { |
Arik Nemtsov | 038d925 | 2010-10-16 21:53:24 +0200 | [diff] [blame] | 253 | /* for now 11a is unsupported in AP mode */ |
| 254 | if (wl->bss_type != BSS_TYPE_AP_BSS && |
| 255 | wl->nvs->general_params.dual_mode_select) |
Juuso Oikarinen | 02fabb0 | 2010-08-19 04:41:15 +0200 | [diff] [blame] | 256 | wl->enable_11a = true; |
| 257 | } |
| 258 | |
| 259 | if (wl->nvs_len != sizeof(struct wl1271_nvs_file) && |
| 260 | (wl->nvs_len != WL1271_INI_LEGACY_NVS_FILE_SIZE || |
| 261 | wl->enable_11a)) { |
| 262 | wl1271_error("nvs size is not as expected: %zu != %zu", |
| 263 | wl->nvs_len, sizeof(struct wl1271_nvs_file)); |
| 264 | kfree(wl->nvs); |
| 265 | wl->nvs = NULL; |
| 266 | wl->nvs_len = 0; |
| 267 | return -EILSEQ; |
| 268 | } |
| 269 | |
Luciano Coelho | 8cf5e8e | 2009-12-11 15:40:53 +0200 | [diff] [blame] | 270 | /* only the first part of the NVS needs to be uploaded */ |
Juuso Oikarinen | 152ee6e | 2010-02-18 13:25:42 +0200 | [diff] [blame] | 271 | nvs_len = sizeof(wl->nvs->nvs); |
| 272 | nvs_ptr = (u8 *)wl->nvs->nvs; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 273 | |
Juuso Oikarinen | 1b72aec | 2010-03-18 12:26:39 +0200 | [diff] [blame] | 274 | /* update current MAC address to NVS */ |
| 275 | nvs_ptr[11] = wl->mac_addr[0]; |
| 276 | nvs_ptr[10] = wl->mac_addr[1]; |
| 277 | nvs_ptr[6] = wl->mac_addr[2]; |
| 278 | nvs_ptr[5] = wl->mac_addr[3]; |
| 279 | nvs_ptr[4] = wl->mac_addr[4]; |
| 280 | nvs_ptr[3] = wl->mac_addr[5]; |
| 281 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 282 | /* |
| 283 | * Layout before the actual NVS tables: |
| 284 | * 1 byte : burst length. |
| 285 | * 2 bytes: destination address. |
| 286 | * n bytes: data to burst copy. |
| 287 | * |
| 288 | * This is ended by a 0 length, then the NVS tables. |
| 289 | */ |
| 290 | |
| 291 | /* FIXME: Do we need to check here whether the LSB is 1? */ |
| 292 | while (nvs_ptr[0]) { |
| 293 | burst_len = nvs_ptr[0]; |
| 294 | dest_addr = (nvs_ptr[1] & 0xfe) | ((u32)(nvs_ptr[2] << 8)); |
| 295 | |
Juuso Oikarinen | 2f63b01 | 2010-08-10 06:38:35 +0200 | [diff] [blame] | 296 | /* |
| 297 | * Due to our new wl1271_translate_reg_addr function, |
| 298 | * we need to add the REGISTER_BASE to the destination |
| 299 | */ |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 300 | dest_addr += REGISTERS_BASE; |
| 301 | |
| 302 | /* We move our pointer to the data */ |
| 303 | nvs_ptr += 3; |
| 304 | |
| 305 | for (i = 0; i < burst_len; i++) { |
| 306 | val = (nvs_ptr[0] | (nvs_ptr[1] << 8) |
| 307 | | (nvs_ptr[2] << 16) | (nvs_ptr[3] << 24)); |
| 308 | |
| 309 | wl1271_debug(DEBUG_BOOT, |
| 310 | "nvs burst write 0x%x: 0x%x", |
| 311 | dest_addr, val); |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 312 | wl1271_write32(wl, dest_addr, val); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 313 | |
| 314 | nvs_ptr += 4; |
| 315 | dest_addr += 4; |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | /* |
| 320 | * We've reached the first zero length, the first NVS table |
Ido Yariv | 67e0208 | 2010-09-22 09:53:13 +0200 | [diff] [blame] | 321 | * is located at an aligned offset which is at least 7 bytes further. |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 322 | */ |
Ido Yariv | 67e0208 | 2010-09-22 09:53:13 +0200 | [diff] [blame] | 323 | nvs_ptr = (u8 *)wl->nvs->nvs + |
| 324 | ALIGN(nvs_ptr - (u8 *)wl->nvs->nvs + 7, 4); |
Juuso Oikarinen | 152ee6e | 2010-02-18 13:25:42 +0200 | [diff] [blame] | 325 | nvs_len -= nvs_ptr - (u8 *)wl->nvs->nvs; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 326 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 327 | /* Now we must set the partition correctly */ |
Juuso Oikarinen | 451de97 | 2009-10-12 15:08:46 +0300 | [diff] [blame] | 328 | wl1271_set_partition(wl, &part_table[PART_WORK]); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 329 | |
| 330 | /* Copy the NVS tables to a new block to ensure alignment */ |
Ido Yariv | 67e0208 | 2010-09-22 09:53:13 +0200 | [diff] [blame] | 331 | nvs_aligned = kmemdup(nvs_ptr, nvs_len, GFP_KERNEL); |
| 332 | if (!nvs_aligned) |
| 333 | return -ENOMEM; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 334 | |
| 335 | /* And finally we upload the NVS tables */ |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 336 | wl1271_write(wl, CMD_MBOX_ADDRESS, nvs_aligned, nvs_len, false); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 337 | |
| 338 | kfree(nvs_aligned); |
| 339 | return 0; |
| 340 | } |
| 341 | |
| 342 | static void wl1271_boot_enable_interrupts(struct wl1271 *wl) |
| 343 | { |
Teemu Paasikivi | 54f7e50 | 2010-02-22 08:38:22 +0200 | [diff] [blame] | 344 | wl1271_enable_interrupts(wl); |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 345 | wl1271_write32(wl, ACX_REG_INTERRUPT_MASK, |
| 346 | WL1271_ACX_INTR_ALL & ~(WL1271_INTR_MASK)); |
| 347 | wl1271_write32(wl, HI_CFG, HI_CFG_DEF_VAL); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 348 | } |
| 349 | |
| 350 | static int wl1271_boot_soft_reset(struct wl1271 *wl) |
| 351 | { |
| 352 | unsigned long timeout; |
| 353 | u32 boot_data; |
| 354 | |
| 355 | /* perform soft reset */ |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 356 | wl1271_write32(wl, ACX_REG_SLV_SOFT_RESET, ACX_SLV_SOFT_RESET_BIT); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 357 | |
| 358 | /* SOFT_RESET is self clearing */ |
| 359 | timeout = jiffies + usecs_to_jiffies(SOFT_RESET_MAX_TIME); |
| 360 | while (1) { |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 361 | boot_data = wl1271_read32(wl, ACX_REG_SLV_SOFT_RESET); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 362 | wl1271_debug(DEBUG_BOOT, "soft reset bootdata 0x%x", boot_data); |
| 363 | if ((boot_data & ACX_SLV_SOFT_RESET_BIT) == 0) |
| 364 | break; |
| 365 | |
| 366 | if (time_after(jiffies, timeout)) { |
| 367 | /* 1.2 check pWhalBus->uSelfClearTime if the |
| 368 | * timeout was reached */ |
| 369 | wl1271_error("soft reset timeout"); |
| 370 | return -1; |
| 371 | } |
| 372 | |
| 373 | udelay(SOFT_RESET_STALL_TIME); |
| 374 | } |
| 375 | |
| 376 | /* disable Rx/Tx */ |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 377 | wl1271_write32(wl, ENABLE, 0x0); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 378 | |
| 379 | /* disable auto calibration on start*/ |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 380 | wl1271_write32(wl, SPARE_A2, 0xffff); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 381 | |
| 382 | return 0; |
| 383 | } |
| 384 | |
| 385 | static int wl1271_boot_run_firmware(struct wl1271 *wl) |
| 386 | { |
| 387 | int loop, ret; |
Luciano Coelho | 23a7a51 | 2010-04-28 09:50:02 +0300 | [diff] [blame] | 388 | u32 chip_id, intr; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 389 | |
| 390 | wl1271_boot_set_ecpu_ctrl(wl, ECPU_CONTROL_HALT); |
| 391 | |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 392 | chip_id = wl1271_read32(wl, CHIP_ID_B); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 393 | |
| 394 | wl1271_debug(DEBUG_BOOT, "chip id after firmware boot: 0x%x", chip_id); |
| 395 | |
| 396 | if (chip_id != wl->chip.id) { |
| 397 | wl1271_error("chip id doesn't match after firmware boot"); |
| 398 | return -EIO; |
| 399 | } |
| 400 | |
| 401 | /* wait for init to complete */ |
| 402 | loop = 0; |
| 403 | while (loop++ < INIT_LOOP) { |
| 404 | udelay(INIT_LOOP_DELAY); |
Luciano Coelho | 23a7a51 | 2010-04-28 09:50:02 +0300 | [diff] [blame] | 405 | intr = wl1271_read32(wl, ACX_REG_INTERRUPT_NO_CLEAR); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 406 | |
Luciano Coelho | 23a7a51 | 2010-04-28 09:50:02 +0300 | [diff] [blame] | 407 | if (intr == 0xffffffff) { |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 408 | wl1271_error("error reading hardware complete " |
| 409 | "init indication"); |
| 410 | return -EIO; |
| 411 | } |
| 412 | /* check that ACX_INTR_INIT_COMPLETE is enabled */ |
Luciano Coelho | 23a7a51 | 2010-04-28 09:50:02 +0300 | [diff] [blame] | 413 | else if (intr & WL1271_ACX_INTR_INIT_COMPLETE) { |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 414 | wl1271_write32(wl, ACX_REG_INTERRUPT_ACK, |
| 415 | WL1271_ACX_INTR_INIT_COMPLETE); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 416 | break; |
| 417 | } |
| 418 | } |
| 419 | |
Luciano Coelho | e7d17cf | 2009-10-29 13:20:04 +0200 | [diff] [blame] | 420 | if (loop > INIT_LOOP) { |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 421 | wl1271_error("timeout waiting for the hardware to " |
| 422 | "complete initialization"); |
| 423 | return -EIO; |
| 424 | } |
| 425 | |
| 426 | /* get hardware config command mail box */ |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 427 | wl->cmd_box_addr = wl1271_read32(wl, REG_COMMAND_MAILBOX_PTR); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 428 | |
| 429 | /* get hardware config event mail box */ |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 430 | wl->event_box_addr = wl1271_read32(wl, REG_EVENT_MAILBOX_PTR); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 431 | |
| 432 | /* set the working partition to its "running" mode offset */ |
Juuso Oikarinen | 451de97 | 2009-10-12 15:08:46 +0300 | [diff] [blame] | 433 | wl1271_set_partition(wl, &part_table[PART_WORK]); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 434 | |
| 435 | wl1271_debug(DEBUG_MAILBOX, "cmd_box_addr 0x%x event_box_addr 0x%x", |
| 436 | wl->cmd_box_addr, wl->event_box_addr); |
| 437 | |
| 438 | wl1271_boot_fw_version(wl); |
| 439 | |
| 440 | /* |
| 441 | * in case of full asynchronous mode the firmware event must be |
| 442 | * ready to receive event from the command mailbox |
| 443 | */ |
| 444 | |
Juuso Oikarinen | be823e5 | 2009-10-08 21:56:36 +0300 | [diff] [blame] | 445 | /* unmask required mbox events */ |
| 446 | wl->event_mask = BSS_LOSE_EVENT_ID | |
Juuso Oikarinen | 19ad071 | 2009-11-02 20:22:11 +0200 | [diff] [blame] | 447 | SCAN_COMPLETE_EVENT_ID | |
Luciano Coelho | 99d84c1 | 2010-03-26 12:53:20 +0200 | [diff] [blame] | 448 | PS_REPORT_EVENT_ID | |
Luciano Coelho | 2f826f5 | 2010-03-26 12:53:21 +0200 | [diff] [blame] | 449 | JOIN_EVENT_COMPLETE_ID | |
Juuso Oikarinen | 00236aed | 2010-04-09 11:07:30 +0300 | [diff] [blame] | 450 | DISCONNECT_EVENT_COMPLETE_ID | |
Juuso Oikarinen | 90494a9 | 2010-07-08 17:50:00 +0300 | [diff] [blame] | 451 | RSSI_SNR_TRIGGER_0_EVENT_ID | |
Juuso Oikarinen | 8d2ef7b | 2010-07-08 17:50:03 +0300 | [diff] [blame] | 452 | PSPOLL_DELIVERY_FAILURE_EVENT_ID | |
| 453 | SOFT_GEMINI_SENSE_EVENT_ID; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 454 | |
Arik Nemtsov | 203c903 | 2010-10-25 11:17:44 +0200 | [diff] [blame] | 455 | if (wl->bss_type == BSS_TYPE_AP_BSS) |
| 456 | wl->event_mask |= STA_REMOVE_COMPLETE_EVENT_ID; |
| 457 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 458 | ret = wl1271_event_unmask(wl); |
| 459 | if (ret < 0) { |
| 460 | wl1271_error("EVENT mask setting failed"); |
| 461 | return ret; |
| 462 | } |
| 463 | |
| 464 | wl1271_event_mbox_config(wl); |
| 465 | |
| 466 | /* firmware startup completed */ |
| 467 | return 0; |
| 468 | } |
| 469 | |
| 470 | static int wl1271_boot_write_irq_polarity(struct wl1271 *wl) |
| 471 | { |
Juuso Oikarinen | e8768ee | 2009-10-12 15:08:48 +0300 | [diff] [blame] | 472 | u32 polarity; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 473 | |
Juuso Oikarinen | e8768ee | 2009-10-12 15:08:48 +0300 | [diff] [blame] | 474 | polarity = wl1271_top_reg_read(wl, OCP_REG_POLARITY); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 475 | |
| 476 | /* We use HIGH polarity, so unset the LOW bit */ |
| 477 | polarity &= ~POLARITY_LOW; |
Juuso Oikarinen | e8768ee | 2009-10-12 15:08:48 +0300 | [diff] [blame] | 478 | wl1271_top_reg_write(wl, OCP_REG_POLARITY, polarity); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 479 | |
| 480 | return 0; |
| 481 | } |
| 482 | |
Juuso Oikarinen | d717fd6 | 2010-05-07 11:38:58 +0300 | [diff] [blame] | 483 | static void wl1271_boot_hw_version(struct wl1271 *wl) |
| 484 | { |
| 485 | u32 fuse; |
| 486 | |
| 487 | fuse = wl1271_top_reg_read(wl, REG_FUSE_DATA_2_1); |
| 488 | fuse = (fuse & PG_VER_MASK) >> PG_VER_OFFSET; |
| 489 | |
| 490 | wl->hw_pg_ver = (s8)fuse; |
| 491 | } |
| 492 | |
Roger Quadros | 870c367 | 2010-11-29 16:24:57 +0200 | [diff] [blame] | 493 | /* uploads NVS and firmware */ |
| 494 | int wl1271_load_firmware(struct wl1271 *wl) |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 495 | { |
| 496 | int ret = 0; |
| 497 | u32 tmp, clk, pause; |
| 498 | |
Juuso Oikarinen | d717fd6 | 2010-05-07 11:38:58 +0300 | [diff] [blame] | 499 | wl1271_boot_hw_version(wl); |
| 500 | |
Gery Kahn | c8aea56 | 2010-10-05 16:09:05 +0200 | [diff] [blame] | 501 | if (wl->ref_clock == 0 || wl->ref_clock == 2 || wl->ref_clock == 4) |
Juuso Oikarinen | 284134e | 2009-10-12 15:08:49 +0300 | [diff] [blame] | 502 | /* ref clk: 19.2/38.4/38.4-XTAL */ |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 503 | clk = 0x3; |
Gery Kahn | c8aea56 | 2010-10-05 16:09:05 +0200 | [diff] [blame] | 504 | else if (wl->ref_clock == 1 || wl->ref_clock == 3) |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 505 | /* ref clk: 26/52 */ |
| 506 | clk = 0x5; |
Ohad Ben-Cohen | 15cea99 | 2010-09-16 01:31:51 +0200 | [diff] [blame] | 507 | else |
| 508 | return -EINVAL; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 509 | |
Gery Kahn | c8aea56 | 2010-10-05 16:09:05 +0200 | [diff] [blame] | 510 | if (wl->ref_clock != 0) { |
Juuso Oikarinen | 284134e | 2009-10-12 15:08:49 +0300 | [diff] [blame] | 511 | u16 val; |
Juuso Oikarinen | 9d4e5bb | 2010-03-26 12:53:15 +0200 | [diff] [blame] | 512 | /* Set clock type (open drain) */ |
Juuso Oikarinen | 284134e | 2009-10-12 15:08:49 +0300 | [diff] [blame] | 513 | val = wl1271_top_reg_read(wl, OCP_REG_CLK_TYPE); |
| 514 | val &= FREF_CLK_TYPE_BITS; |
Juuso Oikarinen | 284134e | 2009-10-12 15:08:49 +0300 | [diff] [blame] | 515 | wl1271_top_reg_write(wl, OCP_REG_CLK_TYPE, val); |
Juuso Oikarinen | 9d4e5bb | 2010-03-26 12:53:15 +0200 | [diff] [blame] | 516 | |
| 517 | /* Set clock pull mode (no pull) */ |
| 518 | val = wl1271_top_reg_read(wl, OCP_REG_CLK_PULL); |
| 519 | val |= NO_PULL; |
| 520 | wl1271_top_reg_write(wl, OCP_REG_CLK_PULL, val); |
Juuso Oikarinen | 284134e | 2009-10-12 15:08:49 +0300 | [diff] [blame] | 521 | } else { |
| 522 | u16 val; |
| 523 | /* Set clock polarity */ |
| 524 | val = wl1271_top_reg_read(wl, OCP_REG_CLK_POLARITY); |
| 525 | val &= FREF_CLK_POLARITY_BITS; |
| 526 | val |= CLK_REQ_OUTN_SEL; |
| 527 | wl1271_top_reg_write(wl, OCP_REG_CLK_POLARITY, val); |
| 528 | } |
| 529 | |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 530 | wl1271_write32(wl, PLL_PARAMETERS, clk); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 531 | |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 532 | pause = wl1271_read32(wl, PLL_PARAMETERS); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 533 | |
| 534 | wl1271_debug(DEBUG_BOOT, "pause1 0x%x", pause); |
| 535 | |
Juuso Oikarinen | 2f63b01 | 2010-08-10 06:38:35 +0200 | [diff] [blame] | 536 | pause &= ~(WU_COUNTER_PAUSE_VAL); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 537 | pause |= WU_COUNTER_PAUSE_VAL; |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 538 | wl1271_write32(wl, WU_COUNTER_PAUSE, pause); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 539 | |
| 540 | /* Continue the ELP wake up sequence */ |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 541 | wl1271_write32(wl, WELP_ARM_COMMAND, WELP_ARM_COMMAND_VAL); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 542 | udelay(500); |
| 543 | |
Juuso Oikarinen | 451de97 | 2009-10-12 15:08:46 +0300 | [diff] [blame] | 544 | wl1271_set_partition(wl, &part_table[PART_DRPW]); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 545 | |
| 546 | /* Read-modify-write DRPW_SCRATCH_START register (see next state) |
| 547 | to be used by DRPw FW. The RTRIM value will be added by the FW |
| 548 | before taking DRPw out of reset */ |
| 549 | |
| 550 | wl1271_debug(DEBUG_BOOT, "DRPW_SCRATCH_START %08x", DRPW_SCRATCH_START); |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 551 | clk = wl1271_read32(wl, DRPW_SCRATCH_START); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 552 | |
| 553 | wl1271_debug(DEBUG_BOOT, "clk2 0x%x", clk); |
| 554 | |
Gery Kahn | c8aea56 | 2010-10-05 16:09:05 +0200 | [diff] [blame] | 555 | clk |= (wl->ref_clock << 1) << 4; |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 556 | wl1271_write32(wl, DRPW_SCRATCH_START, clk); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 557 | |
Juuso Oikarinen | 451de97 | 2009-10-12 15:08:46 +0300 | [diff] [blame] | 558 | wl1271_set_partition(wl, &part_table[PART_WORK]); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 559 | |
| 560 | /* Disable interrupts */ |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 561 | wl1271_write32(wl, ACX_REG_INTERRUPT_MASK, WL1271_ACX_INTR_ALL); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 562 | |
| 563 | ret = wl1271_boot_soft_reset(wl); |
| 564 | if (ret < 0) |
| 565 | goto out; |
| 566 | |
| 567 | /* 2. start processing NVS file */ |
| 568 | ret = wl1271_boot_upload_nvs(wl); |
| 569 | if (ret < 0) |
| 570 | goto out; |
| 571 | |
| 572 | /* write firmware's last address (ie. it's length) to |
| 573 | * ACX_EEPROMLESS_IND_REG */ |
| 574 | wl1271_debug(DEBUG_BOOT, "ACX_EEPROMLESS_IND_REG"); |
| 575 | |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 576 | wl1271_write32(wl, ACX_EEPROMLESS_IND_REG, ACX_EEPROMLESS_IND_REG); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 577 | |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 578 | tmp = wl1271_read32(wl, CHIP_ID_B); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 579 | |
| 580 | wl1271_debug(DEBUG_BOOT, "chip id 0x%x", tmp); |
| 581 | |
| 582 | /* 6. read the EEPROM parameters */ |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 583 | tmp = wl1271_read32(wl, SCR_PAD2); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 584 | |
| 585 | ret = wl1271_boot_write_irq_polarity(wl); |
| 586 | if (ret < 0) |
| 587 | goto out; |
| 588 | |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 589 | wl1271_write32(wl, ACX_REG_INTERRUPT_MASK, |
| 590 | WL1271_ACX_ALL_EVENTS_VECTOR); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 591 | |
| 592 | /* WL1271: The reference driver skips steps 7 to 10 (jumps directly |
| 593 | * to upload_fw) */ |
| 594 | |
| 595 | ret = wl1271_boot_upload_firmware(wl); |
| 596 | if (ret < 0) |
| 597 | goto out; |
| 598 | |
Roger Quadros | 870c367 | 2010-11-29 16:24:57 +0200 | [diff] [blame] | 599 | out: |
| 600 | return ret; |
| 601 | } |
| 602 | EXPORT_SYMBOL_GPL(wl1271_load_firmware); |
| 603 | |
| 604 | int wl1271_boot(struct wl1271 *wl) |
| 605 | { |
| 606 | int ret; |
| 607 | |
| 608 | /* upload NVS and firmware */ |
| 609 | ret = wl1271_load_firmware(wl); |
| 610 | if (ret) |
| 611 | return ret; |
| 612 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 613 | /* 10.5 start firmware */ |
| 614 | ret = wl1271_boot_run_firmware(wl); |
| 615 | if (ret < 0) |
| 616 | goto out; |
| 617 | |
Juuso Oikarinen | eb5b28d | 2009-10-13 12:47:45 +0300 | [diff] [blame] | 618 | /* Enable firmware interrupts now */ |
| 619 | wl1271_boot_enable_interrupts(wl); |
| 620 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 621 | /* set the wl1271 default filters */ |
Arik Nemtsov | ae113b5 | 2010-10-16 18:45:07 +0200 | [diff] [blame] | 622 | wl1271_set_default_filters(wl); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 623 | |
| 624 | wl1271_event_mbox_config(wl); |
| 625 | |
| 626 | out: |
| 627 | return ret; |
| 628 | } |