1 1.1 alc /* 2 1.1 alc * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting 3 1.1 alc * Copyright (c) 2002-2008 Atheros Communications, Inc. 4 1.1 alc * 5 1.1 alc * Permission to use, copy, modify, and/or distribute this software for any 6 1.1 alc * purpose with or without fee is hereby granted, provided that the above 7 1.1 alc * copyright notice and this permission notice appear in all copies. 8 1.1 alc * 9 1.1 alc * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 1.1 alc * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 1.1 alc * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 1.1 alc * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 1.1 alc * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 1.1 alc * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 1.1 alc * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 1.1 alc * 17 1.1 alc * $Id: ah_soc.h,v 1.1.1.1 2008/12/11 04:46:27 alc Exp $ 18 1.1 alc */ 19 1.1 alc #ifndef _ATH_AH_SOC_H_ 20 1.1 alc #define _ATH_AH_SOC_H_ 21 1.1 alc /* 22 1.1 alc * Atheros System on Chip (SoC) public definitions. 23 1.1 alc */ 24 1.1 alc 25 1.1 alc /* 26 1.1 alc * This is board-specific data that is stored in a "known" 27 1.1 alc * location in flash. To find the start of this data search 28 1.1 alc * back from the (aliased) end of flash by 0x1000 bytes at a 29 1.1 alc * time until you find the string "5311", which marks the 30 1.1 alc * start of Board Configuration. Typically one gives up if 31 1.1 alc * more than 500KB is searched. 32 1.1 alc */ 33 1.1 alc struct ar531x_boarddata { 34 1.1 alc uint32_t magic; /* board data is valid */ 35 1.1 alc #define AR531X_BD_MAGIC 0x35333131 /* "5311", for all 531x platforms */ 36 1.1 alc uint16_t cksum; /* checksum (starting with BD_REV 2) */ 37 1.1 alc uint16_t rev; /* revision of this struct */ 38 1.1 alc #define BD_REV 4 39 1.1 alc char boardName[64]; /* Name of board */ 40 1.1 alc uint16_t major; /* Board major number */ 41 1.1 alc uint16_t minor; /* Board minor number */ 42 1.1 alc uint32_t config; /* Board configuration */ 43 1.1 alc #define BD_ENET0 0x00000001 /* ENET0 is stuffed */ 44 1.1 alc #define BD_ENET1 0x00000002 /* ENET1 is stuffed */ 45 1.1 alc #define BD_UART1 0x00000004 /* UART1 is stuffed */ 46 1.1 alc #define BD_UART0 0x00000008 /* UART0 is stuffed (dma) */ 47 1.1 alc #define BD_RSTFACTORY 0x00000010 /* Reset factory defaults stuffed */ 48 1.1 alc #define BD_SYSLED 0x00000020 /* System LED stuffed */ 49 1.1 alc #define BD_EXTUARTCLK 0x00000040 /* External UART clock */ 50 1.1 alc #define BD_CPUFREQ 0x00000080 /* cpu freq is valid in nvram */ 51 1.1 alc #define BD_SYSFREQ 0x00000100 /* sys freq is set in nvram */ 52 1.1 alc #define BD_WLAN0 0x00000200 /* Enable WLAN0 */ 53 1.1 alc #define BD_MEMCAP 0x00000400 /* CAP SDRAM @ memCap for testing */ 54 1.1 alc #define BD_DISWATCHDOG 0x00000800 /* disable system watchdog */ 55 1.1 alc #define BD_WLAN1 0x00001000 /* Enable WLAN1 (ar5212) */ 56 1.1 alc #define BD_ISCASPER 0x00002000 /* FLAG for AR2312 */ 57 1.1 alc #define BD_WLAN0_2G_EN 0x00004000 /* FLAG for radio0_2G */ 58 1.1 alc #define BD_WLAN0_5G_EN 0x00008000 /* FLAG for radio0_2G */ 59 1.1 alc #define BD_WLAN1_2G_EN 0x00020000 /* FLAG for radio0_2G */ 60 1.1 alc #define BD_WLAN1_5G_EN 0x00040000 /* FLAG for radio0_2G */ 61 1.1 alc uint16_t resetConfigGpio; /* Reset factory GPIO pin */ 62 1.1 alc uint16_t sysLedGpio; /* System LED GPIO pin */ 63 1.1 alc 64 1.1 alc uint32_t cpuFreq; /* CPU core frequency in Hz */ 65 1.1 alc uint32_t sysFreq; /* System frequency in Hz */ 66 1.1 alc uint32_t cntFreq; /* Calculated C0_COUNT frequency */ 67 1.1 alc 68 1.1 alc uint8_t wlan0Mac[6]; 69 1.1 alc uint8_t enet0Mac[6]; 70 1.1 alc uint8_t enet1Mac[6]; 71 1.1 alc 72 1.1 alc uint16_t pciId; /* Pseudo PCIID for common code */ 73 1.1 alc uint16_t memCap; /* cap bank1 in MB */ 74 1.1 alc 75 1.1 alc /* version 3 */ 76 1.1 alc uint8_t wlan1Mac[6]; /* (ar5212) */ 77 1.1 alc }; 78 1.1 alc 79 1.1 alc /* 80 1.1 alc * Board support data. The driver is required to locate 81 1.1 alc * and fill-in this information before passing a reference to 82 1.1 alc * this structure as the HAL_BUS_TAG parameter supplied to 83 1.1 alc * ath_hal_attach. 84 1.1 alc */ 85 1.1 alc struct ar531x_config { 86 1.1 alc const struct ar531x_boarddata *board; /* board config data */ 87 1.1 alc const char *radio; /* radio config data */ 88 1.1 alc int unit; /* unit number [0, 1] */ 89 1.1 alc void *tag; /* bus space tag */ 90 1.1 alc }; 91 1.1 alc #endif /* _ATH_AH_SOC_H_ */ 92