00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #define DEFINE_MFG_TOKEN(name, type, address, ...) \
00028 TOKEN_NEXT_ADDRESS(name,(address)) \
00029 TOKEN_MFG(name, CREATOR_##name, 0, 0, type, 1, __VA_ARGS__)
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #define CREATOR_MFG_CHIP_DATA 0xC344 // msb+'C'+'D'
00049 #define CREATOR_MFG_PART_DATA 0xF064 // msb+'p'+'d'
00050 #define CREATOR_MFG_TESTER_DATA 0xF464 // msb+'t'+'d'
00051 #define CREATOR_MFG_ST_EUI_64 0xE545 // msb+'e'+'E'
00052 #define CREATOR_MFG_ANALOG_TRIM_NORMAL 0xF46E // msb+'t'+'n'
00053 #define CREATOR_MFG_ANALOG_TRIM_BOOST 0xF442 // msb+'t'+'B'
00054 #define CREATOR_MFG_ANALOG_TRIM_BOTH 0xF462 // msb+'t'+'b'
00055 #define CREATOR_MFG_REG_TRIM 0xF274 // msb+'r'+'t'
00056 #define CREATOR_MFG_1V8_REG_VOLTAGE 0xF276 // msb+'r'+'v'
00057 #define CREATOR_MFG_VREF_VOLTAGE 0xF676 // msb+'v'+'v'
00058 #define CREATOR_MFG_TEMP_CAL 0xF463 // msb+'t'+'c'
00059 #define CREATOR_MFG_FIB_VERSION 0xFF09
00060 #define CREATOR_MFG_FIB_CHECKSUM 0xE663 // msb+'f'+'c'
00061 #define CREATOR_MFG_FIB_OBS 0xE66F // msb+'f'+'o'
00062
00063 #define CREATOR_MFG_CIB_OBS 0xE36F // msb+'c'+'o'
00064 #define CREATOR_MFG_CUSTOM_VERSION 0xC356
00065 #define CREATOR_MFG_CUSTOM_EUI_64 0xE345
00066 #define CREATOR_MFG_STRING 0xED73
00067 #define CREATOR_MFG_BOARD_NAME 0xC24E // msb+'B'+'N' (Board Name)
00068 #define CREATOR_MFG_EUI_64 0xB634
00069 #define CREATOR_MFG_MANUF_ID 0xC944 // msb+'I'+'D' (Id)
00070 #define CREATOR_MFG_PHY_CONFIG 0xD043 // msb+'P'+'C' (Phy Config)
00071 #define CREATOR_MFG_BOOTLOAD_AES_KEY 0xC24B // msb+'B'+'K' (Bootloader Key)
00072 #define CREATOR_MFG_EZSP_STORAGE 0xCD53
00073 #define CREATOR_MFG_ASH_CONFIG 0xC143 // msb+'A'+'C' (ASH Config)
00074 #define CREATOR_MFG_CBKE_DATA 0xC342 // msb+'C'+'B' (CBke)
00075 #define CREATOR_MFG_INSTALLATION_CODE 0xC943 // msb+'I'+'C' (Installation Code)
00076 #define CREATOR_MFG_OSC24M_BIAS_TRIM 0xB254 // msb+'2'+'T' (2[4mHz] Trim)
00077
00078
00079 #define CURRENT_MFG_TOKEN_VERSION 0x01FE //MSB is version, LSB is complement
00080 #define CURRENT_MFG_CUSTOM_VERSION 0x01FE //MSB is version, LSB is complement
00081
00082
00083 #ifndef __MFG_TYPES_DEFINED__
00084 #define __MFG_TYPES_DEFINED__
00085
00086 typedef int8u tokTypeMfgChipData[24];
00087 typedef int8u tokTypeMfgPartData[6];
00088 typedef int8u tokTypeMfgTesterData[6];
00089 typedef int8u tokTypeMfgStEui64[8];
00090 typedef struct {
00091 int16u iffilterL;
00092 int16u lna;
00093 int16u ifamp;
00094 int16u rxadcH;
00095 int16u prescalar;
00096 int16u phdet;
00097 int16u vco;
00098 int16u loopfilter;
00099 int16u pa;
00100 int16u iqmixer;
00101 } tokTypeMfgAnalogueTrim;
00102 typedef struct {
00103 int16u iffilterH;
00104 int16u biasmaster;
00105 int16u moddac;
00106 int16u auxadc;
00107 int16u caladc;
00108 } tokTypeMfgAnalogueTrimBoth;
00109 typedef struct {
00110 int8u regTrim1V2;
00111 int8u regTrim1V8;
00112 } tokTypeMfgRegTrim;
00113 typedef int16u tokTypeMfgRegVoltage1V8;
00114 typedef int16u tokTypeMfgAdcVrefVoltage;
00115 typedef int16u tokTypeMfgTempCal;
00116 typedef int16u tokTypeMfgFibVersion;
00117 typedef int16u tokTypeMfgFibChecksum;
00118 typedef struct {
00119 int16u ob2;
00120 int16u ob3;
00121 int16u ob0;
00122 int16u ob1;
00123 } tokTypeMfgFibObs;
00124
00125 typedef struct {
00126 int16u ob0;
00127 int16u ob1;
00128 int16u ob2;
00129 int16u ob3;
00130 int16u ob4;
00131 int16u ob5;
00132 int16u ob6;
00133 int16u ob7;
00134 } tokTypeMfgCibObs;
00135 typedef int16u tokTypeMfgCustomVersion;
00136 typedef int8u tokTypeMfgCustomEui64[8];
00137 typedef int8u tokTypeMfgString[16];
00138 typedef int8u tokTypeMfgBoardName[16];
00139 typedef int16u tokTypeMfgManufId;
00140 typedef int16u tokTypeMfgPhyConfig;
00141 typedef int8u tokTypeMfgBootloadAesKey[16];
00142 typedef int8u tokTypeMfgEui64[8];
00143 typedef int8u tokTypeMfgEzspStorage[8];
00144 typedef int16u tokTypeMfgAshConfig;
00145 typedef struct {
00146 int8u certificate[48];
00147 int8u caPublicKey[22];
00148 int8u privateKey[21];
00149
00150
00151 int8u flags;
00152 } tokTypeMfgCbkeData;
00153 typedef struct {
00154
00155
00156
00157
00158
00159
00160
00161 int16u flags;
00162 int8u value[16];
00163 int16u crc;
00164 } tokTypeMfgInstallationCode;
00165 typedef int16u tokTypeMfgOsc24mBiasTrim;
00166 #endif //__MFG_TYPES_DEFINED__
00167
00168
00169 #ifdef DEFINETOKENS
00170
00171
00172
00173
00174
00175 #define MFG_CHIP_DATA_LOCATION 0x077E // 24 bytes
00176 #define MFG_PART_DATA_LOCATION 0x0796 // 6 bytes
00177 #define MFG_TESTER_DATA_LOCATION 0x079C // 6 bytes
00178 #define MFG_ST_EUI_64_LOCATION 0x07A2 // 8 bytes
00179 #define MFG_ANALOG_TRIM_NORMAL_LOCATION 0x07AA // 20 bytes
00180 #define MFG_ANALOG_TRIM_BOOST_LOCATION 0x07BE // 20 bytes
00181 #define MFG_ANALOG_TRIM_BOTH_LOCATION 0x07D2 // 10 bytes
00182 #define MFG_REG_TRIM_LOCATION 0x07DC // 2 bytes
00183 #define MFG_1V8_REG_VOLTAGE_LOCATION 0x07DE // 2 bytes
00184 #define MFG_VREF_VOLTAGE_LOCATION 0x07E0 // 2 bytes
00185 #define MFG_TEMP_CAL_LOCATION 0x07E2 // 2 bytes
00186
00187 #define MFG_FIB_VERSION_LOCATION 0x07F4 // 2 bytes
00188 #define MFG_FIB_CHECKSUM_LOCATION 0x07F6 // 2 bytes
00189 #define MFG_FIB_OBS_LOCATION 0x07F8 // 8 bytes
00190
00191 #define MFG_CIB_OBS_LOCATION 0x0800 // 16 bytes
00192 #define MFG_CUSTOM_VERSION_LOCATION 0x0810 // 2 bytes
00193 #define MFG_CUSTOM_EUI_64_LOCATION 0x0812 // 8 bytes
00194 #define MFG_STRING_LOCATION 0x081A // 16 bytes
00195 #define MFG_BOARD_NAME_LOCATION 0x082A // 16 bytes
00196 #define MFG_MANUF_ID_LOCATION 0x083A // 2 bytes
00197 #define MFG_PHY_CONFIG_LOCATION 0x083C // 2 bytes
00198 #define MFG_BOOTLOAD_AES_KEY_LOCATION 0x083E // 16 bytes
00199 #define MFG_EZSP_STORAGE_LOCATION 0x084E // 8 bytes
00200 #define MFG_ASH_CONFIG_LOCATION 0x0856 // 40 bytes
00201 #define MFG_CBKE_DATA_LOCATION 0x087E // 92 bytes
00202 #define MFG_INSTALLATION_CODE_LOCATION 0x08DA // 20 bytes
00203 #define MFG_OSC24M_BIAS_TRIM_LOCATION 0x08EE // 2 bytes
00204
00205
00206 #define MFG_EUI_64_LOCATION 0x8000 // Special Trigger - see token.c
00207
00208
00209 #define MFG_ASH_CONFIG_ARRAY_SIZE 20
00210
00211 #ifndef TOKEN_NEXT_ADDRESS
00212 #define TOKEN_NEXT_ADDRESS(region, address)
00213 #endif
00214
00215
00216
00217
00218
00219
00220 TOKEN_NEXT_ADDRESS(MFG_CHIP_DATA_ADDR,MFG_CHIP_DATA_LOCATION)
00221 TOKEN_MFG(MFG_CHIP_DATA, CREATOR_MFG_CHIP_DATA,
00222 0, 0, tokTypeMfgChipData, 1,
00223 {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
00224 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
00225 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF})
00226
00227 TOKEN_NEXT_ADDRESS(MFG_PART_DATA_ADDR,MFG_PART_DATA_LOCATION)
00228 TOKEN_MFG(MFG_PART_DATA, CREATOR_MFG_PART_DATA,
00229 0, 0, tokTypeMfgPartData, 1,
00230 {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF})
00231
00232 TOKEN_NEXT_ADDRESS(MFG_TESTER_DATA_ADDR,MFG_TESTER_DATA_LOCATION)
00233 TOKEN_MFG(MFG_TESTER_DATA, CREATOR_MFG_TESTER_DATA,
00234 0, 0, tokTypeMfgTesterData, 1,
00235 {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF})
00236
00237 TOKEN_NEXT_ADDRESS(MFG_ST_EUI_64_ADDR,MFG_ST_EUI_64_LOCATION)
00238 TOKEN_MFG(MFG_ST_EUI_64, CREATOR_MFG_ST_EUI_64,
00239 0, 0, tokTypeMfgStEui64, 1,
00240 {3,0,0,0,0,0,0,3})
00241
00242 TOKEN_NEXT_ADDRESS(MFG_ANALOG_TRIM_NORMAL_ADDR,MFG_ANALOG_TRIM_NORMAL_LOCATION)
00243 TOKEN_MFG(MFG_ANALOG_TRIM_NORMAL, CREATOR_MFG_ANALOG_TRIM_NORMAL,
00244 0, 0, tokTypeMfgAnalogueTrim, 1,
00245 {0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
00246 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF})
00247
00248 TOKEN_NEXT_ADDRESS(MFG_ANALOG_TRIM_BOOST_ADDR,MFG_ANALOG_TRIM_BOOST_LOCATION)
00249 TOKEN_MFG(MFG_ANALOG_TRIM_BOOST, CREATOR_MFG_ANALOG_TRIM_BOOST,
00250 0, 0, tokTypeMfgAnalogueTrim, 1,
00251 {0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
00252 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF})
00253
00254 TOKEN_NEXT_ADDRESS(MFG_ANALOG_TRIM_BOTH_ADDR,MFG_ANALOG_TRIM_BOTH_LOCATION)
00255 TOKEN_MFG(MFG_ANALOG_TRIM_BOTH, CREATOR_MFG_ANALOG_TRIM_BOTH,
00256 0, 0, tokTypeMfgAnalogueTrimBoth, 1,
00257 {0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF})
00258
00259 TOKEN_NEXT_ADDRESS(MFG_REG_TRIM_ADDR,MFG_REG_TRIM_LOCATION)
00260 TOKEN_MFG(MFG_REG_TRIM, CREATOR_MFG_REG_TRIM,
00261 0, 0, tokTypeMfgRegTrim, 1,
00262 {0xFF, 0xFF})
00263
00264 TOKEN_NEXT_ADDRESS(MFG_1V8_REG_VOLTAGE_ADDR,MFG_1V8_REG_VOLTAGE_LOCATION)
00265 TOKEN_MFG(MFG_1V8_REG_VOLTAGE, CREATOR_MFG_1V8_REG_VOLTAGE,
00266 0, 0, tokTypeMfgRegVoltage1V8, 1,
00267 0xFFFF)
00268
00269 TOKEN_NEXT_ADDRESS(MFG_VREF_VOLTAGE_ADDR,MFG_VREF_VOLTAGE_LOCATION)
00270 TOKEN_MFG(MFG_VREF_VOLTAGE, CREATOR_MFG_VREF_VOLTAGE,
00271 0, 0, tokTypeMfgAdcVrefVoltage, 1,
00272 0xFFFF)
00273
00274 TOKEN_NEXT_ADDRESS(MFG_TEMP_CAL_ADDR,MFG_TEMP_CAL_LOCATION)
00275 TOKEN_MFG(MFG_TEMP_CAL, CREATOR_MFG_TEMP_CAL,
00276 0, 0, tokTypeMfgTempCal, 1,
00277 0xFFFF)
00278
00279 TOKEN_NEXT_ADDRESS(MFG_FIB_VERSION_ADDR,MFG_FIB_VERSION_LOCATION)
00280 TOKEN_MFG(MFG_FIB_VERSION, CREATOR_MFG_FIB_VERSION,
00281 0, 0, tokTypeMfgFibVersion, 1,
00282 CURRENT_MFG_TOKEN_VERSION)
00283
00284 TOKEN_NEXT_ADDRESS(MFG_FIB_CHECKSUM_ADDR,MFG_FIB_CHECKSUM_LOCATION)
00285 TOKEN_MFG(MFG_FIB_CHECKSUM, CREATOR_MFG_FIB_CHECKSUM,
00286 0, 0, tokTypeMfgFibChecksum, 1,
00287 0xFFFF)
00288
00289 TOKEN_NEXT_ADDRESS(MFG_FIB_OBS_ADDR,MFG_FIB_OBS_LOCATION)
00290 TOKEN_MFG(MFG_FIB_OBS, CREATOR_MFG_FIB_OBS,
00291 0, 0, tokTypeMfgFibObs, 1,
00292 {0xFFFF,0x03FC,0xAA55,0xFFFF})
00293
00294
00295
00296 TOKEN_NEXT_ADDRESS(MFG_CIB_OBS_ADDR,MFG_CIB_OBS_LOCATION)
00297 TOKEN_MFG(MFG_CIB_OBS, CREATOR_MFG_CIB_OBS,
00298 0, 0, tokTypeMfgCibObs, 1,
00299 {0x5AA5,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF})
00300
00301 TOKEN_NEXT_ADDRESS(MFG_CUSTOM_VERSION_ADDR,MFG_CUSTOM_VERSION_LOCATION)
00302 TOKEN_MFG(MFG_CUSTOM_VERSION, CREATOR_MFG_CUSTOM_VERSION,
00303 0, 0, tokTypeMfgCustomVersion, 1,
00304 CURRENT_MFG_CUSTOM_VERSION)
00305
00306 TOKEN_NEXT_ADDRESS(MFG_CUSTOM_EUI_64_ADDR,MFG_CUSTOM_EUI_64_LOCATION)
00307 TOKEN_MFG(MFG_CUSTOM_EUI_64, CREATOR_MFG_CUSTOM_EUI_64,
00308 0, 0, tokTypeMfgCustomEui64, 1,
00309 {0,3,3,3,3,3,3,0})
00310
00311 TOKEN_NEXT_ADDRESS(MFG_STRING_ADDR,MFG_STRING_LOCATION)
00312 TOKEN_MFG(MFG_STRING, CREATOR_MFG_STRING,
00313 0, 0, tokTypeMfgString, 1,
00314 {0,})
00315
00316 TOKEN_NEXT_ADDRESS(MFG_BOARD_NAME_ADDR,MFG_BOARD_NAME_LOCATION)
00317 TOKEN_MFG(MFG_BOARD_NAME, CREATOR_MFG_BOARD_NAME,
00318 0, 0, tokTypeMfgBoardName, 1,
00319 {0,})
00320
00321 TOKEN_NEXT_ADDRESS(MFG_MANUF_ID_ADDR,MFG_MANUF_ID_LOCATION)
00322 TOKEN_MFG(MFG_MANUF_ID, CREATOR_MFG_MANUF_ID,
00323 0, 0, tokTypeMfgManufId, 1,
00324 {0x00,0x00,})
00325
00326 TOKEN_NEXT_ADDRESS(MFG_PHY_CONFIG_ADDR,MFG_PHY_CONFIG_LOCATION)
00327 TOKEN_MFG(MFG_PHY_CONFIG, CREATOR_MFG_PHY_CONFIG,
00328 0, 0, tokTypeMfgPhyConfig, 1,
00329 {0x00,0x00,})
00330
00331 TOKEN_NEXT_ADDRESS(MFG_BOOTLOAD_AES_KEY_ADDR,MFG_BOOTLOAD_AES_KEY_LOCATION)
00332 TOKEN_MFG(MFG_BOOTLOAD_AES_KEY, CREATOR_MFG_BOOTLOAD_AES_KEY,
00333 0, 0, tokTypeMfgBootloadAesKey, 1,
00334 {0xFF,})
00335
00336 TOKEN_NEXT_ADDRESS(MFG_EZSP_STORAGE_ADDR,MFG_EZSP_STORAGE_LOCATION)
00337 TOKEN_MFG(MFG_EZSP_STORAGE, CREATOR_MFG_EZSP_STORAGE,
00338 0, 0, tokTypeMfgEzspStorage, 1,
00339 { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF })
00340
00341 TOKEN_NEXT_ADDRESS(MFG_ASH_CONFIG_ADDR,MFG_ASH_CONFIG_LOCATION)
00342 TOKEN_MFG(MFG_ASH_CONFIG, CREATOR_MFG_ASH_CONFIG,
00343 0, 1, tokTypeMfgAshConfig, MFG_ASH_CONFIG_ARRAY_SIZE,
00344 { 0xFFFF, })
00345
00346 TOKEN_NEXT_ADDRESS(MFG_CBKE_DATA_ADDR,MFG_CBKE_DATA_LOCATION)
00347 TOKEN_MFG(MFG_CBKE_DATA, CREATOR_MFG_CBKE_DATA,
00348 0, 0, tokTypeMfgCbkeData, 1,
00349 {0xFF,})
00350
00351 TOKEN_NEXT_ADDRESS(MFG_INSTALLATION_CODE_ADDR,MFG_INSTALLATION_CODE_LOCATION)
00352 TOKEN_MFG(MFG_INSTALLATION_CODE, CREATOR_MFG_INSTALLATION_CODE,
00353 0, 0, tokTypeMfgInstallationCode, 1,
00354 {0xFF,})
00355
00356 TOKEN_NEXT_ADDRESS(MFG_OSC24M_BIAS_TRIM_ADDR,MFG_OSC24M_BIAS_TRIM_LOCATION)
00357 TOKEN_MFG(MFG_OSC24M_BIAS_TRIM, CREATOR_MFG_OSC24M_BIAS_TRIM,
00358 0, 0, tokTypeMfgOsc24mBiasTrim, 1,
00359 {0xFF,})
00360
00361 TOKEN_NEXT_ADDRESS(MFG_EUI_64_ADDR,MFG_EUI_64_LOCATION)
00362 TOKEN_MFG(MFG_EUI_64, CREATOR_MFG_EUI_64,
00363 0, 0, tokTypeMfgEui64, 1,
00364 {3,3,3,3,0,0,0,0})
00365
00366 #undef TOKEN_NEXT_ADDRESS
00367
00368 #endif
00369