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