nwztools: add NW-WM1A/Z model IDs

Also fix code that was supposed to sort things deterministically and was a
massive failure.

Change-Id: Iedf25f05a94ef51421710a283eb60f33ee977de1
This commit is contained in:
Amaury Pouly 2017-01-07 17:32:47 +01:00
parent 76c73c707a
commit be68b6a7bd
5 changed files with 16 additions and 12 deletions

View file

@ -201,8 +201,8 @@ with open("nwz_db.h", "w") as fp:
# create comment to explain the meaning, gather several meaning together
# if there are more than one (sorted to keep a stable order when we update)
explain = ""
if name in sorted(g_nvp_desc):
explain = " | ".join(list(g_nvp_desc[name]))
if name in g_nvp_desc:
explain = " | ".join(sorted(list(g_nvp_desc[name])))
# overwrite desc set with a single string for later
g_nvp_desc[name] = explain
fp.write(" NWZ_NVP_%s, /* %s */\n" % (name.upper(), explain))

View file

@ -179,3 +179,5 @@
0x1d000005,NW-A26
0x1d000006,NW-A27
0x1d000007,NW-A28
0x20000007,NW-WM1A
0x21000008,NW-WM1Z

View file

@ -205,6 +205,8 @@ struct nwz_model_info_t nwz_model[NWZ_MODEL_COUNT] =
{ 0x1d000005, "NW-A26" },
{ 0x1d000006, "NW-A27" },
{ 0x1d000007, "NW-A28" },
{ 0x20000007, "NW-WM1A" },
{ 0x21000008, "NW-WM1Z" },
};
static int nvp_index_0ac81d[NWZ_NVP_COUNT] =
@ -1026,12 +1028,12 @@ struct nwz_nvp_info_t nwz_nvp[NWZ_NVP_COUNT] =
[NWZ_NVP_BTI] = { "bti", 262144, "boot image" },
[NWZ_NVP_CGP] = { "cgp", 0, "" },
[NWZ_NVP_CLV] = { "clv", 4, "color variation" },
[NWZ_NVP_CNG] = { "cng", 704, "aad/empr key | aad key" },
[NWZ_NVP_CNG] = { "cng", 704, "aad key | aad/empr key" },
[NWZ_NVP_CTR] = { "ctr", 0, "" },
[NWZ_NVP_DBA] = { "dba", 160, "aad icv" },
[NWZ_NVP_DBG] = { "dbg", 0, "" },
[NWZ_NVP_DBI] = { "dbi", 262144, "dead battery image" },
[NWZ_NVP_DBV] = { "dbv", 520, "empr key | empr icv" },
[NWZ_NVP_DBV] = { "dbv", 520, "empr icv | empr key" },
[NWZ_NVP_DCC] = { "dcc", 20, "secure clock" },
[NWZ_NVP_DOR] = { "dor", 4, "key mode (debug/release)" },
[NWZ_NVP_E00] = { "e00", 1024, "EMPR 0" },
@ -1102,7 +1104,7 @@ struct nwz_nvp_info_t nwz_nvp[NWZ_NVP_COUNT] =
[NWZ_NVP_PSK] = { "psk", 512, "bluetooth pskey" },
[NWZ_NVP_PTS] = { "pts", 4, "wifi protected setup" },
[NWZ_NVP_RBT] = { "rbt", 0, "" },
[NWZ_NVP_RND] = { "rnd", 64, "wmt key | random data" },
[NWZ_NVP_RND] = { "rnd", 64, "random data | wmt key" },
[NWZ_NVP_RTC] = { "rtc", 16, "rtc alarm" },
[NWZ_NVP_SDC] = { "sdc", 4, "SD Card export flag" },
[NWZ_NVP_SDP] = { "sdp", 64, "sound driver parameter" },
@ -1217,7 +1219,7 @@ static unsigned long models_nwz_s770[] = { 0x16000001, 0x16000002, 0x16000004,
static unsigned long models_nw_s780[] = { 0x19000001, 0x19000002, 0x19000004,
0x19000005 };
static unsigned long models_nw_wm1[] = { };
static unsigned long models_nw_wm1[] = { 0x20000007, 0x21000008 };
static unsigned long models_nwz_x1000[] = { 0x5000002, 0x5000004, 0x5000005,
0x5020002, 0x5040002, 0x5020004, 0x5040004, 0x5020005, 0x5040005 };
@ -1263,7 +1265,7 @@ struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT] =
{ "nwz-s760", "NWZ-S740 Series", 10, models_nwz_s760, &nvp_index_f505c8 },
{ "nwz-s770", "NWZ-S770 Series", 8, models_nwz_s770, 0 },
{ "nw-s780", "NW-S780 Series", 4, models_nw_s780, &nvp_index_6485c8 },
{ "nw-wm1", "NW-WM1 Series", 0, models_nw_wm1, &nvp_index_398250 },
{ "nw-wm1", "NW-WM1 Series", 2, models_nw_wm1, &nvp_index_398250 },
{ "nwz-x1000", "NWZ-X1000 Series", 9, models_nwz_x1000, 0 },
{ "nw-zx100", "NW-ZX100 Series", 6, models_nw_zx100, 0 },
{ "nwz-zx2", "NW-ZX2", 0, models_nwz_zx2, &nvp_index_c8fc85 },

View file

@ -37,12 +37,12 @@ enum nwz_nvp_node_t
NWZ_NVP_BTI, /* boot image */
NWZ_NVP_CGP, /* */
NWZ_NVP_CLV, /* color variation */
NWZ_NVP_CNG, /* aad/empr key | aad key */
NWZ_NVP_CNG, /* aad key | aad/empr key */
NWZ_NVP_CTR, /* */
NWZ_NVP_DBA, /* aad icv */
NWZ_NVP_DBG, /* */
NWZ_NVP_DBI, /* dead battery image */
NWZ_NVP_DBV, /* empr key | empr icv */
NWZ_NVP_DBV, /* empr icv | empr key */
NWZ_NVP_DCC, /* secure clock */
NWZ_NVP_DOR, /* key mode (debug/release) */
NWZ_NVP_E00, /* EMPR 0 */
@ -113,7 +113,7 @@ enum nwz_nvp_node_t
NWZ_NVP_PSK, /* bluetooth pskey */
NWZ_NVP_PTS, /* wifi protected setup */
NWZ_NVP_RBT, /* */
NWZ_NVP_RND, /* wmt key | random data */
NWZ_NVP_RND, /* random data | wmt key */
NWZ_NVP_RTC, /* rtc alarm */
NWZ_NVP_SDC, /* SD Card export flag */
NWZ_NVP_SDP, /* sound driver parameter */
@ -142,7 +142,7 @@ enum nwz_nvp_node_t
/* Invalid NVP index */
#define NWZ_NVP_INVALID -1 /* Non-existent entry */
/* Number of models */
#define NWZ_MODEL_COUNT 181
#define NWZ_MODEL_COUNT 183
/* Number of series */
#define NWZ_SERIES_COUNT 37

View file

@ -30,7 +30,7 @@ nwz-s750,NWZ-S740 Series,0x9000002,0x9000004,0x9000005,0xf000002,0xf000004
nwz-s760,NWZ-S740 Series,0x12000001,0x12000002,0x12000004,0x12000005,0x12000006,0x12010001,0x12010002,0x12010004,0x12010005,0x12010006
nwz-s770,NWZ-S770 Series,0x16000001,0x16000002,0x16000004,0x16000005,0x16010001,0x16010002,0x16010004,0x16010005
nw-s780,NW-S780 Series,0x19000001,0x19000002,0x19000004,0x19000005
nw-wm1,NW-WM1 Series,
nw-wm1,NW-WM1 Series,0x20000007,0x21000008
nwz-x1000,NWZ-X1000 Series,0x5000002,0x5000004,0x5000005,0x5020002,0x5040002,0x5020004,0x5040004,0x5020005,0x5040005
nw-zx100,NW-ZX100 Series,0x1c000007,0x1c000001,0x1c000002,0x1c000004,0x1c000005,0x1c000006
nwz-zx2,NW-ZX2,