* bump kernel to 2.6.35.8 * merge arcadyn mach files * fixes ar9 * adds hack for...
[openwrt/openwrt.git] / target / linux / ifxmips / files / arch / mips / ifxmips / danube / arcaydian.c
1 #include <linux/init.h>
2 #include <linux/module.h>
3 #include <linux/types.h>
4 #include <linux/string.h>
5 #include <linux/mtd/physmap.h>
6 #include <linux/kernel.h>
7 #include <linux/reboot.h>
8 #include <linux/platform_device.h>
9 #include <linux/leds.h>
10 #include <linux/etherdevice.h>
11 #include <linux/reboot.h>
12 #include <linux/time.h>
13 #include <linux/io.h>
14 #include <linux/gpio.h>
15
16 #include <ifxmips.h>
17 #include <ifxmips_prom.h>
18
19 #include "arcaydian.h"
20
21 static int ifxmips_brn = 0;
22
23 int __init
24 ifxmix_detect_brn_block(unsigned int offset)
25 {
26 unsigned char temp[8];
27 memcpy_fromio(temp, (void *)KSEG1ADDR(IFXMIPS_FLASH_START + offset), 8);
28 if (!memcmp(temp, "BRN-BOOT", 8))
29 ifxmips_brn = 1;
30 return !ifxmips_brn;
31 }
32
33 int __init
34 ifxmips_find_brn_mac(unsigned int offset, unsigned char *ifxmips_ethaddr)
35 {
36 if(!ifxmips_brn)
37 return 1;
38 memcpy_fromio(ifxmips_ethaddr,
39 (void *)KSEG1ADDR(IFXMIPS_FLASH_START + offset), 6);
40 return is_valid_ether_addr(ifxmips_ethaddr);
41 }
42
43 /* used by madwifi to know if eeprom is located in flash */
44 int
45 ifxmips_has_brn_block(void)
46 {
47 return ifxmips_brn;
48 }
49 EXPORT_SYMBOL(ifxmips_has_brn_block);