summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-01-02 18:54:33 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-01-02 18:54:33 +0000
commit6fa4f54cd4d09ae02ff41bb43fd63e4d0a74626c (patch)
tree4e2fb8ba657db8849d05aff93c88dda31339609c /target
parent818a5943dcc3648dc438194a3e16efddee9d4827 (diff)
[ar71xx] prepare for ath9k support
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13825 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/platform.c17
-rw-r--r--target/linux/ar71xx/files/include/linux/ath9k_platform.h20
2 files changed, 37 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c b/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
index e4e953898..ef70867a2 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
@@ -17,6 +17,7 @@
#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/serial_8250.h>
+#include <linux/ath9k_platform.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include <asm/mach-ar71xx/platform.h>
@@ -605,14 +606,30 @@ static struct resource ar91xx_wmac_resources[] = {
},
};
+static struct ath9k_platform_data ar91xx_wmac_data;
+
static struct platform_device ar91xx_wmac_device = {
.name = "ath9k",
.id = -1,
.resource = ar91xx_wmac_resources,
.num_resources = ARRAY_SIZE(ar91xx_wmac_resources),
+ .dev = {
+ .platform_data = &ar91xx_wmac_data,
+ },
};
void __init ar91xx_add_device_wmac(void)
{
+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+ memcpy(ar91xx_wmac_data.eeprom_data, ee,
+ sizeof(ar91xx_wmac_data.eeprom_data));
+
+ ar71xx_device_stop(RESET_MODULE_AMBA2WMAC);
+ mdelay(10);
+
+ ar71xx_device_start(RESET_MODULE_AMBA2WMAC);
+ mdelay(10);
+
platform_device_register(&ar91xx_wmac_device);
}
diff --git a/target/linux/ar71xx/files/include/linux/ath9k_platform.h b/target/linux/ar71xx/files/include/linux/ath9k_platform.h
new file mode 100644
index 000000000..d76956079
--- /dev/null
+++ b/target/linux/ar71xx/files/include/linux/ath9k_platform.h
@@ -0,0 +1,20 @@
+/*
+ * ath9k platform data defines
+ *
+ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
+ *
+ * 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.
+ */
+
+#ifndef _LINUX_ATH9K_PLATFORM_H
+#define _LINUX_ATH9L_PLATFORM_H
+
+#define ATH9K_PLAT_EEP_MAX_WORDS 2048
+
+struct ath9k_platform_data {
+ u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
+};
+
+#endif /* _LINUX_ATH9K_PLATFORM_H */