2 * Atheros AR934x SoC built-in WMAC device support
4 * Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com>
6 * Parts of this file are based on Atheros 2.6.31 BSP
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/delay.h>
16 #include <linux/etherdevice.h>
17 #include <linux/platform_device.h>
18 #include <linux/ath9k_platform.h>
20 #include <asm/mach-ar71xx/ar71xx.h>
22 #include "dev-ar934x-wmac.h"
24 static struct ath9k_platform_data ar934x_wmac_data = {
28 static u8 ar934x_wmac_mac[6];
30 static struct resource ar934x_wmac_resources[] = {
32 .start = AR934X_WMAC_BASE,
33 .end = AR934X_WMAC_BASE + AR934X_WMAC_SIZE - 1,
34 .flags = IORESOURCE_MEM,
36 .start = AR71XX_CPU_IRQ_IP2,
37 .end = AR71XX_CPU_IRQ_IP2,
38 .flags = IORESOURCE_IRQ,
42 static struct platform_device ar934x_wmac_device = {
45 .resource = ar934x_wmac_resources,
46 .num_resources = ARRAY_SIZE(ar934x_wmac_resources),
48 .platform_data = &ar934x_wmac_data,
52 void __init ar934x_add_device_wmac(u8 *cal_data, u8 *mac_addr)
55 memcpy(ar934x_wmac_data.eeprom_data, cal_data,
56 sizeof(ar934x_wmac_data.eeprom_data));
59 memcpy(ar934x_wmac_mac, mac_addr, sizeof(ar934x_wmac_mac));
60 ar934x_wmac_data.macaddr = ar934x_wmac_mac;
63 platform_device_register(&ar934x_wmac_device);