Rafał Miłecki | 572d37a | 2012-07-26 00:07:39 +0200 | [diff] [blame] | 1 | /* |
| 2 | |
| 3 | Broadcom B43 wireless driver |
| 4 | IEEE 802.11n 2057 radio device data tables |
| 5 | |
| 6 | Copyright (c) 2010 Rafał Miłecki <zajec5@gmail.com> |
| 7 | |
| 8 | This program is free software; you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation; either version 2 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with this program; see the file COPYING. If not, write to |
| 20 | the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, |
| 21 | Boston, MA 02110-1301, USA. |
| 22 | |
| 23 | */ |
| 24 | |
| 25 | #include "b43.h" |
| 26 | #include "radio_2057.h" |
| 27 | #include "phy_common.h" |
| 28 | |
| 29 | static u16 r2057_rev4_init[42][2] = { |
| 30 | { 0x0E, 0x20 }, { 0x31, 0x00 }, { 0x32, 0x00 }, { 0x33, 0x00 }, |
| 31 | { 0x35, 0x26 }, { 0x3C, 0xff }, { 0x3D, 0xff }, { 0x3E, 0xff }, |
| 32 | { 0x3F, 0xff }, { 0x62, 0x33 }, { 0x8A, 0xf0 }, { 0x8B, 0x10 }, |
| 33 | { 0x8C, 0xf0 }, { 0x91, 0x3f }, { 0x92, 0x36 }, { 0xA4, 0x8c }, |
| 34 | { 0xA8, 0x55 }, { 0xAF, 0x01 }, { 0x10F, 0xf0 }, { 0x110, 0x10 }, |
| 35 | { 0x111, 0xf0 }, { 0x116, 0x3f }, { 0x117, 0x36 }, { 0x129, 0x8c }, |
| 36 | { 0x12D, 0x55 }, { 0x134, 0x01 }, { 0x15E, 0x00 }, { 0x15F, 0x00 }, |
| 37 | { 0x160, 0x00 }, { 0x161, 0x00 }, { 0x162, 0x00 }, { 0x163, 0x00 }, |
| 38 | { 0x169, 0x02 }, { 0x16A, 0x00 }, { 0x16B, 0x00 }, { 0x16C, 0x00 }, |
| 39 | { 0x1A4, 0x00 }, { 0x1A5, 0x00 }, { 0x1A6, 0x00 }, { 0x1AA, 0x00 }, |
| 40 | { 0x1AB, 0x00 }, { 0x1AC, 0x00 }, |
| 41 | }; |
| 42 | |
| 43 | static u16 r2057_rev5_init[44][2] = { |
| 44 | { 0x00, 0x00 }, { 0x01, 0x57 }, { 0x02, 0x20 }, { 0x23, 0x6 }, |
| 45 | { 0x31, 0x00 }, { 0x32, 0x00 }, { 0x33, 0x00 }, { 0x51, 0x70 }, |
| 46 | { 0x59, 0x88 }, { 0x5C, 0x20 }, { 0x62, 0x33 }, { 0x63, 0x0f }, |
| 47 | { 0x64, 0x0f }, { 0x81, 0x01 }, { 0x91, 0x3f }, { 0x92, 0x36 }, |
| 48 | { 0xA1, 0x20 }, { 0xD6, 0x70 }, { 0xDE, 0x88 }, { 0xE1, 0x20 }, |
| 49 | { 0xE8, 0x0f }, { 0xE9, 0x0f }, { 0x106, 0x01 }, { 0x116, 0x3f }, |
| 50 | { 0x117, 0x36 }, { 0x126, 0x20 }, { 0x15E, 0x00 }, { 0x15F, 0x00 }, |
| 51 | { 0x160, 0x00 }, { 0x161, 0x00 }, { 0x162, 0x00 }, { 0x163, 0x00 }, |
| 52 | { 0x16A, 0x00 }, { 0x16B, 0x00 }, { 0x16C, 0x00 }, { 0x1A4, 0x00 }, |
| 53 | { 0x1A5, 0x00 }, { 0x1A6, 0x00 }, { 0x1AA, 0x00 }, { 0x1AB, 0x00 }, |
| 54 | { 0x1AC, 0x00 }, { 0x1B7, 0x0c }, { 0x1C1, 0x01 }, { 0x1C2, 0x80 }, |
| 55 | }; |
| 56 | |
| 57 | static u16 r2057_rev5a_init[45][2] = { |
| 58 | { 0x00, 0x15 }, { 0x01, 0x57 }, { 0x02, 0x20 }, { 0x23, 0x6 }, |
| 59 | { 0x31, 0x00 }, { 0x32, 0x00 }, { 0x33, 0x00 }, { 0x51, 0x70 }, |
| 60 | { 0x59, 0x88 }, { 0x5C, 0x20 }, { 0x62, 0x33 }, { 0x63, 0x0f }, |
| 61 | { 0x64, 0x0f }, { 0x81, 0x01 }, { 0x91, 0x3f }, { 0x92, 0x36 }, |
| 62 | { 0xC9, 0x01 }, { 0xD6, 0x70 }, { 0xDE, 0x88 }, { 0xE1, 0x20 }, |
| 63 | { 0xE8, 0x0f }, { 0xE9, 0x0f }, { 0x106, 0x01 }, { 0x116, 0x3f }, |
| 64 | { 0x117, 0x36 }, { 0x126, 0x20 }, { 0x14E, 0x01 }, { 0x15E, 0x00 }, |
| 65 | { 0x15F, 0x00 }, { 0x160, 0x00 }, { 0x161, 0x00 }, { 0x162, 0x00 }, |
| 66 | { 0x163, 0x00 }, { 0x16A, 0x00 }, { 0x16B, 0x00 }, { 0x16C, 0x00 }, |
| 67 | { 0x1A4, 0x00 }, { 0x1A5, 0x00 }, { 0x1A6, 0x00 }, { 0x1AA, 0x00 }, |
| 68 | { 0x1AB, 0x00 }, { 0x1AC, 0x00 }, { 0x1B7, 0x0c }, { 0x1C1, 0x01 }, |
| 69 | { 0x1C2, 0x80 }, |
| 70 | }; |
| 71 | |
| 72 | static u16 r2057_rev7_init[54][2] = { |
| 73 | { 0x00, 0x00 }, { 0x01, 0x57 }, { 0x02, 0x20 }, { 0x31, 0x00 }, |
| 74 | { 0x32, 0x00 }, { 0x33, 0x00 }, { 0x51, 0x70 }, { 0x59, 0x88 }, |
| 75 | { 0x5C, 0x20 }, { 0x62, 0x33 }, { 0x63, 0x0f }, { 0x64, 0x13 }, |
| 76 | { 0x66, 0xee }, { 0x6E, 0x58 }, { 0x75, 0x13 }, { 0x7B, 0x13 }, |
| 77 | { 0x7C, 0x14 }, { 0x7D, 0xee }, { 0x81, 0x01 }, { 0x91, 0x3f }, |
| 78 | { 0x92, 0x36 }, { 0xA1, 0x20 }, { 0xD6, 0x70 }, { 0xDE, 0x88 }, |
| 79 | { 0xE1, 0x20 }, { 0xE8, 0x0f }, { 0xE9, 0x13 }, { 0xEB, 0xee }, |
| 80 | { 0xF3, 0x58 }, { 0xFA, 0x13 }, { 0x100, 0x13 }, { 0x101, 0x14 }, |
| 81 | { 0x102, 0xee }, { 0x106, 0x01 }, { 0x116, 0x3f }, { 0x117, 0x36 }, |
| 82 | { 0x126, 0x20 }, { 0x15E, 0x00 }, { 0x15F, 0x00 }, { 0x160, 0x00 }, |
| 83 | { 0x161, 0x00 }, { 0x162, 0x00 }, { 0x163, 0x00 }, { 0x16A, 0x00 }, |
| 84 | { 0x16B, 0x00 }, { 0x16C, 0x00 }, { 0x1A4, 0x00 }, { 0x1A5, 0x00 }, |
| 85 | { 0x1A6, 0x00 }, { 0x1AA, 0x00 }, { 0x1AB, 0x00 }, { 0x1AC, 0x00 }, |
| 86 | { 0x1B7, 0x05 }, { 0x1C2, 0xa0 }, |
| 87 | }; |
| 88 | |
| 89 | static u16 r2057_rev8_init[54][2] = { |
| 90 | { 0x00, 0x08 }, { 0x01, 0x57 }, { 0x02, 0x20 }, { 0x31, 0x00 }, |
| 91 | { 0x32, 0x00 }, { 0x33, 0x00 }, { 0x51, 0x70 }, { 0x59, 0x88 }, |
| 92 | { 0x5C, 0x20 }, { 0x62, 0x33 }, { 0x63, 0x0f }, { 0x64, 0x0f }, |
| 93 | { 0x6E, 0x58 }, { 0x75, 0x13 }, { 0x7B, 0x13 }, { 0x7C, 0x0f }, |
| 94 | { 0x7D, 0xee }, { 0x81, 0x01 }, { 0x91, 0x3f }, { 0x92, 0x36 }, |
| 95 | { 0xA1, 0x20 }, { 0xC9, 0x01 }, { 0xD6, 0x70 }, { 0xDE, 0x88 }, |
| 96 | { 0xE1, 0x20 }, { 0xE8, 0x0f }, { 0xE9, 0x0f }, { 0xF3, 0x58 }, |
| 97 | { 0xFA, 0x13 }, { 0x100, 0x13 }, { 0x101, 0x0f }, { 0x102, 0xee }, |
| 98 | { 0x106, 0x01 }, { 0x116, 0x3f }, { 0x117, 0x36 }, { 0x126, 0x20 }, |
| 99 | { 0x14E, 0x01 }, { 0x15E, 0x00 }, { 0x15F, 0x00 }, { 0x160, 0x00 }, |
| 100 | { 0x161, 0x00 }, { 0x162, 0x00 }, { 0x163, 0x00 }, { 0x16A, 0x00 }, |
| 101 | { 0x16B, 0x00 }, { 0x16C, 0x00 }, { 0x1A4, 0x00 }, { 0x1A5, 0x00 }, |
| 102 | { 0x1A6, 0x00 }, { 0x1AA, 0x00 }, { 0x1AB, 0x00 }, { 0x1AC, 0x00 }, |
| 103 | { 0x1B7, 0x05 }, { 0x1C2, 0xa0 }, |
| 104 | }; |
| 105 | |
| 106 | void r2057_upload_inittabs(struct b43_wldev *dev) |
| 107 | { |
| 108 | struct b43_phy *phy = &dev->phy; |
| 109 | u16 *table = NULL; |
| 110 | u16 size, i; |
| 111 | |
| 112 | if (phy->rev == 7) { |
| 113 | table = r2057_rev4_init[0]; |
| 114 | size = ARRAY_SIZE(r2057_rev4_init); |
| 115 | } else if (phy->rev == 8 || phy->rev == 9) { |
| 116 | if (phy->radio_rev == 5) { |
| 117 | if (phy->radio_rev == 8) { |
| 118 | table = r2057_rev5_init[0]; |
| 119 | size = ARRAY_SIZE(r2057_rev5_init); |
| 120 | } else { |
| 121 | table = r2057_rev5a_init[0]; |
| 122 | size = ARRAY_SIZE(r2057_rev5a_init); |
| 123 | } |
| 124 | } else if (phy->radio_rev == 7) { |
| 125 | table = r2057_rev7_init[0]; |
| 126 | size = ARRAY_SIZE(r2057_rev7_init); |
| 127 | } else if (phy->radio_rev == 9) { |
| 128 | table = r2057_rev8_init[0]; |
| 129 | size = ARRAY_SIZE(r2057_rev8_init); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | if (table) { |
| 134 | for (i = 0; i < 10; i++) { |
| 135 | pr_info("radio_write 0x%X ", *table); |
| 136 | table++; |
| 137 | pr_info("0x%X\n", *table); |
| 138 | table++; |
| 139 | } |
| 140 | } |
| 141 | } |