OLD | NEW |
(Empty) | |
| 1 //------------------------------------------------------------------------------ |
| 2 // <copyright file="dsetid.h" company="Atheros"> |
| 3 // Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. |
| 4 // |
| 5 // This program is free software; you can redistribute it and/or modify |
| 6 // it under the terms of the GNU General Public License version 2 as |
| 7 // published by the Free Software Foundation; |
| 8 // |
| 9 // Software distributed under the License is distributed on an "AS |
| 10 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
| 11 // implied. See the License for the specific language governing |
| 12 // rights and limitations under the License. |
| 13 // |
| 14 // |
| 15 //------------------------------------------------------------------------------ |
| 16 //============================================================================== |
| 17 // Author(s): ="Atheros" |
| 18 //============================================================================== |
| 19 |
| 20 |
| 21 #ifndef __DSETID_H__ |
| 22 #define __DSETID_H__ |
| 23 |
| 24 /* Well-known DataSet IDs */ |
| 25 #define DSETID_UNUSED 0x00000000 |
| 26 #define DSETID_BOARD_DATA 0x00000001 /* Cal and board data */ |
| 27 #define DSETID_REGDB 0x00000002 /* Regulatory Database */ |
| 28 #define DSETID_POWER_CONTROL 0x00000003 /* TX Pwr Lim & Ant Gain */ |
| 29 #define DSETID_USER_CONFIG 0x00000004 /* User Configuration */ |
| 30 |
| 31 #define DSETID_ANALOG_CONTROL_DATA_START 0x00000005 |
| 32 #define DSETID_ANALOG_CONTROL_DATA_END 0x00000025 |
| 33 /* |
| 34 * Get DSETID for various reference clock speeds. |
| 35 * For each speed there are three DataSets that correspond |
| 36 * to the three columns of bank6 data (addr, 11a, 11b/g). |
| 37 * This macro returns the dsetid of the first of those |
| 38 * three DataSets. |
| 39 */ |
| 40 #define ANALOG_CONTROL_DATA_DSETID(refclk) \ |
| 41 (DSETID_ANALOG_CONTROL_DATA_START + 3*refclk) |
| 42 |
| 43 /* |
| 44 * There are TWO STARTUP_PATCH DataSets. |
| 45 * DSETID_STARTUP_PATCH is historical, and was applied before BMI on |
| 46 * earlier systems. On AR6002, it is applied after BMI, just like |
| 47 * DSETID_STARTUP_PATCH2. |
| 48 */ |
| 49 #define DSETID_STARTUP_PATCH 0x00000026 |
| 50 #define DSETID_GPIO_CONFIG_PATCH 0x00000027 |
| 51 #define DSETID_WLANREGS 0x00000028 /* override wlan regs */ |
| 52 #define DSETID_STARTUP_PATCH2 0x00000029 |
| 53 |
| 54 #define DSETID_WOW_CONFIG 0x00000090 /* WoW Configuration */ |
| 55 |
| 56 /* Add WHAL_INI_DATA_ID to DSETID_INI_DATA for a specific WHAL INI table. */ |
| 57 #define DSETID_INI_DATA 0x00000100 |
| 58 /* Reserved for WHAL INI Tables: 0x100..0x11f */ |
| 59 #define DSETID_INI_DATA_END 0x0000011f |
| 60 |
| 61 #define DSETID_VENDOR_START 0x00010000 /* Vendor-defined DataSets
*/ |
| 62 |
| 63 #define DSETID_INDEX_END 0xfffffffe /* Reserved to indicate the |
| 64 end of a memory-based |
| 65 DataSet Index */ |
| 66 #define DSETID_INDEX_FREE 0xffffffff /* An unused index entry */ |
| 67 |
| 68 /* |
| 69 * PATCH DataSet format: |
| 70 * A list of patches, terminated by a patch with |
| 71 * address=PATCH_END. |
| 72 * |
| 73 * This allows for patches to be stored in flash. |
| 74 */ |
| 75 struct patch_s { |
| 76 A_UINT32 *address; |
| 77 A_UINT32 data; |
| 78 }; |
| 79 |
| 80 /* |
| 81 * Skip some patches. Can be used to erase a single patch in a |
| 82 * patch DataSet without having to re-write the DataSet. May |
| 83 * also be used to embed information for use by subsequent |
| 84 * patch code. The "data" in a PATCH_SKIP tells how many |
| 85 * bytes of length "patch_s" to skip. |
| 86 */ |
| 87 #define PATCH_SKIP ((A_UINT32 *)0x00000000) |
| 88 |
| 89 /* |
| 90 * Execute code at the address specified by "data". |
| 91 * The address of the patch structure is passed as |
| 92 * the one parameter. |
| 93 */ |
| 94 #define PATCH_CODE_ABS ((A_UINT32 *)0x00000001) |
| 95 |
| 96 /* |
| 97 * Same as PATCH_CODE_ABS, but treat "data" as an |
| 98 * offset from the start of the patch word. |
| 99 */ |
| 100 #define PATCH_CODE_REL ((A_UINT32 *)0x00000002) |
| 101 |
| 102 /* Mark the end of this patch DataSet. */ |
| 103 #define PATCH_END ((A_UINT32 *)0xffffffff) |
| 104 |
| 105 /* |
| 106 * A DataSet which contains a Binary Patch to some other DataSet |
| 107 * uses the original dsetid with the DSETID_BPATCH_FLAG bit set. |
| 108 * Such a BPatch DataSet consists of BPatch metadata followed by |
| 109 * the bdiff bytes. BPatch metadata consists of a single 32-bit |
| 110 * word that contains the size of the BPatched final image. |
| 111 * |
| 112 * To create a suitable bdiff DataSet, use bdiff in host/tools/bdiff |
| 113 * to create "diffs": |
| 114 * bdiff -q -O -nooldmd5 -nonewmd5 -d ORIGfile NEWfile diffs |
| 115 * Then add BPatch metadata to the start of "diffs". |
| 116 * |
| 117 * NB: There are some implementation-induced restrictions |
| 118 * on which DataSets can be BPatched. |
| 119 */ |
| 120 #define DSETID_BPATCH_FLAG 0x80000000 |
| 121 |
| 122 #endif /* __DSETID_H__ */ |
OLD | NEW |