| 1 | From c1999a36c113e583f785728b3d8f7a26412c61cd Mon Sep 17 00:00:00 2001 |
| 2 | From: Gabor Juhos <juhosg@openwrt.org> |
| 3 | Date: Fri, 18 Nov 2011 00:17:54 +0000 |
| 4 | Subject: [PATCH 26/27] MIPS: ath79: Rename dev-ar913x-wmac.c to dev-wmac.c |
| 5 | |
| 6 | Rename the file as a last step of the 'ar913x' removal changes. |
| 7 | |
| 8 | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> |
| 9 | Cc: Imre Kaloz <kaloz@openwrt.org> |
| 10 | Cc: linux-mips@linux-mips.org |
| 11 | Patchwork: https://patchwork.linux-mips.org/patch/3034/ |
| 12 | Signed-off-by: Ralf Baechle <ralf@linux-mips.org> |
| 13 | --- |
| 14 | arch/mips/ath79/Makefile | 2 +- |
| 15 | arch/mips/ath79/dev-ar913x-wmac.c | 109 ------------------------------------- |
| 16 | arch/mips/ath79/dev-wmac.c | 109 +++++++++++++++++++++++++++++++++++++ |
| 17 | 3 files changed, 110 insertions(+), 110 deletions(-) |
| 18 | delete mode 100644 arch/mips/ath79/dev-ar913x-wmac.c |
| 19 | create mode 100644 arch/mips/ath79/dev-wmac.c |
| 20 | |
| 21 | --- a/arch/mips/ath79/Makefile |
| 22 | +++ b/arch/mips/ath79/Makefile |
| 23 | @@ -20,7 +20,7 @@ obj-$(CONFIG_ATH79_DEV_GPIO_BUTTONS) += |
| 24 | obj-$(CONFIG_ATH79_DEV_LEDS_GPIO) += dev-leds-gpio.o |
| 25 | obj-$(CONFIG_ATH79_DEV_SPI) += dev-spi.o |
| 26 | obj-$(CONFIG_ATH79_DEV_USB) += dev-usb.o |
| 27 | -obj-$(CONFIG_ATH79_DEV_WMAC) += dev-ar913x-wmac.o |
| 28 | +obj-$(CONFIG_ATH79_DEV_WMAC) += dev-wmac.o |
| 29 | |
| 30 | # |
| 31 | # Machines |
| 32 | --- a/arch/mips/ath79/dev-ar913x-wmac.c |
| 33 | +++ /dev/null |
| 34 | @@ -1,109 +0,0 @@ |
| 35 | -/* |
| 36 | - * Atheros AR913X/AR933X SoC built-in WMAC device support |
| 37 | - * |
| 38 | - * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org> |
| 39 | - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> |
| 40 | - * |
| 41 | - * This program is free software; you can redistribute it and/or modify it |
| 42 | - * under the terms of the GNU General Public License version 2 as published |
| 43 | - * by the Free Software Foundation. |
| 44 | - */ |
| 45 | - |
| 46 | -#include <linux/init.h> |
| 47 | -#include <linux/delay.h> |
| 48 | -#include <linux/irq.h> |
| 49 | -#include <linux/platform_device.h> |
| 50 | -#include <linux/ath9k_platform.h> |
| 51 | - |
| 52 | -#include <asm/mach-ath79/ath79.h> |
| 53 | -#include <asm/mach-ath79/ar71xx_regs.h> |
| 54 | -#include "dev-wmac.h" |
| 55 | - |
| 56 | -static struct ath9k_platform_data ath79_wmac_data; |
| 57 | - |
| 58 | -static struct resource ath79_wmac_resources[] = { |
| 59 | - { |
| 60 | - /* .start and .end fields are filled dynamically */ |
| 61 | - .flags = IORESOURCE_MEM, |
| 62 | - }, { |
| 63 | - .start = ATH79_CPU_IRQ_IP2, |
| 64 | - .end = ATH79_CPU_IRQ_IP2, |
| 65 | - .flags = IORESOURCE_IRQ, |
| 66 | - }, |
| 67 | -}; |
| 68 | - |
| 69 | -static struct platform_device ath79_wmac_device = { |
| 70 | - .name = "ath9k", |
| 71 | - .id = -1, |
| 72 | - .resource = ath79_wmac_resources, |
| 73 | - .num_resources = ARRAY_SIZE(ath79_wmac_resources), |
| 74 | - .dev = { |
| 75 | - .platform_data = &ath79_wmac_data, |
| 76 | - }, |
| 77 | -}; |
| 78 | - |
| 79 | -static void __init ar913x_wmac_setup(void) |
| 80 | -{ |
| 81 | - /* reset the WMAC */ |
| 82 | - ath79_device_reset_set(AR913X_RESET_AMBA2WMAC); |
| 83 | - mdelay(10); |
| 84 | - |
| 85 | - ath79_device_reset_clear(AR913X_RESET_AMBA2WMAC); |
| 86 | - mdelay(10); |
| 87 | - |
| 88 | - ath79_wmac_resources[0].start = AR913X_WMAC_BASE; |
| 89 | - ath79_wmac_resources[0].end = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1; |
| 90 | -} |
| 91 | - |
| 92 | - |
| 93 | -static int ar933x_wmac_reset(void) |
| 94 | -{ |
| 95 | - ath79_device_reset_clear(AR933X_RESET_WMAC); |
| 96 | - ath79_device_reset_set(AR933X_RESET_WMAC); |
| 97 | - |
| 98 | - return 0; |
| 99 | -} |
| 100 | - |
| 101 | -static int ar933x_r1_get_wmac_revision(void) |
| 102 | -{ |
| 103 | - return ath79_soc_rev; |
| 104 | -} |
| 105 | - |
| 106 | -static void __init ar933x_wmac_setup(void) |
| 107 | -{ |
| 108 | - u32 t; |
| 109 | - |
| 110 | - ar933x_wmac_reset(); |
| 111 | - |
| 112 | - ath79_wmac_device.name = "ar933x_wmac"; |
| 113 | - |
| 114 | - ath79_wmac_resources[0].start = AR933X_WMAC_BASE; |
| 115 | - ath79_wmac_resources[0].end = AR933X_WMAC_BASE + AR933X_WMAC_SIZE - 1; |
| 116 | - |
| 117 | - t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP); |
| 118 | - if (t & AR933X_BOOTSTRAP_REF_CLK_40) |
| 119 | - ath79_wmac_data.is_clk_25mhz = false; |
| 120 | - else |
| 121 | - ath79_wmac_data.is_clk_25mhz = true; |
| 122 | - |
| 123 | - if (ath79_soc_rev == 1) |
| 124 | - ath79_wmac_data.get_mac_revision = ar933x_r1_get_wmac_revision; |
| 125 | - |
| 126 | - ath79_wmac_data.external_reset = ar933x_wmac_reset; |
| 127 | -} |
| 128 | - |
| 129 | -void __init ath79_register_wmac(u8 *cal_data) |
| 130 | -{ |
| 131 | - if (soc_is_ar913x()) |
| 132 | - ar913x_wmac_setup(); |
| 133 | - if (soc_is_ar933x()) |
| 134 | - ar933x_wmac_setup(); |
| 135 | - else |
| 136 | - BUG(); |
| 137 | - |
| 138 | - if (cal_data) |
| 139 | - memcpy(ath79_wmac_data.eeprom_data, cal_data, |
| 140 | - sizeof(ath79_wmac_data.eeprom_data)); |
| 141 | - |
| 142 | - platform_device_register(&ath79_wmac_device); |
| 143 | -} |
| 144 | --- /dev/null |
| 145 | +++ b/arch/mips/ath79/dev-wmac.c |
| 146 | @@ -0,0 +1,109 @@ |
| 147 | +/* |
| 148 | + * Atheros AR913X/AR933X SoC built-in WMAC device support |
| 149 | + * |
| 150 | + * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org> |
| 151 | + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> |
| 152 | + * |
| 153 | + * This program is free software; you can redistribute it and/or modify it |
| 154 | + * under the terms of the GNU General Public License version 2 as published |
| 155 | + * by the Free Software Foundation. |
| 156 | + */ |
| 157 | + |
| 158 | +#include <linux/init.h> |
| 159 | +#include <linux/delay.h> |
| 160 | +#include <linux/irq.h> |
| 161 | +#include <linux/platform_device.h> |
| 162 | +#include <linux/ath9k_platform.h> |
| 163 | + |
| 164 | +#include <asm/mach-ath79/ath79.h> |
| 165 | +#include <asm/mach-ath79/ar71xx_regs.h> |
| 166 | +#include "dev-wmac.h" |
| 167 | + |
| 168 | +static struct ath9k_platform_data ath79_wmac_data; |
| 169 | + |
| 170 | +static struct resource ath79_wmac_resources[] = { |
| 171 | + { |
| 172 | + /* .start and .end fields are filled dynamically */ |
| 173 | + .flags = IORESOURCE_MEM, |
| 174 | + }, { |
| 175 | + .start = ATH79_CPU_IRQ_IP2, |
| 176 | + .end = ATH79_CPU_IRQ_IP2, |
| 177 | + .flags = IORESOURCE_IRQ, |
| 178 | + }, |
| 179 | +}; |
| 180 | + |
| 181 | +static struct platform_device ath79_wmac_device = { |
| 182 | + .name = "ath9k", |
| 183 | + .id = -1, |
| 184 | + .resource = ath79_wmac_resources, |
| 185 | + .num_resources = ARRAY_SIZE(ath79_wmac_resources), |
| 186 | + .dev = { |
| 187 | + .platform_data = &ath79_wmac_data, |
| 188 | + }, |
| 189 | +}; |
| 190 | + |
| 191 | +static void __init ar913x_wmac_setup(void) |
| 192 | +{ |
| 193 | + /* reset the WMAC */ |
| 194 | + ath79_device_reset_set(AR913X_RESET_AMBA2WMAC); |
| 195 | + mdelay(10); |
| 196 | + |
| 197 | + ath79_device_reset_clear(AR913X_RESET_AMBA2WMAC); |
| 198 | + mdelay(10); |
| 199 | + |
| 200 | + ath79_wmac_resources[0].start = AR913X_WMAC_BASE; |
| 201 | + ath79_wmac_resources[0].end = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1; |
| 202 | +} |
| 203 | + |
| 204 | + |
| 205 | +static int ar933x_wmac_reset(void) |
| 206 | +{ |
| 207 | + ath79_device_reset_clear(AR933X_RESET_WMAC); |
| 208 | + ath79_device_reset_set(AR933X_RESET_WMAC); |
| 209 | + |
| 210 | + return 0; |
| 211 | +} |
| 212 | + |
| 213 | +static int ar933x_r1_get_wmac_revision(void) |
| 214 | +{ |
| 215 | + return ath79_soc_rev; |
| 216 | +} |
| 217 | + |
| 218 | +static void __init ar933x_wmac_setup(void) |
| 219 | +{ |
| 220 | + u32 t; |
| 221 | + |
| 222 | + ar933x_wmac_reset(); |
| 223 | + |
| 224 | + ath79_wmac_device.name = "ar933x_wmac"; |
| 225 | + |
| 226 | + ath79_wmac_resources[0].start = AR933X_WMAC_BASE; |
| 227 | + ath79_wmac_resources[0].end = AR933X_WMAC_BASE + AR933X_WMAC_SIZE - 1; |
| 228 | + |
| 229 | + t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP); |
| 230 | + if (t & AR933X_BOOTSTRAP_REF_CLK_40) |
| 231 | + ath79_wmac_data.is_clk_25mhz = false; |
| 232 | + else |
| 233 | + ath79_wmac_data.is_clk_25mhz = true; |
| 234 | + |
| 235 | + if (ath79_soc_rev == 1) |
| 236 | + ath79_wmac_data.get_mac_revision = ar933x_r1_get_wmac_revision; |
| 237 | + |
| 238 | + ath79_wmac_data.external_reset = ar933x_wmac_reset; |
| 239 | +} |
| 240 | + |
| 241 | +void __init ath79_register_wmac(u8 *cal_data) |
| 242 | +{ |
| 243 | + if (soc_is_ar913x()) |
| 244 | + ar913x_wmac_setup(); |
| 245 | + if (soc_is_ar933x()) |
| 246 | + ar933x_wmac_setup(); |
| 247 | + else |
| 248 | + BUG(); |
| 249 | + |
| 250 | + if (cal_data) |
| 251 | + memcpy(ath79_wmac_data.eeprom_data, cal_data, |
| 252 | + sizeof(ath79_wmac_data.eeprom_data)); |
| 253 | + |
| 254 | + platform_device_register(&ath79_wmac_device); |
| 255 | +} |
| 256 | |