WHENCE: Update licensing information about the a56 assembler given the GPLed patches...
[linux-libre-firmware.git] / ath9k_htc / target_firmware / magpie_fw_dev / target / inc / OTUS / OTUS_misc.h
1 /*
2  * Copyright (c) 2013 Qualcomm Atheros, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted (subject to the limitations in the
7  * disclaimer below) provided that the following conditions are met:
8  *
9  *  * Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  *  * Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the
15  *    distribution.
16  *
17  *  * Neither the name of Qualcomm Atheros nor the names of its
18  *    contributors may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
22  * GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
23  * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
24  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
32  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
33  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 #ifndef __AR6K_MISC_H__
36 #define __AR6K_MISC_H__
37
38 /*
39  * AR6001: CIS Tuple 0x82, "Board Hardware Configuration Information",
40  * is set at chip reset according to board configuration.  Bits in this
41  * register indicate what type of Host connection is in use. We don't
42  * have proper header files to describe tuples, so the offset and layout
43  * for the one tuple that firmwware needs is defined here.
44  *
45  * AR6002: The RESET_TUPLE_STATUS register in the GPIO block holds
46  * Board Hardware Configuration Information.
47  *
48  * If the interface is SDIO, then the "INFO_MASK" must be "SDIO_NORMAL".
49  * For debug purposes, a Target with the KeepAlive jumper may be booted
50  * before the Host.  In this case, INFO_MASK is 0.
51  *
52  * For NON-SDIO Host interfaces, the INFO_MASK may hold board information.
53  *
54  * By convention, hostless boards set INTERFACE to SDIO, and INFO to
55  * something OTHER than SDIO_NORMAL or 0.
56  * 
57  * Layout of Board HW Cfg Info is below.  These values are captured at
58  * reset and made available to software.
59  *
60  * These 3 bits are available on AR6002 via RESET_TUPLE_STATUS_ADDRESS;
61  * they are NOT available on AR6001.
62  * bit 10: rftest               ???
63  * bit  9: cmode[1]             Bits 9..8 indicate modes as follows:
64  * bit  8: cmode[0]             0-->normal
65  *                              1-->rftest
66  *                              2-->functional test (ATE)
67  *                              3-->ATPG/MBIST
68  *
69  * These 8 bits are available on AR6002 through RESET_TUPLE_STATUS_ADDRESS
70  * and on both AR6001 and AR6002 through CIS Tuple 0x82.
71  * bit  7: gpio9 (aka hmode0)    Bits 7..6 are the "Interface Config bits"
72  * bit  6: tdo   (aka hmode1)
73  * bit  5: clk_req
74  * bit  4: sdio_cmd
75  * bit  3: sdio_dat[3]
76  * bit  2: sdio_dat[2]
77  * bit  1: sdio_dat[1]
78  * bit  0: sdio_dat[0]
79  */
80
81 #if defined(RESET_TUPLE_STATUS_ADDRESS)
82 #define AR6K_BOARD_HWCFG_CMODE_MASK 0x300
83 #define AR6K_BOARD_HWCFG_CMODE_ATE  0x200
84 #else
85 /*
86  * CIS Tuple 0x82 happens to be located at offset 0x13c into CIS registers.
87  * This may change across tapeouts, if CIS tuple information changes.
88  */
89 #define AR6K_BOARD_HWCFG_TUPLE_OFFSET    0x13c
90 #endif
91
92 #define AR6K_BOARD_HWCFG_INTERFACE_MASK  0xc0
93 #define AR6K_BOARD_HWCFG_KEEP_ALIVE_MASK 0x20
94 #define AR6K_BOARD_HWCFG_INFO_MASK       0x1f
95
96 /* Values for INTERFACE_MASK indicate type of interface */
97 #define AR6K_BOARD_HWCFG_SPI             0x00
98 #define AR6K_BOARD_HWCFG_SDIO            0x40
99 #define AR6K_BOARD_HWCFG_LBCF            0x80
100 #define AR6K_BOARD_HWCFG_MSIO            0xc0
101
102 #define AR6K_BOARD_HWCFG_SDIO_NORMAL     0x1f
103
104 #endif /* __AR6K_MISC_H__ */