From fa34189a176636de92c5ed7e3cca5bd50a3e35cd Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Sun, 22 Jan 2012 22:38:19 +0000 Subject: ar71xx: add initial support for 3.2 Tested on the following boards: ALFA AP96 TL-MR3220 v1 TL-WR1043ND v1 TL-WR2543ND v1 TL-WR703N v1 TL-WR741ND v1 TL-WR741ND v4 WNDR3700 v1 WZR-HP-G300NH git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29868 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ...79-Rename-dev-ar913x-wmac.c-to-dev-wmac.c.patch | 255 +++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 target/linux/ar71xx/patches-3.2/026-MIPS-ath79-Rename-dev-ar913x-wmac.c-to-dev-wmac.c.patch (limited to 'target/linux/ar71xx/patches-3.2/026-MIPS-ath79-Rename-dev-ar913x-wmac.c-to-dev-wmac.c.patch') diff --git a/target/linux/ar71xx/patches-3.2/026-MIPS-ath79-Rename-dev-ar913x-wmac.c-to-dev-wmac.c.patch b/target/linux/ar71xx/patches-3.2/026-MIPS-ath79-Rename-dev-ar913x-wmac.c-to-dev-wmac.c.patch new file mode 100644 index 0000000000..c9a4ce9a1c --- /dev/null +++ b/target/linux/ar71xx/patches-3.2/026-MIPS-ath79-Rename-dev-ar913x-wmac.c-to-dev-wmac.c.patch @@ -0,0 +1,255 @@ +From c1999a36c113e583f785728b3d8f7a26412c61cd Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Fri, 18 Nov 2011 00:17:54 +0000 +Subject: [PATCH 26/27] MIPS: ath79: Rename dev-ar913x-wmac.c to dev-wmac.c + +Rename the file as a last step of the 'ar913x' removal changes. + +Signed-off-by: Gabor Juhos +Cc: Imre Kaloz +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/3034/ +Signed-off-by: Ralf Baechle +--- + arch/mips/ath79/Makefile | 2 +- + arch/mips/ath79/dev-ar913x-wmac.c | 109 ------------------------------------- + arch/mips/ath79/dev-wmac.c | 109 +++++++++++++++++++++++++++++++++++++ + 3 files changed, 110 insertions(+), 110 deletions(-) + delete mode 100644 arch/mips/ath79/dev-ar913x-wmac.c + create mode 100644 arch/mips/ath79/dev-wmac.c + +--- a/arch/mips/ath79/Makefile ++++ b/arch/mips/ath79/Makefile +@@ -20,7 +20,7 @@ obj-$(CONFIG_ATH79_DEV_GPIO_BUTTONS) += + obj-$(CONFIG_ATH79_DEV_LEDS_GPIO) += dev-leds-gpio.o + obj-$(CONFIG_ATH79_DEV_SPI) += dev-spi.o + obj-$(CONFIG_ATH79_DEV_USB) += dev-usb.o +-obj-$(CONFIG_ATH79_DEV_WMAC) += dev-ar913x-wmac.o ++obj-$(CONFIG_ATH79_DEV_WMAC) += dev-wmac.o + + # + # Machines +--- a/arch/mips/ath79/dev-ar913x-wmac.c ++++ /dev/null +@@ -1,109 +0,0 @@ +-/* +- * Atheros AR913X/AR933X SoC built-in WMAC device support +- * +- * Copyright (C) 2008-2011 Gabor Juhos +- * Copyright (C) 2008 Imre Kaloz +- * +- * This program is free software; you can redistribute it and/or modify it +- * under the terms of the GNU General Public License version 2 as published +- * by the Free Software Foundation. +- */ +- +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include "dev-wmac.h" +- +-static struct ath9k_platform_data ath79_wmac_data; +- +-static struct resource ath79_wmac_resources[] = { +- { +- /* .start and .end fields are filled dynamically */ +- .flags = IORESOURCE_MEM, +- }, { +- .start = ATH79_CPU_IRQ_IP2, +- .end = ATH79_CPU_IRQ_IP2, +- .flags = IORESOURCE_IRQ, +- }, +-}; +- +-static struct platform_device ath79_wmac_device = { +- .name = "ath9k", +- .id = -1, +- .resource = ath79_wmac_resources, +- .num_resources = ARRAY_SIZE(ath79_wmac_resources), +- .dev = { +- .platform_data = &ath79_wmac_data, +- }, +-}; +- +-static void __init ar913x_wmac_setup(void) +-{ +- /* reset the WMAC */ +- ath79_device_reset_set(AR913X_RESET_AMBA2WMAC); +- mdelay(10); +- +- ath79_device_reset_clear(AR913X_RESET_AMBA2WMAC); +- mdelay(10); +- +- ath79_wmac_resources[0].start = AR913X_WMAC_BASE; +- ath79_wmac_resources[0].end = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1; +-} +- +- +-static int ar933x_wmac_reset(void) +-{ +- ath79_device_reset_clear(AR933X_RESET_WMAC); +- ath79_device_reset_set(AR933X_RESET_WMAC); +- +- return 0; +-} +- +-static int ar933x_r1_get_wmac_revision(void) +-{ +- return ath79_soc_rev; +-} +- +-static void __init ar933x_wmac_setup(void) +-{ +- u32 t; +- +- ar933x_wmac_reset(); +- +- ath79_wmac_device.name = "ar933x_wmac"; +- +- ath79_wmac_resources[0].start = AR933X_WMAC_BASE; +- ath79_wmac_resources[0].end = AR933X_WMAC_BASE + AR933X_WMAC_SIZE - 1; +- +- t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP); +- if (t & AR933X_BOOTSTRAP_REF_CLK_40) +- ath79_wmac_data.is_clk_25mhz = false; +- else +- ath79_wmac_data.is_clk_25mhz = true; +- +- if (ath79_soc_rev == 1) +- ath79_wmac_data.get_mac_revision = ar933x_r1_get_wmac_revision; +- +- ath79_wmac_data.external_reset = ar933x_wmac_reset; +-} +- +-void __init ath79_register_wmac(u8 *cal_data) +-{ +- if (soc_is_ar913x()) +- ar913x_wmac_setup(); +- if (soc_is_ar933x()) +- ar933x_wmac_setup(); +- else +- BUG(); +- +- if (cal_data) +- memcpy(ath79_wmac_data.eeprom_data, cal_data, +- sizeof(ath79_wmac_data.eeprom_data)); +- +- platform_device_register(&ath79_wmac_device); +-} +--- /dev/null ++++ b/arch/mips/ath79/dev-wmac.c +@@ -0,0 +1,109 @@ ++/* ++ * Atheros AR913X/AR933X SoC built-in WMAC device support ++ * ++ * Copyright (C) 2008-2011 Gabor Juhos ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published ++ * by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include "dev-wmac.h" ++ ++static struct ath9k_platform_data ath79_wmac_data; ++ ++static struct resource ath79_wmac_resources[] = { ++ { ++ /* .start and .end fields are filled dynamically */ ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = ATH79_CPU_IRQ_IP2, ++ .end = ATH79_CPU_IRQ_IP2, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct platform_device ath79_wmac_device = { ++ .name = "ath9k", ++ .id = -1, ++ .resource = ath79_wmac_resources, ++ .num_resources = ARRAY_SIZE(ath79_wmac_resources), ++ .dev = { ++ .platform_data = &ath79_wmac_data, ++ }, ++}; ++ ++static void __init ar913x_wmac_setup(void) ++{ ++ /* reset the WMAC */ ++ ath79_device_reset_set(AR913X_RESET_AMBA2WMAC); ++ mdelay(10); ++ ++ ath79_device_reset_clear(AR913X_RESET_AMBA2WMAC); ++ mdelay(10); ++ ++ ath79_wmac_resources[0].start = AR913X_WMAC_BASE; ++ ath79_wmac_resources[0].end = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1; ++} ++ ++ ++static int ar933x_wmac_reset(void) ++{ ++ ath79_device_reset_clear(AR933X_RESET_WMAC); ++ ath79_device_reset_set(AR933X_RESET_WMAC); ++ ++ return 0; ++} ++ ++static int ar933x_r1_get_wmac_revision(void) ++{ ++ return ath79_soc_rev; ++} ++ ++static void __init ar933x_wmac_setup(void) ++{ ++ u32 t; ++ ++ ar933x_wmac_reset(); ++ ++ ath79_wmac_device.name = "ar933x_wmac"; ++ ++ ath79_wmac_resources[0].start = AR933X_WMAC_BASE; ++ ath79_wmac_resources[0].end = AR933X_WMAC_BASE + AR933X_WMAC_SIZE - 1; ++ ++ t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP); ++ if (t & AR933X_BOOTSTRAP_REF_CLK_40) ++ ath79_wmac_data.is_clk_25mhz = false; ++ else ++ ath79_wmac_data.is_clk_25mhz = true; ++ ++ if (ath79_soc_rev == 1) ++ ath79_wmac_data.get_mac_revision = ar933x_r1_get_wmac_revision; ++ ++ ath79_wmac_data.external_reset = ar933x_wmac_reset; ++} ++ ++void __init ath79_register_wmac(u8 *cal_data) ++{ ++ if (soc_is_ar913x()) ++ ar913x_wmac_setup(); ++ if (soc_is_ar933x()) ++ ar933x_wmac_setup(); ++ else ++ BUG(); ++ ++ if (cal_data) ++ memcpy(ath79_wmac_data.eeprom_data, cal_data, ++ sizeof(ath79_wmac_data.eeprom_data)); ++ ++ platform_device_register(&ath79_wmac_device); ++} -- cgit v1.2.3 > 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254