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