* [PATCH 1/6] MIPS: ath79: store the SoC revision in a global variable
2011-11-17 22:13 [PATCH 0/6] Allow to register wireless MAC device on AR933X based boards Gabor Juhos
@ 2011-11-17 22:13 ` Gabor Juhos
2011-11-17 22:43 ` Ralf Baechle
2011-11-17 22:13 ` [PATCH 2/6] MIPS: ath79: remove 'ar913x' from common variable and function names Gabor Juhos
` (4 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: Gabor Juhos @ 2011-11-17 22:13 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Imre Kaloz, linux-mips, Gabor Juhos
Knowing the exact revision of the SoC is required
to make runtime decisions in various code paths.
We have determined the SoC revision already, so
we only need to store that in a global variable.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
arch/mips/ath79/common.c | 1 +
arch/mips/ath79/setup.c | 2 ++
arch/mips/include/asm/mach-ath79/ath79.h | 1 +
3 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/mips/ath79/common.c b/arch/mips/ath79/common.c
index 38c2ad7..f0fda98 100644
--- a/arch/mips/ath79/common.c
+++ b/arch/mips/ath79/common.c
@@ -30,6 +30,7 @@ u32 ath79_ddr_freq;
EXPORT_SYMBOL_GPL(ath79_ddr_freq);
enum ath79_soc_type ath79_soc;
+unsigned int ath79_soc_rev;
void __iomem *ath79_pll_base;
void __iomem *ath79_reset_base;
diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c
index 4187a11..61bf339 100644
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
@@ -149,6 +149,8 @@ static void __init ath79_detect_sys_type(void)
panic("ath79: unknown SoC, id:0x%08x\n", id);
}
+ ath79_soc_rev = rev;
+
sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
pr_info("SoC: %s\n", ath79_sys_type);
}
diff --git a/arch/mips/include/asm/mach-ath79/ath79.h b/arch/mips/include/asm/mach-ath79/ath79.h
index 407c935..6d0c6c9 100644
--- a/arch/mips/include/asm/mach-ath79/ath79.h
+++ b/arch/mips/include/asm/mach-ath79/ath79.h
@@ -32,6 +32,7 @@ enum ath79_soc_type {
};
extern enum ath79_soc_type ath79_soc;
+extern unsigned int ath79_soc_rev;
static inline int soc_is_ar71xx(void)
{
--
1.7.2.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 2/6] MIPS: ath79: remove 'ar913x' from common variable and function names
2011-11-17 22:13 [PATCH 0/6] Allow to register wireless MAC device on AR933X based boards Gabor Juhos
2011-11-17 22:13 ` [PATCH 1/6] MIPS: ath79: store the SoC revision in a global variable Gabor Juhos
@ 2011-11-17 22:13 ` Gabor Juhos
2011-11-17 22:32 ` Ralf Baechle
` (2 more replies)
2011-11-17 22:13 ` [PATCH 3/6] MIPS: ath79: separate AR913x SoC specific WMAC setup code Gabor Juhos
` (3 subsequent siblings)
5 siblings, 3 replies; 17+ messages in thread
From: Gabor Juhos @ 2011-11-17 22:13 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Imre Kaloz, linux-mips, Gabor Juhos
The wireless MAC specific variables and the registration
code can be shared between multiple SoCs. Remove the 'ar913x'
part from the function and variable names to avoid confusions.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
arch/mips/ath79/dev-ar913x-wmac.c | 20 ++++++++++----------
arch/mips/ath79/dev-ar913x-wmac.h | 8 ++++----
arch/mips/ath79/mach-ap81.c | 2 +-
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/arch/mips/ath79/dev-ar913x-wmac.c b/arch/mips/ath79/dev-ar913x-wmac.c
index 48f425a..2c9ba40 100644
--- a/arch/mips/ath79/dev-ar913x-wmac.c
+++ b/arch/mips/ath79/dev-ar913x-wmac.c
@@ -19,9 +19,9 @@
#include <asm/mach-ath79/ar71xx_regs.h>
#include "dev-ar913x-wmac.h"
-static struct ath9k_platform_data ar913x_wmac_data;
+static struct ath9k_platform_data ath79_wmac_data;
-static struct resource ar913x_wmac_resources[] = {
+static struct resource ath79_wmac_resources[] = {
{
.start = AR913X_WMAC_BASE,
.end = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1,
@@ -33,21 +33,21 @@ static struct resource ar913x_wmac_resources[] = {
},
};
-static struct platform_device ar913x_wmac_device = {
+static struct platform_device ath79_wmac_device = {
.name = "ath9k",
.id = -1,
- .resource = ar913x_wmac_resources,
- .num_resources = ARRAY_SIZE(ar913x_wmac_resources),
+ .resource = ath79_wmac_resources,
+ .num_resources = ARRAY_SIZE(ath79_wmac_resources),
.dev = {
- .platform_data = &ar913x_wmac_data,
+ .platform_data = &ath79_wmac_data,
},
};
-void __init ath79_register_ar913x_wmac(u8 *cal_data)
+void __init ath79_register_wmac(u8 *cal_data)
{
if (cal_data)
- memcpy(ar913x_wmac_data.eeprom_data, cal_data,
- sizeof(ar913x_wmac_data.eeprom_data));
+ memcpy(ath79_wmac_data.eeprom_data, cal_data,
+ sizeof(ath79_wmac_data.eeprom_data));
/* reset the WMAC */
ath79_device_reset_set(AR913X_RESET_AMBA2WMAC);
@@ -56,5 +56,5 @@ void __init ath79_register_ar913x_wmac(u8 *cal_data)
ath79_device_reset_clear(AR913X_RESET_AMBA2WMAC);
mdelay(10);
- platform_device_register(&ar913x_wmac_device);
+ platform_device_register(&ath79_wmac_device);
}
diff --git a/arch/mips/ath79/dev-ar913x-wmac.h b/arch/mips/ath79/dev-ar913x-wmac.h
index 579d562..de1d784 100644
--- a/arch/mips/ath79/dev-ar913x-wmac.h
+++ b/arch/mips/ath79/dev-ar913x-wmac.h
@@ -9,9 +9,9 @@
* by the Free Software Foundation.
*/
-#ifndef _ATH79_DEV_AR913X_WMAC_H
-#define _ATH79_DEV_AR913X_WMAC_H
+#ifndef _ATH79_DEV_WMAC_H
+#define _ATH79_DEV_WMAC_H
-void ath79_register_ar913x_wmac(u8 *cal_data);
+void ath79_register_wmac(u8 *cal_data);
-#endif /* _ATH79_DEV_AR913X_WMAC_H */
+#endif /* _ATH79_DEV_WMAC_H */
diff --git a/arch/mips/ath79/mach-ap81.c b/arch/mips/ath79/mach-ap81.c
index 6c08267..84442da 100644
--- a/arch/mips/ath79/mach-ap81.c
+++ b/arch/mips/ath79/mach-ap81.c
@@ -92,7 +92,7 @@ static void __init ap81_setup(void)
ap81_gpio_keys);
ath79_register_spi(&ap81_spi_data, ap81_spi_info,
ARRAY_SIZE(ap81_spi_info));
- ath79_register_ar913x_wmac(cal_data);
+ ath79_register_wmac(cal_data);
ath79_register_usb();
}
--
1.7.2.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 2/6] MIPS: ath79: remove 'ar913x' from common variable and function names
2011-11-17 22:13 ` [PATCH 2/6] MIPS: ath79: remove 'ar913x' from common variable and function names Gabor Juhos
@ 2011-11-17 22:32 ` Ralf Baechle
2011-11-17 22:35 ` Gabor Juhos
2011-11-17 22:43 ` Ralf Baechle
2011-11-18 9:11 ` Sergei Shtylyov
2 siblings, 1 reply; 17+ messages in thread
From: Ralf Baechle @ 2011-11-17 22:32 UTC (permalink / raw)
To: Gabor Juhos; +Cc: Imre Kaloz, linux-mips
On Thu, Nov 17, 2011 at 11:13:43PM +0100, Gabor Juhos wrote:
> diff --git a/arch/mips/ath79/dev-ar913x-wmac.h b/arch/mips/ath79/dev-ar913x-wmac.h
> index 579d562..de1d784 100644
> --- a/arch/mips/ath79/dev-ar913x-wmac.h
> +++ b/arch/mips/ath79/dev-ar913x-wmac.h
> @@ -9,9 +9,9 @@
> * by the Free Software Foundation.
> */
>
> -#ifndef _ATH79_DEV_AR913X_WMAC_H
> -#define _ATH79_DEV_AR913X_WMAC_H
> +#ifndef _ATH79_DEV_WMAC_H
> +#define _ATH79_DEV_WMAC_H
In this case, don't you want to rename this header file as well?
Ralf
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/6] MIPS: ath79: remove 'ar913x' from common variable and function names
2011-11-17 22:32 ` Ralf Baechle
@ 2011-11-17 22:35 ` Gabor Juhos
0 siblings, 0 replies; 17+ messages in thread
From: Gabor Juhos @ 2011-11-17 22:35 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Imre Kaloz, linux-mips
2011.11.17. 23:32 keltezéssel, Ralf Baechle írta:
> On Thu, Nov 17, 2011 at 11:13:43PM +0100, Gabor Juhos wrote:
>
>> diff --git a/arch/mips/ath79/dev-ar913x-wmac.h b/arch/mips/ath79/dev-ar913x-wmac.h
>> index 579d562..de1d784 100644
>> --- a/arch/mips/ath79/dev-ar913x-wmac.h
>> +++ b/arch/mips/ath79/dev-ar913x-wmac.h
>> @@ -9,9 +9,9 @@
>> * by the Free Software Foundation.
>> */
>>
>> -#ifndef _ATH79_DEV_AR913X_WMAC_H
>> -#define _ATH79_DEV_AR913X_WMAC_H
>> +#ifndef _ATH79_DEV_WMAC_H
>> +#define _ATH79_DEV_WMAC_H
>
> In this case, don't you want to rename this header file as well?
I want to rename that, but I did not want to mix up the actual modifications
with a file rename.
Gabor
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/6] MIPS: ath79: remove 'ar913x' from common variable and function names
2011-11-17 22:13 ` [PATCH 2/6] MIPS: ath79: remove 'ar913x' from common variable and function names Gabor Juhos
2011-11-17 22:32 ` Ralf Baechle
@ 2011-11-17 22:43 ` Ralf Baechle
2011-11-18 9:11 ` Sergei Shtylyov
2 siblings, 0 replies; 17+ messages in thread
From: Ralf Baechle @ 2011-11-17 22:43 UTC (permalink / raw)
To: Gabor Juhos; +Cc: Imre Kaloz, linux-mips
Queued for 3.3. Thanks,
Ralf
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/6] MIPS: ath79: remove 'ar913x' from common variable and function names
2011-11-17 22:13 ` [PATCH 2/6] MIPS: ath79: remove 'ar913x' from common variable and function names Gabor Juhos
2011-11-17 22:32 ` Ralf Baechle
2011-11-17 22:43 ` Ralf Baechle
@ 2011-11-18 9:11 ` Sergei Shtylyov
2011-11-18 9:32 ` Gabor Juhos
2 siblings, 1 reply; 17+ messages in thread
From: Sergei Shtylyov @ 2011-11-18 9:11 UTC (permalink / raw)
To: Gabor Juhos; +Cc: Ralf Baechle, Imre Kaloz, linux-mips
Hello.
On 18-11-2011 2:13, Gabor Juhos wrote:
> The wireless MAC specific variables and the registration
> code can be shared between multiple SoCs. Remove the 'ar913x'
> part from the function and variable names to avoid confusions.
> Signed-off-by: Gabor Juhos<juhosg@openwrt.org>
> ---
> arch/mips/ath79/dev-ar913x-wmac.c | 20 ++++++++++----------
> arch/mips/ath79/dev-ar913x-wmac.h | 8 ++++----
Don't you need to rename these files if they're no longer AR913x specific?
> arch/mips/ath79/mach-ap81.c | 2 +-
> 3 files changed, 15 insertions(+), 15 deletions(-)
WBR, Sergei
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 2/6] MIPS: ath79: remove 'ar913x' from common variable and function names
2011-11-18 9:11 ` Sergei Shtylyov
@ 2011-11-18 9:32 ` Gabor Juhos
0 siblings, 0 replies; 17+ messages in thread
From: Gabor Juhos @ 2011-11-18 9:32 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: Ralf Baechle, Imre Kaloz, linux-mips
Hi Sergei,
2011.11.18. 10:11 keltezéssel, Sergei Shtylyov írta:
> Hello.
>
> On 18-11-2011 2:13, Gabor Juhos wrote:
>
>> The wireless MAC specific variables and the registration
>> code can be shared between multiple SoCs. Remove the 'ar913x'
>> part from the function and variable names to avoid confusions.
>
>> Signed-off-by: Gabor Juhos<juhosg@openwrt.org>
>> ---
>> arch/mips/ath79/dev-ar913x-wmac.c | 20 ++++++++++----------
>> arch/mips/ath79/dev-ar913x-wmac.h | 8 ++++----
>
> Don't you need to rename these files if they're no longer AR913x specific?
These files has been renamed by a later patch.
-Gabor
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 3/6] MIPS: ath79: separate AR913x SoC specific WMAC setup code
2011-11-17 22:13 [PATCH 0/6] Allow to register wireless MAC device on AR933X based boards Gabor Juhos
2011-11-17 22:13 ` [PATCH 1/6] MIPS: ath79: store the SoC revision in a global variable Gabor Juhos
2011-11-17 22:13 ` [PATCH 2/6] MIPS: ath79: remove 'ar913x' from common variable and function names Gabor Juhos
@ 2011-11-17 22:13 ` Gabor Juhos
2011-11-17 22:43 ` Ralf Baechle
2011-11-17 22:13 ` [PATCH 4/6] MIPS: ath79: add AR933x " Gabor Juhos
` (2 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: Gabor Juhos @ 2011-11-17 22:13 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Imre Kaloz, linux-mips, Gabor Juhos
The device registration code can be shared between
the different SoCs, but the required setup code varies
Move AR913x specific setup code into a separate function
in order to make adding support for another SoCs easier.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
arch/mips/ath79/dev-ar913x-wmac.c | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/arch/mips/ath79/dev-ar913x-wmac.c b/arch/mips/ath79/dev-ar913x-wmac.c
index 2c9ba40..21118fb 100644
--- a/arch/mips/ath79/dev-ar913x-wmac.c
+++ b/arch/mips/ath79/dev-ar913x-wmac.c
@@ -23,8 +23,7 @@ static struct ath9k_platform_data ath79_wmac_data;
static struct resource ath79_wmac_resources[] = {
{
- .start = AR913X_WMAC_BASE,
- .end = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1,
+ /* .start and .end fields are filled dynamically */
.flags = IORESOURCE_MEM,
}, {
.start = ATH79_CPU_IRQ_IP2,
@@ -43,12 +42,8 @@ static struct platform_device ath79_wmac_device = {
},
};
-void __init ath79_register_wmac(u8 *cal_data)
+static void __init ar913x_wmac_setup(void)
{
- if (cal_data)
- memcpy(ath79_wmac_data.eeprom_data, cal_data,
- sizeof(ath79_wmac_data.eeprom_data));
-
/* reset the WMAC */
ath79_device_reset_set(AR913X_RESET_AMBA2WMAC);
mdelay(10);
@@ -56,5 +51,20 @@ void __init ath79_register_wmac(u8 *cal_data)
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;
+}
+
+void __init ath79_register_wmac(u8 *cal_data)
+{
+ if (soc_is_ar913x())
+ ar913x_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);
}
--
1.7.2.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 4/6] MIPS: ath79: add AR933x specific WMAC setup code
2011-11-17 22:13 [PATCH 0/6] Allow to register wireless MAC device on AR933X based boards Gabor Juhos
` (2 preceding siblings ...)
2011-11-17 22:13 ` [PATCH 3/6] MIPS: ath79: separate AR913x SoC specific WMAC setup code Gabor Juhos
@ 2011-11-17 22:13 ` Gabor Juhos
2011-11-17 22:43 ` Ralf Baechle
2011-11-17 22:13 ` [PATCH 5/6] MIPS: ath79: rename ATH79_DEV_AR913X_WMAC option to ATH79_DEV_WMAC Gabor Juhos
2011-11-17 22:13 ` [PATCH 6/6] MIPS: ath79: register the wireless MAC device on the AP121 board Gabor Juhos
5 siblings, 1 reply; 17+ messages in thread
From: Gabor Juhos @ 2011-11-17 22:13 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Imre Kaloz, linux-mips, Gabor Juhos
The wireless MAC of the AR933x SoCs uses different
base address, and requires different setup code.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
arch/mips/ath79/dev-ar913x-wmac.c | 43 ++++++++++++++++++++++-
arch/mips/ath79/dev-ar913x-wmac.h | 4 +-
arch/mips/include/asm/mach-ath79/ar71xx_regs.h | 4 ++-
3 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/arch/mips/ath79/dev-ar913x-wmac.c b/arch/mips/ath79/dev-ar913x-wmac.c
index 21118fb..c424e9a 100644
--- a/arch/mips/ath79/dev-ar913x-wmac.c
+++ b/arch/mips/ath79/dev-ar913x-wmac.c
@@ -1,7 +1,7 @@
/*
- * Atheros AR913X SoC built-in WMAC device support
+ * Atheros AR913X/AR933X SoC built-in WMAC device support
*
- * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
*
* This program is free software; you can redistribute it and/or modify it
@@ -55,10 +55,49 @@ static void __init ar913x_wmac_setup(void)
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();
diff --git a/arch/mips/ath79/dev-ar913x-wmac.h b/arch/mips/ath79/dev-ar913x-wmac.h
index de1d784..c9cd870 100644
--- a/arch/mips/ath79/dev-ar913x-wmac.h
+++ b/arch/mips/ath79/dev-ar913x-wmac.h
@@ -1,7 +1,7 @@
/*
- * Atheros AR913X SoC built-in WMAC device support
+ * Atheros AR913X/AR933X SoC built-in WMAC device support
*
- * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
index 733baca..2f0becb 100644
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
@@ -55,7 +55,8 @@
#define AR933X_UART_BASE (AR71XX_APB_BASE + 0x00020000)
#define AR933X_UART_SIZE 0x14
-
+#define AR933X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000)
+#define AR933X_WMAC_SIZE 0x20000
#define AR933X_EHCI_BASE 0x1b000000
#define AR933X_EHCI_SIZE 0x1000
@@ -233,6 +234,7 @@
#define AR913X_RESET_USB_HOST BIT(5)
#define AR913X_RESET_USB_PHY BIT(4)
+#define AR933X_RESET_WMAC BIT(11)
#define AR933X_RESET_USB_HOST BIT(5)
#define AR933X_RESET_USB_PHY BIT(4)
#define AR933X_RESET_USBSUS_OVERRIDE BIT(3)
--
1.7.2.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 5/6] MIPS: ath79: rename ATH79_DEV_AR913X_WMAC option to ATH79_DEV_WMAC
2011-11-17 22:13 [PATCH 0/6] Allow to register wireless MAC device on AR933X based boards Gabor Juhos
` (3 preceding siblings ...)
2011-11-17 22:13 ` [PATCH 4/6] MIPS: ath79: add AR933x " Gabor Juhos
@ 2011-11-17 22:13 ` Gabor Juhos
2011-11-17 22:43 ` Ralf Baechle
2011-11-17 22:13 ` [PATCH 6/6] MIPS: ath79: register the wireless MAC device on the AP121 board Gabor Juhos
5 siblings, 1 reply; 17+ messages in thread
From: Gabor Juhos @ 2011-11-17 22:13 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Imre Kaloz, linux-mips, Gabor Juhos
The ATH79_DEV_AR913X_WMAC option was used to select
the AR913x specific wireless MAC registration code.
The registration code now supports the AR933X SoCs
as well. Rename the option to reflect the changes.
Also make the new option depends on SOC_AR933X.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
arch/mips/ath79/Kconfig | 11 ++++++-----
arch/mips/ath79/Makefile | 2 +-
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig
index 4a7e0e8..4fc697d 100644
--- a/arch/mips/ath79/Kconfig
+++ b/arch/mips/ath79/Kconfig
@@ -9,6 +9,7 @@ config ATH79_MACH_AP121
select ATH79_DEV_LEDS_GPIO
select ATH79_DEV_SPI
select ATH79_DEV_USB
+ select ATH79_DEV_WMAC
help
Say 'Y' here if you want your kernel to support the
Atheros AP121 reference board.
@@ -16,11 +17,11 @@ config ATH79_MACH_AP121
config ATH79_MACH_AP81
bool "Atheros AP81 reference board"
select SOC_AR913X
- select ATH79_DEV_AR913X_WMAC
select ATH79_DEV_GPIO_BUTTONS
select ATH79_DEV_LEDS_GPIO
select ATH79_DEV_SPI
select ATH79_DEV_USB
+ select ATH79_DEV_WMAC
help
Say 'Y' here if you want your kernel to support the
Atheros AP81 reference board.
@@ -56,10 +57,6 @@ config SOC_AR933X
select USB_ARCH_HAS_EHCI
def_bool n
-config ATH79_DEV_AR913X_WMAC
- depends on SOC_AR913X
- def_bool n
-
config ATH79_DEV_GPIO_BUTTONS
def_bool n
@@ -72,4 +69,8 @@ config ATH79_DEV_SPI
config ATH79_DEV_USB
def_bool n
+config ATH79_DEV_WMAC
+ depends on (SOC_AR913X || SOC_AR933X)
+ def_bool n
+
endif
diff --git a/arch/mips/ath79/Makefile b/arch/mips/ath79/Makefile
index 8933d18..ac159e6 100644
--- a/arch/mips/ath79/Makefile
+++ b/arch/mips/ath79/Makefile
@@ -16,11 +16,11 @@ obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
# Devices
#
obj-y += dev-common.o
-obj-$(CONFIG_ATH79_DEV_AR913X_WMAC) += dev-ar913x-wmac.o
obj-$(CONFIG_ATH79_DEV_GPIO_BUTTONS) += dev-gpio-buttons.o
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
#
# Machines
--
1.7.2.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 6/6] MIPS: ath79: register the wireless MAC device on the AP121 board
2011-11-17 22:13 [PATCH 0/6] Allow to register wireless MAC device on AR933X based boards Gabor Juhos
` (4 preceding siblings ...)
2011-11-17 22:13 ` [PATCH 5/6] MIPS: ath79: rename ATH79_DEV_AR913X_WMAC option to ATH79_DEV_WMAC Gabor Juhos
@ 2011-11-17 22:13 ` Gabor Juhos
2011-11-17 22:43 ` Ralf Baechle
5 siblings, 1 reply; 17+ messages in thread
From: Gabor Juhos @ 2011-11-17 22:13 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Imre Kaloz, linux-mips, Gabor Juhos
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
arch/mips/ath79/mach-ap121.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/mips/ath79/mach-ap121.c b/arch/mips/ath79/mach-ap121.c
index 353af55..39ee828 100644
--- a/arch/mips/ath79/mach-ap121.c
+++ b/arch/mips/ath79/mach-ap121.c
@@ -13,6 +13,7 @@
#include "dev-leds-gpio.h"
#include "dev-spi.h"
#include "dev-usb.h"
+#include "dev-ar913x-wmac.h"
#define AP121_GPIO_LED_WLAN 0
#define AP121_GPIO_LED_USB 1
@@ -73,6 +74,8 @@ static struct ath79_spi_platform_data ap121_spi_data = {
static void __init ap121_setup(void)
{
+ u8 *cal_data = (u8 *) KSEG1ADDR(AP121_CAL_DATA_ADDR);
+
ath79_register_leds_gpio(-1, ARRAY_SIZE(ap121_leds_gpio),
ap121_leds_gpio);
ath79_register_gpio_keys_polled(-1, AP121_KEYS_POLL_INTERVAL,
@@ -82,6 +85,7 @@ static void __init ap121_setup(void)
ath79_register_spi(&ap121_spi_data, ap121_spi_info,
ARRAY_SIZE(ap121_spi_info));
ath79_register_usb();
+ ath79_register_wmac(cal_data);
}
MIPS_MACHINE(ATH79_MACH_AP121, "AP121", "Atheros AP121 reference board",
--
1.7.2.1
^ permalink raw reply related [flat|nested] 17+ messages in thread