--- zzzz-none-000/linux-3.10.107/arch/mips/ath79/dev-wmac.c 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/arch/mips/ath79/dev-wmac.c 2021-11-10 11:53:53.000000000 +0000 @@ -20,6 +20,7 @@ #include #include +#include #include "dev-wmac.h" static struct ath9k_platform_data ath79_wmac_data; @@ -44,6 +45,7 @@ }, }; +#if defined CONFIG_SOC_AR913X static void __init ar913x_wmac_setup(void) { /* reset the WMAC */ @@ -58,8 +60,9 @@ ath79_wmac_resources[1].start = ATH79_CPU_IRQ(2); ath79_wmac_resources[1].end = ATH79_CPU_IRQ(2); } +#endif - +#if defined CONFIG_SOC_AR933X static int ar933x_wmac_reset(void) { ath79_device_reset_set(AR933X_RESET_WMAC); @@ -97,7 +100,9 @@ ath79_wmac_data.external_reset = ar933x_wmac_reset; } +#endif +#if defined CONFIG_SOC_AR934X static void ar934x_wmac_setup(void) { u32 t; @@ -115,7 +120,37 @@ else ath79_wmac_data.is_clk_25mhz = true; } +#endif + +#if (defined CONFIG_SOC_QCA953X || defined CONFIG_SOC_QCA956X) +static void qca95xx_wmac_setup(void) +{ + u32 t; + + ath79_wmac_resources[0].start = ATH_WLAN_MAC_BASE; + ath79_wmac_resources[0].end = ATH_WLAN_MAC_BASE + ATH_WLAN_MAC_SIZE - 1; + ath79_wmac_resources[1].start = ATH79_IP2_IRQ(1); + ath79_wmac_resources[1].end = ATH79_IP2_IRQ(1); + + t = ath79_reset_rr(ATH_RESET_REG_BOOTSTRAP); + if (t & ATH_BOOTSTRAP_REF_CLK_40) + ath79_wmac_data.is_clk_25mhz = false; + else + ath79_wmac_data.is_clk_25mhz = true; +} +#endif +#if (defined CONFIG_SOC_QCA953X) +static void qca953x_wmac_setup(void) +{ + ath79_wmac_device.name = "qca953x_wmac"; + + qca95xx_wmac_setup (); +} +#endif + + +#if (defined CONFIG_SOC_QCA955X) static void qca955x_wmac_setup(void) { u32 t; @@ -133,19 +168,35 @@ else ath79_wmac_data.is_clk_25mhz = true; } +#endif + +#if (defined CONFIG_SOC_QCA956X) +static void qca956x_wmac_setup(void) +{ + ath79_wmac_device.name = "qca956x_wmac"; + + qca95xx_wmac_setup(); +} +#endif + void __init ath79_register_wmac(u8 *cal_data) { - if (soc_is_ar913x()) +#if defined CONFIG_SOC_AR913X ar913x_wmac_setup(); - else if (soc_is_ar933x()) +#elif defined CONFIG_SOC_AR933X ar933x_wmac_setup(); - else if (soc_is_ar934x()) +#elif defined CONFIG_SOC_AR934X ar934x_wmac_setup(); - else if (soc_is_qca955x()) +#elif (defined CONFIG_SOC_QCA953X) + qca953x_wmac_setup(); +#elif (defined CONFIG_SOC_QCA955X) qca955x_wmac_setup(); - else - BUG(); +#elif (defined CONFIG_SOC_QCA956X) + qca956x_wmac_setup(); +#else +#error "_wmac_setup() not implemented!" +#endif if (cal_data) memcpy(ath79_wmac_data.eeprom_data, cal_data,