2 * Atheros AR913x SoC built-in WMAC device support
4 * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
7 * Parts of this file are based on Atheros' 2.6.15 BSP
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/delay.h>
17 #include <linux/etherdevice.h>
18 #include <linux/platform_device.h>
19 #include <linux/ath9k_platform.h>
21 #include <asm/mach-ar71xx/ar71xx.h>
23 #include "dev-ar913x-wmac.h"
25 static struct resource ar913x_wmac_resources
[] = {
27 .start
= AR91XX_WMAC_BASE
,
28 .end
= AR91XX_WMAC_BASE
+ AR91XX_WMAC_SIZE
- 1,
29 .flags
= IORESOURCE_MEM
,
31 .start
= AR71XX_CPU_IRQ_WMAC
,
32 .end
= AR71XX_CPU_IRQ_WMAC
,
33 .flags
= IORESOURCE_IRQ
,
37 static struct ath9k_platform_data ar913x_wmac_data
;
39 static struct platform_device ar913x_wmac_device
= {
42 .resource
= ar913x_wmac_resources
,
43 .num_resources
= ARRAY_SIZE(ar913x_wmac_resources
),
45 .platform_data
= &ar913x_wmac_data
,
49 void __init
ar913x_add_device_wmac(void)
51 u8
*ee
= (u8
*) KSEG1ADDR(0x1fff1000);
53 memcpy(ar913x_wmac_data
.eeprom_data
, ee
,
54 sizeof(ar913x_wmac_data
.eeprom_data
));
56 ar71xx_device_stop(RESET_MODULE_AMBA2WMAC
);
59 ar71xx_device_start(RESET_MODULE_AMBA2WMAC
);
62 platform_device_register(&ar913x_wmac_device
);