diff options
Diffstat (limited to 'arch/mips/ath79/dev-wmac.c')
-rw-r--r-- | arch/mips/ath79/dev-wmac.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/arch/mips/ath79/dev-wmac.c b/arch/mips/ath79/dev-wmac.c index d6d893c16ad4..da190b1b87ce 100644 --- a/arch/mips/ath79/dev-wmac.c +++ b/arch/mips/ath79/dev-wmac.c | |||
@@ -55,8 +55,8 @@ static void __init ar913x_wmac_setup(void) | |||
55 | 55 | ||
56 | ath79_wmac_resources[0].start = AR913X_WMAC_BASE; | 56 | ath79_wmac_resources[0].start = AR913X_WMAC_BASE; |
57 | ath79_wmac_resources[0].end = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1; | 57 | ath79_wmac_resources[0].end = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1; |
58 | ath79_wmac_resources[1].start = ATH79_CPU_IRQ_IP2; | 58 | ath79_wmac_resources[1].start = ATH79_CPU_IRQ(2); |
59 | ath79_wmac_resources[1].end = ATH79_CPU_IRQ_IP2; | 59 | ath79_wmac_resources[1].end = ATH79_CPU_IRQ(2); |
60 | } | 60 | } |
61 | 61 | ||
62 | 62 | ||
@@ -83,8 +83,8 @@ static void __init ar933x_wmac_setup(void) | |||
83 | 83 | ||
84 | ath79_wmac_resources[0].start = AR933X_WMAC_BASE; | 84 | ath79_wmac_resources[0].start = AR933X_WMAC_BASE; |
85 | ath79_wmac_resources[0].end = AR933X_WMAC_BASE + AR933X_WMAC_SIZE - 1; | 85 | ath79_wmac_resources[0].end = AR933X_WMAC_BASE + AR933X_WMAC_SIZE - 1; |
86 | ath79_wmac_resources[1].start = ATH79_CPU_IRQ_IP2; | 86 | ath79_wmac_resources[1].start = ATH79_CPU_IRQ(2); |
87 | ath79_wmac_resources[1].end = ATH79_CPU_IRQ_IP2; | 87 | ath79_wmac_resources[1].end = ATH79_CPU_IRQ(2); |
88 | 88 | ||
89 | t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP); | 89 | t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP); |
90 | if (t & AR933X_BOOTSTRAP_REF_CLK_40) | 90 | if (t & AR933X_BOOTSTRAP_REF_CLK_40) |
@@ -107,7 +107,7 @@ static void ar934x_wmac_setup(void) | |||
107 | ath79_wmac_resources[0].start = AR934X_WMAC_BASE; | 107 | ath79_wmac_resources[0].start = AR934X_WMAC_BASE; |
108 | ath79_wmac_resources[0].end = AR934X_WMAC_BASE + AR934X_WMAC_SIZE - 1; | 108 | ath79_wmac_resources[0].end = AR934X_WMAC_BASE + AR934X_WMAC_SIZE - 1; |
109 | ath79_wmac_resources[1].start = ATH79_IP2_IRQ(1); | 109 | ath79_wmac_resources[1].start = ATH79_IP2_IRQ(1); |
110 | ath79_wmac_resources[1].start = ATH79_IP2_IRQ(1); | 110 | ath79_wmac_resources[1].end = ATH79_IP2_IRQ(1); |
111 | 111 | ||
112 | t = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP); | 112 | t = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP); |
113 | if (t & AR934X_BOOTSTRAP_REF_CLK_40) | 113 | if (t & AR934X_BOOTSTRAP_REF_CLK_40) |
@@ -116,6 +116,24 @@ static void ar934x_wmac_setup(void) | |||
116 | ath79_wmac_data.is_clk_25mhz = true; | 116 | ath79_wmac_data.is_clk_25mhz = true; |
117 | } | 117 | } |
118 | 118 | ||
119 | static void qca955x_wmac_setup(void) | ||
120 | { | ||
121 | u32 t; | ||
122 | |||
123 | ath79_wmac_device.name = "qca955x_wmac"; | ||
124 | |||
125 | ath79_wmac_resources[0].start = QCA955X_WMAC_BASE; | ||
126 | ath79_wmac_resources[0].end = QCA955X_WMAC_BASE + QCA955X_WMAC_SIZE - 1; | ||
127 | ath79_wmac_resources[1].start = ATH79_IP2_IRQ(1); | ||
128 | ath79_wmac_resources[1].end = ATH79_IP2_IRQ(1); | ||
129 | |||
130 | t = ath79_reset_rr(QCA955X_RESET_REG_BOOTSTRAP); | ||
131 | if (t & QCA955X_BOOTSTRAP_REF_CLK_40) | ||
132 | ath79_wmac_data.is_clk_25mhz = false; | ||
133 | else | ||
134 | ath79_wmac_data.is_clk_25mhz = true; | ||
135 | } | ||
136 | |||
119 | void __init ath79_register_wmac(u8 *cal_data) | 137 | void __init ath79_register_wmac(u8 *cal_data) |
120 | { | 138 | { |
121 | if (soc_is_ar913x()) | 139 | if (soc_is_ar913x()) |
@@ -124,6 +142,8 @@ void __init ath79_register_wmac(u8 *cal_data) | |||
124 | ar933x_wmac_setup(); | 142 | ar933x_wmac_setup(); |
125 | else if (soc_is_ar934x()) | 143 | else if (soc_is_ar934x()) |
126 | ar934x_wmac_setup(); | 144 | ar934x_wmac_setup(); |
145 | else if (soc_is_qca955x()) | ||
146 | qca955x_wmac_setup(); | ||
127 | else | 147 | else |
128 | BUG(); | 148 | BUG(); |
129 | 149 | ||