diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-12-02 04:27:16 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-02 15:17:51 -0500 |
commit | a0b907ee2a71052fefdf6151764095f3f97b3275 (patch) | |
tree | 5fff68f446e400617e4d7c7f700eeebf4b7222dd /drivers/net | |
parent | c31b5c9c806b1fbdc9e98885d897664a0d482989 (diff) |
ath5k: Add AHB bus support.
AHB specific functions are now in ahb.c file. AHB bus is
compiled in when CONFIG_ATHEROS_AR231X is set in kernel.
All other platforms will use PCI bus.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/Kconfig | 17 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/Makefile | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ahb.c | 219 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ath5k.h | 40 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/led.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/reg.h | 25 |
7 files changed, 322 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath5k/Kconfig b/drivers/net/wireless/ath/ath5k/Kconfig index 47844575caa3..e0793319389d 100644 --- a/drivers/net/wireless/ath/ath5k/Kconfig +++ b/drivers/net/wireless/ath/ath5k/Kconfig | |||
@@ -1,10 +1,12 @@ | |||
1 | config ATH5K | 1 | config ATH5K |
2 | tristate "Atheros 5xxx wireless cards support" | 2 | tristate "Atheros 5xxx wireless cards support" |
3 | depends on PCI && MAC80211 | 3 | depends on (PCI || ATHEROS_AR231X) && MAC80211 |
4 | select MAC80211_LEDS | 4 | select MAC80211_LEDS |
5 | select LEDS_CLASS | 5 | select LEDS_CLASS |
6 | select NEW_LEDS | 6 | select NEW_LEDS |
7 | select AVERAGE | 7 | select AVERAGE |
8 | select ATH5K_AHB if (ATHEROS_AR231X && !PCI) | ||
9 | select ATH5K_PCI if (!ATHEROS_AR231X && PCI) | ||
8 | ---help--- | 10 | ---help--- |
9 | This module adds support for wireless adapters based on | 11 | This module adds support for wireless adapters based on |
10 | Atheros 5xxx chipset. | 12 | Atheros 5xxx chipset. |
@@ -38,3 +40,16 @@ config ATH5K_DEBUG | |||
38 | 40 | ||
39 | modprobe ath5k debug=0x00000400 | 41 | modprobe ath5k debug=0x00000400 |
40 | 42 | ||
43 | config ATH5K_AHB | ||
44 | bool "Atheros 5xxx AHB bus support" | ||
45 | depends on (ATHEROS_AR231X && !PCI) | ||
46 | ---help--- | ||
47 | This adds support for WiSoC type chipsets of the 5xxx Atheros | ||
48 | family. | ||
49 | |||
50 | config ATH5K_PCI | ||
51 | bool "Atheros 5xxx PCI bus support" | ||
52 | depends on (!ATHEROS_AR231X && PCI) | ||
53 | ---help--- | ||
54 | This adds support for PCI type chipsets of the 5xxx Atheros | ||
55 | family. | ||
diff --git a/drivers/net/wireless/ath/ath5k/Makefile b/drivers/net/wireless/ath/ath5k/Makefile index dae881cd7dd1..67dd9fd0650e 100644 --- a/drivers/net/wireless/ath/ath5k/Makefile +++ b/drivers/net/wireless/ath/ath5k/Makefile | |||
@@ -15,5 +15,6 @@ ath5k-y += rfkill.o | |||
15 | ath5k-y += ani.o | 15 | ath5k-y += ani.o |
16 | ath5k-y += sysfs.o | 16 | ath5k-y += sysfs.o |
17 | ath5k-$(CONFIG_ATH5K_DEBUG) += debug.o | 17 | ath5k-$(CONFIG_ATH5K_DEBUG) += debug.o |
18 | ath5k-y += pci.o | 18 | ath5k-$(CONFIG_ATH5K_AHB) += ahb.o |
19 | ath5k-$(CONFIG_ATH5K_PCI) += pci.o | ||
19 | obj-$(CONFIG_ATH5K) += ath5k.o | 20 | obj-$(CONFIG_ATH5K) += ath5k.o |
diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c new file mode 100644 index 000000000000..707cde149248 --- /dev/null +++ b/drivers/net/wireless/ath/ath5k/ahb.c | |||
@@ -0,0 +1,219 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2008-2009 Atheros Communications Inc. | ||
3 | * Copyright (c) 2009 Gabor Juhos <juhosg@openwrt.org> | ||
4 | * Copyright (c) 2009 Imre Kaloz <kaloz@openwrt.org> | ||
5 | * | ||
6 | * Permission to use, copy, modify, and/or distribute this software for any | ||
7 | * purpose with or without fee is hereby granted, provided that the above | ||
8 | * copyright notice and this permission notice appear in all copies. | ||
9 | * | ||
10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
17 | */ | ||
18 | |||
19 | #include <linux/nl80211.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <ar231x_platform.h> | ||
22 | #include "ath5k.h" | ||
23 | #include "debug.h" | ||
24 | #include "base.h" | ||
25 | #include "reg.h" | ||
26 | #include "debug.h" | ||
27 | |||
28 | /* return bus cachesize in 4B word units */ | ||
29 | static void ath5k_ahb_read_cachesize(struct ath_common *common, int *csz) | ||
30 | { | ||
31 | *csz = L1_CACHE_BYTES >> 2; | ||
32 | } | ||
33 | |||
34 | bool ath5k_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data) | ||
35 | { | ||
36 | struct ath5k_softc *sc = common->priv; | ||
37 | struct platform_device *pdev = to_platform_device(sc->dev); | ||
38 | struct ar231x_board_config *bcfg = pdev->dev.platform_data; | ||
39 | u16 *eeprom, *eeprom_end; | ||
40 | |||
41 | |||
42 | |||
43 | bcfg = pdev->dev.platform_data; | ||
44 | eeprom = (u16 *) bcfg->radio; | ||
45 | eeprom_end = ((void *) bcfg->config) + BOARD_CONFIG_BUFSZ; | ||
46 | |||
47 | eeprom += off; | ||
48 | if (eeprom > eeprom_end) | ||
49 | return -EINVAL; | ||
50 | |||
51 | *data = *eeprom; | ||
52 | return 0; | ||
53 | } | ||
54 | |||
55 | int ath5k_hw_read_srev(struct ath5k_hw *ah) | ||
56 | { | ||
57 | struct ath5k_softc *sc = ah->ah_sc; | ||
58 | struct platform_device *pdev = to_platform_device(sc->dev); | ||
59 | struct ar231x_board_config *bcfg = pdev->dev.platform_data; | ||
60 | ah->ah_mac_srev = bcfg->devid; | ||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | static const struct ath_bus_ops ath_ahb_bus_ops = { | ||
65 | .ath_bus_type = ATH_AHB, | ||
66 | .read_cachesize = ath5k_ahb_read_cachesize, | ||
67 | .eeprom_read = ath5k_ahb_eeprom_read, | ||
68 | }; | ||
69 | |||
70 | /*Initialization*/ | ||
71 | static int ath_ahb_probe(struct platform_device *pdev) | ||
72 | { | ||
73 | struct ar231x_board_config *bcfg = pdev->dev.platform_data; | ||
74 | struct ath5k_softc *sc; | ||
75 | struct ieee80211_hw *hw; | ||
76 | struct resource *res; | ||
77 | void __iomem *mem; | ||
78 | int irq; | ||
79 | int ret = 0; | ||
80 | u32 reg; | ||
81 | |||
82 | if (!pdev->dev.platform_data) { | ||
83 | dev_err(&pdev->dev, "no platform data specified\n"); | ||
84 | ret = -EINVAL; | ||
85 | goto err_out; | ||
86 | } | ||
87 | |||
88 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
89 | if (res == NULL) { | ||
90 | dev_err(&pdev->dev, "no memory resource found\n"); | ||
91 | ret = -ENXIO; | ||
92 | goto err_out; | ||
93 | } | ||
94 | |||
95 | mem = ioremap_nocache(res->start, res->end - res->start + 1); | ||
96 | if (mem == NULL) { | ||
97 | dev_err(&pdev->dev, "ioremap failed\n"); | ||
98 | ret = -ENOMEM; | ||
99 | goto err_out; | ||
100 | } | ||
101 | |||
102 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | ||
103 | if (res == NULL) { | ||
104 | dev_err(&pdev->dev, "no IRQ resource found\n"); | ||
105 | ret = -ENXIO; | ||
106 | goto err_out; | ||
107 | } | ||
108 | |||
109 | irq = res->start; | ||
110 | |||
111 | hw = ieee80211_alloc_hw(sizeof(struct ath5k_softc), &ath5k_hw_ops); | ||
112 | if (hw == NULL) { | ||
113 | dev_err(&pdev->dev, "no memory for ieee80211_hw\n"); | ||
114 | ret = -ENOMEM; | ||
115 | goto err_out; | ||
116 | } | ||
117 | |||
118 | sc = hw->priv; | ||
119 | sc->hw = hw; | ||
120 | sc->dev = &pdev->dev; | ||
121 | sc->iobase = mem; | ||
122 | sc->irq = irq; | ||
123 | sc->devid = bcfg->devid; | ||
124 | |||
125 | if (bcfg->devid >= AR5K_SREV_AR2315_R6) { | ||
126 | /* Enable WMAC AHB arbitration */ | ||
127 | reg = __raw_readl((void __iomem *) AR5K_AR2315_AHB_ARB_CTL); | ||
128 | reg |= AR5K_AR2315_AHB_ARB_CTL_WLAN; | ||
129 | __raw_writel(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL); | ||
130 | |||
131 | /* Enable global WMAC swapping */ | ||
132 | reg = __raw_readl((void __iomem *) AR5K_AR2315_BYTESWAP); | ||
133 | reg |= AR5K_AR2315_BYTESWAP_WMAC; | ||
134 | __raw_writel(reg, (void __iomem *) AR5K_AR2315_BYTESWAP); | ||
135 | } else { | ||
136 | /* Enable WMAC DMA access (assuming 5312 or 231x*/ | ||
137 | /* TODO: check other platforms */ | ||
138 | reg = __raw_readl((void __iomem *) AR5K_AR5312_ENABLE); | ||
139 | if (to_platform_device(sc->dev)->id == 0) | ||
140 | reg |= AR5K_AR5312_ENABLE_WLAN0; | ||
141 | else | ||
142 | reg |= AR5K_AR5312_ENABLE_WLAN1; | ||
143 | __raw_writel(reg, (void __iomem *) AR5K_AR5312_ENABLE); | ||
144 | } | ||
145 | |||
146 | ret = ath5k_init_softc(sc, &ath_ahb_bus_ops); | ||
147 | if (ret != 0) { | ||
148 | dev_err(&pdev->dev, "failed to attach device, err=%d\n", ret); | ||
149 | ret = -ENODEV; | ||
150 | goto err_free_hw; | ||
151 | } | ||
152 | |||
153 | platform_set_drvdata(pdev, hw); | ||
154 | |||
155 | return 0; | ||
156 | |||
157 | err_free_hw: | ||
158 | ieee80211_free_hw(hw); | ||
159 | platform_set_drvdata(pdev, NULL); | ||
160 | err_out: | ||
161 | return ret; | ||
162 | } | ||
163 | |||
164 | static int ath_ahb_remove(struct platform_device *pdev) | ||
165 | { | ||
166 | struct ar231x_board_config *bcfg = pdev->dev.platform_data; | ||
167 | struct ieee80211_hw *hw = platform_get_drvdata(pdev); | ||
168 | struct ath5k_softc *sc; | ||
169 | u32 reg; | ||
170 | |||
171 | if (!hw) | ||
172 | return 0; | ||
173 | |||
174 | sc = hw->priv; | ||
175 | |||
176 | if (bcfg->devid >= AR5K_SREV_AR2315_R6) { | ||
177 | /* Disable WMAC AHB arbitration */ | ||
178 | reg = __raw_readl((void __iomem *) AR5K_AR2315_AHB_ARB_CTL); | ||
179 | reg &= ~AR5K_AR2315_AHB_ARB_CTL_WLAN; | ||
180 | __raw_writel(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL); | ||
181 | } else { | ||
182 | /*Stop DMA access */ | ||
183 | reg = __raw_readl((void __iomem *) AR5K_AR5312_ENABLE); | ||
184 | if (to_platform_device(sc->dev)->id == 0) | ||
185 | reg &= ~AR5K_AR5312_ENABLE_WLAN0; | ||
186 | else | ||
187 | reg &= ~AR5K_AR5312_ENABLE_WLAN1; | ||
188 | __raw_writel(reg, (void __iomem *) AR5K_AR5312_ENABLE); | ||
189 | } | ||
190 | |||
191 | ath5k_deinit_softc(sc); | ||
192 | platform_set_drvdata(pdev, NULL); | ||
193 | |||
194 | return 0; | ||
195 | } | ||
196 | |||
197 | static struct platform_driver ath_ahb_driver = { | ||
198 | .probe = ath_ahb_probe, | ||
199 | .remove = ath_ahb_remove, | ||
200 | .driver = { | ||
201 | .name = "ar231x-wmac", | ||
202 | .owner = THIS_MODULE, | ||
203 | }, | ||
204 | }; | ||
205 | |||
206 | static int __init | ||
207 | ath5k_ahb_init(void) | ||
208 | { | ||
209 | return platform_driver_register(&ath_ahb_driver); | ||
210 | } | ||
211 | |||
212 | static void __exit | ||
213 | ath5k_ahb_exit(void) | ||
214 | { | ||
215 | platform_driver_unregister(&ath_ahb_driver); | ||
216 | } | ||
217 | |||
218 | module_init(ath5k_ahb_init); | ||
219 | module_exit(ath5k_ahb_exit); | ||
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h index 5e525eba61be..d6e744088bc6 100644 --- a/drivers/net/wireless/ath/ath5k/ath5k.h +++ b/drivers/net/wireless/ath/ath5k/ath5k.h | |||
@@ -319,12 +319,19 @@ struct ath5k_srev_name { | |||
319 | #define AR5K_SREV_AR5311B 0x30 /* Spirit */ | 319 | #define AR5K_SREV_AR5311B 0x30 /* Spirit */ |
320 | #define AR5K_SREV_AR5211 0x40 /* Oahu */ | 320 | #define AR5K_SREV_AR5211 0x40 /* Oahu */ |
321 | #define AR5K_SREV_AR5212 0x50 /* Venice */ | 321 | #define AR5K_SREV_AR5212 0x50 /* Venice */ |
322 | #define AR5K_SREV_AR5312_R2 0x52 /* AP31 */ | ||
322 | #define AR5K_SREV_AR5212_V4 0x54 /* ??? */ | 323 | #define AR5K_SREV_AR5212_V4 0x54 /* ??? */ |
323 | #define AR5K_SREV_AR5213 0x55 /* ??? */ | 324 | #define AR5K_SREV_AR5213 0x55 /* ??? */ |
325 | #define AR5K_SREV_AR5312_R7 0x57 /* AP30 */ | ||
326 | #define AR5K_SREV_AR2313_R8 0x58 /* AP43 */ | ||
324 | #define AR5K_SREV_AR5213A 0x59 /* Hainan */ | 327 | #define AR5K_SREV_AR5213A 0x59 /* Hainan */ |
325 | #define AR5K_SREV_AR2413 0x78 /* Griffin lite */ | 328 | #define AR5K_SREV_AR2413 0x78 /* Griffin lite */ |
326 | #define AR5K_SREV_AR2414 0x70 /* Griffin */ | 329 | #define AR5K_SREV_AR2414 0x70 /* Griffin */ |
330 | #define AR5K_SREV_AR2315_R6 0x86 /* AP51-Light */ | ||
331 | #define AR5K_SREV_AR2315_R7 0x87 /* AP51-Full */ | ||
327 | #define AR5K_SREV_AR5424 0x90 /* Condor */ | 332 | #define AR5K_SREV_AR5424 0x90 /* Condor */ |
333 | #define AR5K_SREV_AR2317_R1 0x90 /* AP61-Light */ | ||
334 | #define AR5K_SREV_AR2317_R2 0x91 /* AP61-Full */ | ||
328 | #define AR5K_SREV_AR5413 0xa4 /* Eagle lite */ | 335 | #define AR5K_SREV_AR5413 0xa4 /* Eagle lite */ |
329 | #define AR5K_SREV_AR5414 0xa0 /* Eagle */ | 336 | #define AR5K_SREV_AR5414 0xa0 /* Eagle */ |
330 | #define AR5K_SREV_AR2415 0xb0 /* Talon */ | 337 | #define AR5K_SREV_AR2415 0xb0 /* Talon */ |
@@ -1329,6 +1336,32 @@ static inline struct ath_regulatory *ath5k_hw_regulatory(struct ath5k_hw *ah) | |||
1329 | return &(ath5k_hw_common(ah)->regulatory); | 1336 | return &(ath5k_hw_common(ah)->regulatory); |
1330 | } | 1337 | } |
1331 | 1338 | ||
1339 | #ifdef CONFIG_ATHEROS_AR231X | ||
1340 | #define AR5K_AR2315_PCI_BASE ((void __iomem *)0xb0100000) | ||
1341 | |||
1342 | static inline void __iomem *ath5k_ahb_reg(struct ath5k_hw *ah, u16 reg) | ||
1343 | { | ||
1344 | /* On AR2315 and AR2317 the PCI clock domain registers | ||
1345 | * are outside of the WMAC register space */ | ||
1346 | if (unlikely((reg >= 0x4000) && (reg < 0x5000) && | ||
1347 | (ah->ah_mac_srev >= AR5K_SREV_AR2315_R6))) | ||
1348 | return AR5K_AR2315_PCI_BASE + reg; | ||
1349 | |||
1350 | return ah->ah_iobase + reg; | ||
1351 | } | ||
1352 | |||
1353 | static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg) | ||
1354 | { | ||
1355 | return __raw_readl(ath5k_ahb_reg(ah, reg)); | ||
1356 | } | ||
1357 | |||
1358 | static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg) | ||
1359 | { | ||
1360 | __raw_writel(val, ath5k_ahb_reg(ah, reg)); | ||
1361 | } | ||
1362 | |||
1363 | #else | ||
1364 | |||
1332 | static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg) | 1365 | static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg) |
1333 | { | 1366 | { |
1334 | return ioread32(ah->ah_iobase + reg); | 1367 | return ioread32(ah->ah_iobase + reg); |
@@ -1339,6 +1372,13 @@ static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg) | |||
1339 | iowrite32(val, ah->ah_iobase + reg); | 1372 | iowrite32(val, ah->ah_iobase + reg); |
1340 | } | 1373 | } |
1341 | 1374 | ||
1375 | #endif | ||
1376 | |||
1377 | static inline enum ath_bus_type ath5k_get_bus_type(struct ath5k_hw *ah) | ||
1378 | { | ||
1379 | return ath5k_hw_common(ah)->bus_ops->ath_bus_type; | ||
1380 | } | ||
1381 | |||
1342 | static inline void ath5k_read_cachesize(struct ath_common *common, int *csz) | 1382 | static inline void ath5k_read_cachesize(struct ath_common *common, int *csz) |
1343 | { | 1383 | { |
1344 | common->bus_ops->read_cachesize(common, csz); | 1384 | common->bus_ops->read_cachesize(common, csz); |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 9fcc4e14d1e5..685de2d75725 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -87,6 +87,15 @@ static void ath5k_beacon_update_timers(struct ath5k_softc *sc, u64 bc_tsf); | |||
87 | 87 | ||
88 | /* Known SREVs */ | 88 | /* Known SREVs */ |
89 | static const struct ath5k_srev_name srev_names[] = { | 89 | static const struct ath5k_srev_name srev_names[] = { |
90 | #ifdef CONFIG_ATHEROS_AR231X | ||
91 | { "5312", AR5K_VERSION_MAC, AR5K_SREV_AR5312_R2 }, | ||
92 | { "5312", AR5K_VERSION_MAC, AR5K_SREV_AR5312_R7 }, | ||
93 | { "2313", AR5K_VERSION_MAC, AR5K_SREV_AR2313_R8 }, | ||
94 | { "2315", AR5K_VERSION_MAC, AR5K_SREV_AR2315_R6 }, | ||
95 | { "2315", AR5K_VERSION_MAC, AR5K_SREV_AR2315_R7 }, | ||
96 | { "2317", AR5K_VERSION_MAC, AR5K_SREV_AR2317_R1 }, | ||
97 | { "2317", AR5K_VERSION_MAC, AR5K_SREV_AR2317_R2 }, | ||
98 | #else | ||
90 | { "5210", AR5K_VERSION_MAC, AR5K_SREV_AR5210 }, | 99 | { "5210", AR5K_VERSION_MAC, AR5K_SREV_AR5210 }, |
91 | { "5311", AR5K_VERSION_MAC, AR5K_SREV_AR5311 }, | 100 | { "5311", AR5K_VERSION_MAC, AR5K_SREV_AR5311 }, |
92 | { "5311A", AR5K_VERSION_MAC, AR5K_SREV_AR5311A }, | 101 | { "5311A", AR5K_VERSION_MAC, AR5K_SREV_AR5311A }, |
@@ -105,6 +114,7 @@ static const struct ath5k_srev_name srev_names[] = { | |||
105 | { "5418", AR5K_VERSION_MAC, AR5K_SREV_AR5418 }, | 114 | { "5418", AR5K_VERSION_MAC, AR5K_SREV_AR5418 }, |
106 | { "2425", AR5K_VERSION_MAC, AR5K_SREV_AR2425 }, | 115 | { "2425", AR5K_VERSION_MAC, AR5K_SREV_AR2425 }, |
107 | { "2417", AR5K_VERSION_MAC, AR5K_SREV_AR2417 }, | 116 | { "2417", AR5K_VERSION_MAC, AR5K_SREV_AR2417 }, |
117 | #endif | ||
108 | { "xxxxx", AR5K_VERSION_MAC, AR5K_SREV_UNKNOWN }, | 118 | { "xxxxx", AR5K_VERSION_MAC, AR5K_SREV_UNKNOWN }, |
109 | { "5110", AR5K_VERSION_RAD, AR5K_SREV_RAD_5110 }, | 119 | { "5110", AR5K_VERSION_RAD, AR5K_SREV_RAD_5110 }, |
110 | { "5111", AR5K_VERSION_RAD, AR5K_SREV_RAD_5111 }, | 120 | { "5111", AR5K_VERSION_RAD, AR5K_SREV_RAD_5111 }, |
@@ -118,10 +128,12 @@ static const struct ath5k_srev_name srev_names[] = { | |||
118 | { "2112B", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112B }, | 128 | { "2112B", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112B }, |
119 | { "2413", AR5K_VERSION_RAD, AR5K_SREV_RAD_2413 }, | 129 | { "2413", AR5K_VERSION_RAD, AR5K_SREV_RAD_2413 }, |
120 | { "5413", AR5K_VERSION_RAD, AR5K_SREV_RAD_5413 }, | 130 | { "5413", AR5K_VERSION_RAD, AR5K_SREV_RAD_5413 }, |
121 | { "2316", AR5K_VERSION_RAD, AR5K_SREV_RAD_2316 }, | ||
122 | { "2317", AR5K_VERSION_RAD, AR5K_SREV_RAD_2317 }, | ||
123 | { "5424", AR5K_VERSION_RAD, AR5K_SREV_RAD_5424 }, | 131 | { "5424", AR5K_VERSION_RAD, AR5K_SREV_RAD_5424 }, |
124 | { "5133", AR5K_VERSION_RAD, AR5K_SREV_RAD_5133 }, | 132 | { "5133", AR5K_VERSION_RAD, AR5K_SREV_RAD_5133 }, |
133 | #ifdef CONFIG_ATHEROS_AR231X | ||
134 | { "2316", AR5K_VERSION_RAD, AR5K_SREV_RAD_2316 }, | ||
135 | { "2317", AR5K_VERSION_RAD, AR5K_SREV_RAD_2317 }, | ||
136 | #endif | ||
125 | { "xxxxx", AR5K_VERSION_RAD, AR5K_SREV_UNKNOWN }, | 137 | { "xxxxx", AR5K_VERSION_RAD, AR5K_SREV_UNKNOWN }, |
126 | }; | 138 | }; |
127 | 139 | ||
diff --git a/drivers/net/wireless/ath/ath5k/led.c b/drivers/net/wireless/ath/ath5k/led.c index 1f5a991aa0a9..576edf2965dc 100644 --- a/drivers/net/wireless/ath/ath5k/led.c +++ b/drivers/net/wireless/ath/ath5k/led.c | |||
@@ -161,14 +161,20 @@ int ath5k_init_leds(struct ath5k_softc *sc) | |||
161 | { | 161 | { |
162 | int ret = 0; | 162 | int ret = 0; |
163 | struct ieee80211_hw *hw = sc->hw; | 163 | struct ieee80211_hw *hw = sc->hw; |
164 | #ifndef CONFIG_ATHEROS_AR231X | ||
164 | struct pci_dev *pdev = sc->pdev; | 165 | struct pci_dev *pdev = sc->pdev; |
166 | #endif | ||
165 | char name[ATH5K_LED_MAX_NAME_LEN + 1]; | 167 | char name[ATH5K_LED_MAX_NAME_LEN + 1]; |
166 | const struct pci_device_id *match; | 168 | const struct pci_device_id *match; |
167 | 169 | ||
168 | if (!sc->pdev) | 170 | if (!sc->pdev) |
169 | return 0; | 171 | return 0; |
170 | 172 | ||
173 | #ifdef CONFIG_ATHEROS_AR231X | ||
174 | match = NULL; | ||
175 | #else | ||
171 | match = pci_match_id(&ath5k_led_devices[0], pdev); | 176 | match = pci_match_id(&ath5k_led_devices[0], pdev); |
177 | #endif | ||
172 | if (match) { | 178 | if (match) { |
173 | __set_bit(ATH_STAT_LEDSOFT, sc->status); | 179 | __set_bit(ATH_STAT_LEDSOFT, sc->status); |
174 | sc->led_pin = ATH_PIN(match->driver_data); | 180 | sc->led_pin = ATH_PIN(match->driver_data); |
diff --git a/drivers/net/wireless/ath/ath5k/reg.h b/drivers/net/wireless/ath/ath5k/reg.h index 8516728a407e..7ad05d401ab5 100644 --- a/drivers/net/wireless/ath/ath5k/reg.h +++ b/drivers/net/wireless/ath/ath5k/reg.h | |||
@@ -2562,3 +2562,28 @@ | |||
2562 | */ | 2562 | */ |
2563 | #define AR5K_PHY_PDADC_TXPOWER_BASE 0xa280 | 2563 | #define AR5K_PHY_PDADC_TXPOWER_BASE 0xa280 |
2564 | #define AR5K_PHY_PDADC_TXPOWER(_n) (AR5K_PHY_PDADC_TXPOWER_BASE + ((_n) << 2)) | 2564 | #define AR5K_PHY_PDADC_TXPOWER(_n) (AR5K_PHY_PDADC_TXPOWER_BASE + ((_n) << 2)) |
2565 | |||
2566 | /* | ||
2567 | * Platform registers for WiSoC | ||
2568 | */ | ||
2569 | #define AR5K_AR5312_RESET 0xbc003020 | ||
2570 | #define AR5K_AR5312_RESET_BB0_COLD 0x00000004 | ||
2571 | #define AR5K_AR5312_RESET_BB1_COLD 0x00000200 | ||
2572 | #define AR5K_AR5312_RESET_WMAC0 0x00002000 | ||
2573 | #define AR5K_AR5312_RESET_BB0_WARM 0x00004000 | ||
2574 | #define AR5K_AR5312_RESET_WMAC1 0x00020000 | ||
2575 | #define AR5K_AR5312_RESET_BB1_WARM 0x00040000 | ||
2576 | |||
2577 | #define AR5K_AR5312_ENABLE 0xbc003080 | ||
2578 | #define AR5K_AR5312_ENABLE_WLAN0 0x00000001 | ||
2579 | #define AR5K_AR5312_ENABLE_WLAN1 0x00000008 | ||
2580 | |||
2581 | #define AR5K_AR2315_RESET 0xb1000004 | ||
2582 | #define AR5K_AR2315_RESET_WMAC 0x00000001 | ||
2583 | #define AR5K_AR2315_RESET_BB_WARM 0x00000002 | ||
2584 | |||
2585 | #define AR5K_AR2315_AHB_ARB_CTL 0xb1000008 | ||
2586 | #define AR5K_AR2315_AHB_ARB_CTL_WLAN 0x00000002 | ||
2587 | |||
2588 | #define AR5K_AR2315_BYTESWAP 0xb100000c | ||
2589 | #define AR5K_AR2315_BYTESWAP_WMAC 0x00000002 | ||