diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2009-10-12 08:08:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:03 -0400 |
commit | 451de97adb4d0f101f3befc881a548adb47c467a (patch) | |
tree | 6d40eb04db29f66983a6dd98e8bfff7eb654935b /drivers/net/wireless/wl12xx/wl1271_boot.c | |
parent | 37079a831d8194e138c03663b7cab281ab1dc181 (diff) |
wl1271: Update memory mapping for firmware revision 6.1.0.0.241
Update the memory regions and memory mapping to support firmware revision
6.1.0.0.241.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_boot.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_boot.c | 67 |
1 files changed, 35 insertions, 32 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.c b/drivers/net/wireless/wl12xx/wl1271_boot.c index 140e94348bc1..2eb7836c9ac1 100644 --- a/drivers/net/wireless/wl12xx/wl1271_boot.c +++ b/drivers/net/wireless/wl12xx/wl1271_boot.c | |||
@@ -39,6 +39,14 @@ static struct wl1271_partition_set part_table[PART_TABLE_LEN] = { | |||
39 | .start = REGISTERS_BASE, | 39 | .start = REGISTERS_BASE, |
40 | .size = 0x00008800 | 40 | .size = 0x00008800 |
41 | }, | 41 | }, |
42 | .mem2 = { | ||
43 | .start = 0x00000000, | ||
44 | .size = 0x00000000 | ||
45 | }, | ||
46 | .mem3 = { | ||
47 | .start = 0x00000000, | ||
48 | .size = 0x00000000 | ||
49 | }, | ||
42 | }, | 50 | }, |
43 | 51 | ||
44 | [PART_WORK] = { | 52 | [PART_WORK] = { |
@@ -48,7 +56,15 @@ static struct wl1271_partition_set part_table[PART_TABLE_LEN] = { | |||
48 | }, | 56 | }, |
49 | .reg = { | 57 | .reg = { |
50 | .start = REGISTERS_BASE, | 58 | .start = REGISTERS_BASE, |
51 | .size = 0x0000b000 | 59 | .size = 0x0000a000 |
60 | }, | ||
61 | .mem2 = { | ||
62 | .start = 0x003004f8, | ||
63 | .size = 0x00000004 | ||
64 | }, | ||
65 | .mem3 = { | ||
66 | .start = 0x00040404, | ||
67 | .size = 0x00000000 | ||
52 | }, | 68 | }, |
53 | }, | 69 | }, |
54 | 70 | ||
@@ -60,6 +76,14 @@ static struct wl1271_partition_set part_table[PART_TABLE_LEN] = { | |||
60 | .reg = { | 76 | .reg = { |
61 | .start = DRPW_BASE, | 77 | .start = DRPW_BASE, |
62 | .size = 0x00006000 | 78 | .size = 0x00006000 |
79 | }, | ||
80 | .mem2 = { | ||
81 | .start = 0x00000000, | ||
82 | .size = 0x00000000 | ||
83 | }, | ||
84 | .mem3 = { | ||
85 | .start = 0x00000000, | ||
86 | .size = 0x00000000 | ||
63 | } | 87 | } |
64 | } | 88 | } |
65 | }; | 89 | }; |
@@ -93,6 +117,7 @@ static void wl1271_boot_fw_version(struct wl1271 *wl) | |||
93 | static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf, | 117 | static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf, |
94 | size_t fw_data_len, u32 dest) | 118 | size_t fw_data_len, u32 dest) |
95 | { | 119 | { |
120 | struct wl1271_partition_set partition; | ||
96 | int addr, chunk_num, partition_limit; | 121 | int addr, chunk_num, partition_limit; |
97 | u8 *p, *chunk; | 122 | u8 *p, *chunk; |
98 | 123 | ||
@@ -114,10 +139,9 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf, | |||
114 | return -ENOMEM; | 139 | return -ENOMEM; |
115 | } | 140 | } |
116 | 141 | ||
117 | wl1271_set_partition(wl, dest, | 142 | memcpy(&partition, &part_table[PART_DOWN], sizeof(partition)); |
118 | part_table[PART_DOWN].mem.size, | 143 | partition.mem.start = dest; |
119 | part_table[PART_DOWN].reg.start, | 144 | wl1271_set_partition(wl, &partition); |
120 | part_table[PART_DOWN].reg.size); | ||
121 | 145 | ||
122 | /* 10.1 set partition limit and chunk num */ | 146 | /* 10.1 set partition limit and chunk num */ |
123 | chunk_num = 0; | 147 | chunk_num = 0; |
@@ -130,13 +154,8 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf, | |||
130 | addr = dest + chunk_num * CHUNK_SIZE; | 154 | addr = dest + chunk_num * CHUNK_SIZE; |
131 | partition_limit = chunk_num * CHUNK_SIZE + | 155 | partition_limit = chunk_num * CHUNK_SIZE + |
132 | part_table[PART_DOWN].mem.size; | 156 | part_table[PART_DOWN].mem.size; |
133 | 157 | partition.mem.start = addr; | |
134 | /* FIXME: Over 80 chars! */ | 158 | wl1271_set_partition(wl, &partition); |
135 | wl1271_set_partition(wl, | ||
136 | addr, | ||
137 | part_table[PART_DOWN].mem.size, | ||
138 | part_table[PART_DOWN].reg.start, | ||
139 | part_table[PART_DOWN].reg.size); | ||
140 | } | 159 | } |
141 | 160 | ||
142 | /* 10.3 upload the chunk */ | 161 | /* 10.3 upload the chunk */ |
@@ -261,11 +280,7 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl) | |||
261 | /* FIXME: The driver sets the partition here, but this is not needed, | 280 | /* FIXME: The driver sets the partition here, but this is not needed, |
262 | since it sets to the same one as currently in use */ | 281 | since it sets to the same one as currently in use */ |
263 | /* Now we must set the partition correctly */ | 282 | /* Now we must set the partition correctly */ |
264 | wl1271_set_partition(wl, | 283 | wl1271_set_partition(wl, &part_table[PART_WORK]); |
265 | part_table[PART_WORK].mem.start, | ||
266 | part_table[PART_WORK].mem.size, | ||
267 | part_table[PART_WORK].reg.start, | ||
268 | part_table[PART_WORK].reg.size); | ||
269 | 284 | ||
270 | /* Copy the NVS tables to a new block to ensure alignment */ | 285 | /* Copy the NVS tables to a new block to ensure alignment */ |
271 | nvs_aligned = kmemdup(nvs_ptr, nvs_len, GFP_KERNEL); | 286 | nvs_aligned = kmemdup(nvs_ptr, nvs_len, GFP_KERNEL); |
@@ -371,11 +386,7 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl) | |||
371 | wl->event_box_addr = wl1271_reg_read32(wl, REG_EVENT_MAILBOX_PTR); | 386 | wl->event_box_addr = wl1271_reg_read32(wl, REG_EVENT_MAILBOX_PTR); |
372 | 387 | ||
373 | /* set the working partition to its "running" mode offset */ | 388 | /* set the working partition to its "running" mode offset */ |
374 | wl1271_set_partition(wl, | 389 | wl1271_set_partition(wl, &part_table[PART_WORK]); |
375 | part_table[PART_WORK].mem.start, | ||
376 | part_table[PART_WORK].mem.size, | ||
377 | part_table[PART_WORK].reg.start, | ||
378 | part_table[PART_WORK].reg.size); | ||
379 | 390 | ||
380 | wl1271_debug(DEBUG_MAILBOX, "cmd_box_addr 0x%x event_box_addr 0x%x", | 391 | wl1271_debug(DEBUG_MAILBOX, "cmd_box_addr 0x%x event_box_addr 0x%x", |
381 | wl->cmd_box_addr, wl->event_box_addr); | 392 | wl->cmd_box_addr, wl->event_box_addr); |
@@ -469,11 +480,7 @@ int wl1271_boot(struct wl1271 *wl) | |||
469 | wl1271_reg_write32(wl, WELP_ARM_COMMAND, WELP_ARM_COMMAND_VAL); | 480 | wl1271_reg_write32(wl, WELP_ARM_COMMAND, WELP_ARM_COMMAND_VAL); |
470 | udelay(500); | 481 | udelay(500); |
471 | 482 | ||
472 | wl1271_set_partition(wl, | 483 | wl1271_set_partition(wl, &part_table[PART_DRPW]); |
473 | part_table[PART_DRPW].mem.start, | ||
474 | part_table[PART_DRPW].mem.size, | ||
475 | part_table[PART_DRPW].reg.start, | ||
476 | part_table[PART_DRPW].reg.size); | ||
477 | 484 | ||
478 | /* Read-modify-write DRPW_SCRATCH_START register (see next state) | 485 | /* Read-modify-write DRPW_SCRATCH_START register (see next state) |
479 | to be used by DRPw FW. The RTRIM value will be added by the FW | 486 | to be used by DRPw FW. The RTRIM value will be added by the FW |
@@ -488,11 +495,7 @@ int wl1271_boot(struct wl1271 *wl) | |||
488 | clk |= (REF_CLOCK << 1) << 4; | 495 | clk |= (REF_CLOCK << 1) << 4; |
489 | wl1271_reg_write32(wl, DRPW_SCRATCH_START, clk); | 496 | wl1271_reg_write32(wl, DRPW_SCRATCH_START, clk); |
490 | 497 | ||
491 | wl1271_set_partition(wl, | 498 | wl1271_set_partition(wl, &part_table[PART_WORK]); |
492 | part_table[PART_WORK].mem.start, | ||
493 | part_table[PART_WORK].mem.size, | ||
494 | part_table[PART_WORK].reg.start, | ||
495 | part_table[PART_WORK].reg.size); | ||
496 | 499 | ||
497 | /* Disable interrupts */ | 500 | /* Disable interrupts */ |
498 | wl1271_reg_write32(wl, ACX_REG_INTERRUPT_MASK, WL1271_ACX_INTR_ALL); | 501 | wl1271_reg_write32(wl, ACX_REG_INTERRUPT_MASK, WL1271_ACX_INTR_ALL); |