summaryrefslogtreecommitdiff
path: root/utils/nwztools
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-11-11 15:40:56 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2016-11-11 16:07:14 +0100
commit44bb2856a59be53ef5ede154a39c54a59b1cc6d0 (patch)
treece343ecff309d6d0172ea56946a9ce679329b250 /utils/nwztools
parent19de536ce2f3c8066ca5be9b570f72e5c1e88342 (diff)
downloadrockbox-44bb2856a59be53ef5ede154a39c54a59b1cc6d0.tar.gz
rockbox-44bb2856a59be53ef5ede154a39c54a59b1cc6d0.zip
nwztools/database: add database of information on Sony NWZ linux players
There must be an evil genius in Sony's Walkman division. Someone who made sure that each model is close enough to the previous one so that little code is needed but different enough so that an educated guess is not enough. Each linux-based Sony player has a model ID (mid) which is a 32-bit integer. I was able to extract a list of all model IDs and the correspoding name of the player (see README). This gives us 1) a nice list of all players (because NWZ-A729 vs NWZ-A729B, really Sony?) 2) an easy way to find the name of player programatically. It seems that the lower 8-bit of the model ID gives the storage size but don't bet your life on it. The remaining bytes seem to follow some kind of pattern but there are exceptions. From this list, I was able to build a list of all Sony's series (up to quite recent one). The only safe way to build that is by hand, with a list of series, each series having a list of model IDs. The notion of series is very important because all models in a series share the same firmware. A very important concept on Sony's players is the NVP, an area of the flash that stores data associated with keys. The README contains more information but basically this is where is record the model ID, the destination, the boot flags, the firmware upgrade flags, the boot image, the DRM keys, and a lot of other stuff. Of course Sony decided to slightly tweak the index of the keys regularly over time which means that each series has a potentially different map, and we need this map to talk to the NVP driver. Fortunately, Sony distributes the kernel for all its players and they contain a kernel header with this information. I wrote a script to unpack kernel sources and parse this header, producing a bunch of nw-*.txt files, included in this commit. This map is very specific though: it maps Sony's 3-letter names (bti) to indexes (1). This is not very useful without the decription (bti = boot image) and its size (262144). This information is harder to come by, and is only stored in one place: if icx_nvp_emmc.ko drivers, found on the device. Fortunately, Sony distributes a number of firmware upgrade, that contain the rootfs, than once extracted contain this driver. The driver is a standard ELF files with symbols. I wrote a parsing tool (nvptool) that is able to extract this information from the drivers. Using that, I produced a bunch of nodes-nw*.txt files. A reasonable assumption is that nodes meaning and size do not change over time (bti is always the boot image and is always 262144 bytes), so by merging a few of those file, we can get a complete picture (note that some nodes that existed in older player do not exists anymore so we really need to merge several ones from different generations). The advantage of storing all this information in plain text files, is that it now makes it easy to parse it and produce whatever format we want to use it. I wrote a python script that parses all this mess and produces a C file and header with all this information (nwz_db.{c,h}). Change-Id: Id790581ddd527d64418fe9e4e4df8e0546117b80
Diffstat (limited to 'utils/nwztools')
-rw-r--r--utils/nwztools/database/README62
-rwxr-xr-xutils/nwztools/database/check_models_series.sh8
-rwxr-xr-xutils/nwztools/database/gen_db.py317
-rw-r--r--utils/nwztools/database/models.txt181
-rw-r--r--utils/nwztools/database/nvp/Makefile26
-rw-r--r--utils/nwztools/database/nvp/README67
-rw-r--r--utils/nwztools/database/nvp/nodes-nwz-a10.txt89
-rw-r--r--utils/nwztools/database/nvp/nodes-nwz-a20.txt89
-rw-r--r--utils/nwztools/database/nvp/nodes-nwz-a820.txt0
-rw-r--r--utils/nwztools/database/nvp/nodes-nwz-a860.txt89
-rw-r--r--utils/nwztools/database/nvp/nodes-nwz-e450.txt78
-rw-r--r--utils/nwztools/database/nvp/nodes-nwz-e460.txt89
-rw-r--r--utils/nwztools/database/nvp/nodes-nwz-e580.txt88
-rw-r--r--utils/nwztools/database/nvp/nodes-nwz-zx100.txt89
-rw-r--r--utils/nwztools/database/nvp/nvptool.cpp754
-rw-r--r--utils/nwztools/database/nvp/nw-a30.txt92
-rw-r--r--utils/nwztools/database/nvp/nw-e060.txt90
-rw-r--r--utils/nwztools/database/nvp/nw-e080.txt89
-rw-r--r--utils/nwztools/database/nvp/nw-s780.txt89
-rw-r--r--utils/nwztools/database/nvp/nwz-a10.txt90
-rw-r--r--utils/nwztools/database/nvp/nwz-a20.txt90
-rw-r--r--utils/nwztools/database/nvp/nwz-a850.txt79
-rw-r--r--utils/nwztools/database/nvp/nwz-a860.txt90
-rw-r--r--utils/nwztools/database/nvp/nwz-e350.txt79
-rw-r--r--utils/nwztools/database/nvp/nwz-e450.txt79
-rw-r--r--utils/nwztools/database/nvp/nwz-e460.txt90
-rw-r--r--utils/nwztools/database/nvp/nwz-e470.txt87
-rw-r--r--utils/nwztools/database/nvp/nwz-e580.txt89
-rw-r--r--utils/nwztools/database/nvp/nwz-s760.txt90
-rw-r--r--utils/nwztools/database/nvp/nwz-zx100.txt90
-rw-r--r--utils/nwztools/database/nvp/nwz-zx2.txt90
-rwxr-xr-xutils/nwztools/database/nvp/parse_all_nvp_headers.sh33
-rwxr-xr-xutils/nwztools/database/nvp/parse_all_nvp_nodes.sh32
-rwxr-xr-xutils/nwztools/database/nvp/parse_nvp_header.sh77
-rwxr-xr-xutils/nwztools/database/nvp/parse_nvp_nodes.sh58
-rw-r--r--utils/nwztools/database/nwz_db.c1268
-rw-r--r--utils/nwztools/database/nwz_db.h185
-rw-r--r--utils/nwztools/database/series.txt36
38 files changed, 5118 insertions, 0 deletions
diff --git a/utils/nwztools/database/README b/utils/nwztools/database/README
new file mode 100644
index 0000000000..62d5ca66e8
--- /dev/null
+++ b/utils/nwztools/database/README
@@ -0,0 +1,62 @@
1This file explains how the database was created an how to update it.
2
3Model list
4==========
5
6The model list (models.txt) was extract from Sony's mptapp on target. This is
7most probably the only reliable way of getting model IDs. It cannot be done
8automatically but it is easy to locate the list using a tool like IDA. It is
9basically a long list of the following structure:
10 struct model_info_t
11 {
12 const char *name;
13 uin32_t mid;
14 };
15Once identified, it is easy to copy it to a file and grep/sed/awk it to produce
16the textual list. It depends on which tool you use. I decided to keep this list
17because it is an easy format to produce and parse. For consistency, I decided
18to use upper case for the model name and lower case for mid. Keep this when
19you modify the list to keep the diff minimal.
20
21IMPORTANT NOTE: some players have more than one model ID (ie same name) !!
22
23FORMAT (models.txt): list of pairs <mid>,<name> where <name> is upper case
24human name of the player and <mid> is the lower-case hex value of the model ID.
25
26Series list
27===========
28
29The original series list was semi-automatically generated. Unfortunately, Sony
30does not use a 100% regular naming scheme. It is thus simpler to modify it by
31hand for newer models. To keep consistency, the generator script will make sure
32that the series list only refers to device in the model list and that no device
33in the model list is not refered to.
34
35FORMAT (series.txt): list of <codename>,<name>,<mid1>,<mid2>,... where <codename>
36is the (Rockbox-only) codename of the series (that should match what other tools
37use, like upgtools), always in lower case; where <name> is the humand name of the
38series, and <midX> is the list of models in the series (given by model IDs because
39name are not uniques).
40
41Advise on tooling
42=================
43
44The format of the file was carefully chosen to be easy to use and produce. It
45avoids uses spaces are separators because it breaks easily. The "," separator
46is a good match in this case and shouldn't pose a problem. In most tools, changing
47the separator is easy. For example with awk, you can use the
48 -F ","
49option, or define in the preamble with
50 BEGIN { FS = ","; }
51. Other tools have similar constructs.
52
53NVPs
54====
55
56See nvps/README
57
58gen_db.py
59=========
60
61This script generates the database (nwz_db.{c,h}) from the various textual files.
62The output must NOT be touched by hand.
diff --git a/utils/nwztools/database/check_models_series.sh b/utils/nwztools/database/check_models_series.sh
new file mode 100755
index 0000000000..50d574ff66
--- /dev/null
+++ b/utils/nwztools/database/check_models_series.sh
@@ -0,0 +1,8 @@
1echo "duplicates in models.txt:"
2MODELS=$(cat models.txt | awk -F ',' '{ print($1) }' | sort)
3echo "$MODELS" | uniq -d
4echo "duplicates in series.txt:"
5SERIES_MODELS=$(cat series.txt | awk '{ n=split($0,a,","); for(i=3;i<=n;i++) if(length(a[i]) != 0) print(a[i]); }' | sort)
6echo "$SERIES_MODELS" | uniq -d
7echo "diff between models.txt and series.txt:"
8diff <(echo "$MODELS") <(echo "$SERIES_MODELS")
diff --git a/utils/nwztools/database/gen_db.py b/utils/nwztools/database/gen_db.py
new file mode 100755
index 0000000000..61c08f919a
--- /dev/null
+++ b/utils/nwztools/database/gen_db.py
@@ -0,0 +1,317 @@
1#!/usr/bin/python3
2import glob
3import os
4import re
5import subprocess
6
7# parse models.txt
8g_models = []
9with open('models.txt') as fp:
10 for line in fp:
11 # we unpack and repack 1) to make the format obvious 2) to catch errors
12 mid,name = line.rstrip().split(",")
13 g_models.append({'mid': int(mid, 0), 'name': name})
14# parse series.txt
15g_series = []
16with open('series.txt') as fp:
17 for line in fp:
18 # we unpack and repack 1) to make the format obvious 2) to catch errors
19 arr = line.rstrip().split(",")
20 codename = arr[0]
21 name = arr[1]
22 models = arr[2:]
23 # handle empty list
24 if len(models) == 1 and models[0] == "":
25 models = []
26 models = [int(mid,0) for mid in models]
27 g_series.append({'codename': codename, 'name': name, 'models': models})
28# parse all maps in nvp/
29# since most nvps are the same, what we actually do is to compute the md5sum hash
30# of all files, to identify groups and then each entry in the name is in fact the
31# hash, and we only parse one file per hash group
32g_hash_nvp = dict() # hash -> nvp
33g_nvp_hash = dict() # codename -> hash
34HASH_SIZE=6
35map_files = glob.glob('nvp/nw*.txt')
36for line in subprocess.run(["md5sum"] + map_files, stdout = subprocess.PIPE).stdout.decode("utf-8").split("\n"):
37 if len(line.rstrip()) == 0:
38 continue
39 hash, file = line.rstrip().split()
40 codename = re.search('nvp/(.*)\.txt', file).group(1)
41 hash = hash[:HASH_SIZE]
42 # only keep one file
43 if not (hash in g_hash_nvp):
44 g_hash_nvp[hash] = set()
45 g_hash_nvp[hash].add(codename);
46 g_nvp_hash[codename] = hash
47# we have some file nodes (nodes-*) but not necessarily for all series
48# so for each hash group, try to find at least one
49for hash in g_hash_nvp:
50 # look at all codename and see if we can find one with a node file
51 node_codename = ""
52 for codename in g_hash_nvp[hash]:
53 if os.path.isfile("nvp/nodes-%s.txt" % codename):
54 node_codename = codename
55 break
56 # if we didn't find one, we just keep the first one
57 # otherwise keep the one we found
58 if node_codename == "":
59 node_codename = g_hash_nvp[hash].pop()
60 g_hash_nvp[hash] = node_codename
61# for each entry in g_hash_nvp, replace the file name by the actual table
62# that we parse, and compute all nvp names at the same time
63g_nvp_names = set() # set of all nvp names
64g_nvp_desc = dict() # name -> set of all description of a node
65g_nvp_size = dict() # name -> set of all possible sizes of a node
66for hash in g_hash_nvp:
67 codename = g_hash_nvp[hash]
68 # extract codename from file
69 # parse file
70 map = dict()
71 with open("nvp/%s.txt" % codename) as fp:
72 for line in fp:
73 # we unpack and repack 1) to make the format obvious 2) to catch errors
74 name,index = line.rstrip().split(",")
75 # convert node to integer but be careful of leading 0 (ie 010 is actually
76 # 10 in decimal, it is not in octal)
77 index = int(index, 10)
78 map[index] = name
79 g_nvp_names.add(name)
80 # parse node map if any
81 node_map = dict()
82 if os.path.isfile("nvp/nodes-%s.txt" % codename):
83 with open("nvp/nodes-%s.txt" % codename) as fp:
84 for line in fp:
85 # we unpack and repack 1) to make the format obvious 2) to catch errors
86 index,size,desc = line.rstrip().split(",")
87 # convert node to integer but be careful of leading 0 (ie 010 is actually
88 # 10 in decimal, it is not in octal)
89 index = int(index, 10)
90 desc = desc.rstrip()
91 node_map[index] = {'size': size, 'desc': desc}
92 # compute final nvp
93 nvp = dict()
94 for index in map:
95 size = 0
96 desc = ""
97 name = map[index]
98 if index in node_map:
99 size = node_map[index]["size"]
100 desc = node_map[index]["desc"]
101 nvp[name] = index
102 if not (name in g_nvp_desc):
103 g_nvp_desc[name] = set()
104 if len(desc) != 0:
105 g_nvp_desc[name].add(desc)
106 if not (name in g_nvp_size):
107 g_nvp_size[name] = set()
108 if size != 0:
109 g_nvp_size[name].add(size)
110 g_hash_nvp[hash] = nvp
111
112#
113# generate header
114#
115header_begin = \
116"""\
117/***************************************************************************
118 * __________ __ ___.
119 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
120 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
121 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
122 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \\
123 * \/ \/ \/ \/ \/
124 *
125 * Copyright (C) 2016 Amaury Pouly
126 *
127 * This program is free software; you can redistribute it and/or
128 * modify it under the terms of the GNU General Public License
129 * as published by the Free Software Foundation; either version 2
130 * of the License, or (at your option) any later version.
131 *
132 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
133 * KIND, either express or implied.
134 *
135 ****************************************************************************/
136#ifndef __NWZ_DB_H__
137#define __NWZ_DB_H__
138
139/** /!\ This file was automatically generated, DO NOT MODIFY IT DIRECTLY /!\ */
140
141/* List of all known NVP nodes */
142enum nwz_nvp_node_t
143{
144"""
145
146header_end = \
147"""\
148 NWZ_NVP_COUNT /* Number of nvp nodes */
149};
150
151/* Invalid NVP index */
152#define NWZ_NVP_INVALID -1 /* Non-existent entry */
153/* Number of models */
154#define NWZ_MODEL_COUNT %s
155/* Number of series */
156#define NWZ_SERIES_COUNT %s
157
158/* NVP node info */
159struct nwz_nvp_info_t
160{
161 const char *name; /* Sony's name: "bti" */
162 unsigned long size; /* Size in bytes */
163 const char *desc; /* Description: "bootloader image" */
164};
165
166/* NVP index map (nwz_nvp_node_t -> index) */
167typedef int nwz_nvp_index_t[NWZ_NVP_COUNT];
168
169/* Model info */
170struct nwz_model_info_t
171{
172 unsigned long mid; /* Model ID: first 4 bytes of the NVP mid entry */
173 const char *name; /* Human name: "NWZ-E463" */
174};
175
176/* Series info */
177struct nwz_series_info_t
178{
179 const char *codename; /* Rockbox codename: nwz-e460 */
180 const char *name; /* Human name: "NWZ-E460 Series" */
181 int mid_count; /* number of entries in mid_list */
182 unsigned long *mid; /* List of model IDs */
183 /* Pointer to a name -> index map, nonexistent entries map to NWZ_NVP_INVALID */
184 nwz_nvp_index_t *nvp_index;
185};
186
187/* List of all NVP entries, indexed by nwz_nvp_node_t */
188extern struct nwz_nvp_info_t nwz_nvp[NWZ_NVP_COUNT];
189/* List of all models, sorted by increasing values of model ID */
190extern struct nwz_model_info_t nwz_model[NWZ_MODEL_COUNT];
191/* List of all series */
192extern struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT];
193
194#endif /* __NWZ_DB_H__ */
195"""
196
197with open("nwz_db.h", "w") as fp:
198 fp.write(header_begin)
199 # generate list of all nvp nodes
200 for name in sorted(g_nvp_names):
201 # create comment to explain the meaning, gather several meaning together
202 # if there are more than one
203 explain = ""
204 if name in g_nvp_desc:
205 explain = " | ".join(list(g_nvp_desc[name]))
206 # overwrite desc set with a single string for later
207 g_nvp_desc[name] = explain
208 fp.write(" NWZ_NVP_%s, /* %s */\n" % (name.upper(), explain))
209 fp.write(header_end % (len(g_models), len(g_series)))
210
211#
212# generate tables
213#
214impl_begin = \
215"""\
216/***************************************************************************
217 * __________ __ ___.
218 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
219 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
220 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
221 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \\
222 * \/ \/ \/ \/ \/
223 *
224 * Copyright (C) 2016 Amaury Pouly
225 *
226 * This program is free software; you can redistribute it and/or
227 * modify it under the terms of the GNU General Public License
228 * as published by the Free Software Foundation; either version 2
229 * of the License, or (at your option) any later version.
230 *
231 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
232 * KIND, either express or implied.
233 *
234 ****************************************************************************/
235
236/** /!\ This file was automatically generated, DO NOT MODIFY IT DIRECTLY /!\ */
237
238#include "nwz_db.h"
239
240struct nwz_model_info_t nwz_model[NWZ_MODEL_COUNT] =
241{
242"""
243
244def by_mid(model):
245 return model["mid"]
246
247def by_name(nvp_entry):
248 return nvp_entry["name"]
249
250def codename_to_c(codename):
251 return re.sub('[^a-zA-Z0-9]', '_', codename, 0)
252
253with open("nwz_db.c", "w") as fp:
254 fp.write(impl_begin)
255 # generate model list (sort by mid)
256 for model in sorted(g_models, key = by_mid):
257 fp.write(" { %s, \"%s\" },\n" % (hex(model["mid"]), model["name"]))
258 fp.write("};\n")
259 # generate nvps
260 for hash in g_hash_nvp:
261 nvp = g_hash_nvp[hash]
262 fp.write("\nstatic int nvp_index_%s[NWZ_NVP_COUNT] =\n" % hash)
263 fp.write("{\n")
264 for name in sorted(g_nvp_names):
265 index = "NWZ_NVP_INVALID"
266 if name in nvp:
267 index = nvp[name]
268 fp.write(" [NWZ_NVP_%s] = %s,\n" % (name.upper(), index))
269 fp.write("};\n")
270 # generate nvp info
271 fp.write("\nstruct nwz_nvp_info_t nwz_nvp[NWZ_NVP_COUNT] =\n")
272 fp.write("{\n")
273 for name in sorted(g_nvp_names):
274 size = 0
275 if name in g_nvp_size:
276 size_set = g_nvp_size[name]
277 if len(size_set) == 0:
278 size = 0
279 elif len(size_set) == 1:
280 size = next(iter(size_set))
281 else:
282 print("Warning: nvp node \"%s\" has several possible sizes: %s"
283 % (name, size_set))
284 size = 0
285 desc = ""
286 if name in g_nvp_desc:
287 desc = g_nvp_desc[name]
288 fp.write(" [NWZ_NVP_%s] = { \"%s\", %s, \"%s\" },\n" % (name.upper(),
289 name, size, desc))
290 fp.write("};\n")
291 # generate list of models for each series
292 for series in g_series:
293 c_codename = codename_to_c(series["codename"])
294 list = [hex(mid) for mid in series["models"]]
295 limit = 3
296 c_list = ""
297 while len(list) != 0:
298 if len(list) <= limit:
299 c_list = c_list + ", ".join(list)
300 list = []
301 else:
302 c_list = c_list + ", ".join(list[:limit]) + ",\n "
303 list = list[limit:]
304 limit = 6
305 fp.write("\nstatic unsigned long models_%s[] = { %s };\n" % (c_codename, c_list))
306 # generate series list
307 fp.write("\nstruct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT] =\n{\n")
308 for series in g_series:
309 name = series["name"]
310 codename = series["codename"]
311 c_codename = codename_to_c(codename)
312 nvp = "0"
313 if codename in g_nvp_hash:
314 nvp = "&nvp_index_%s" % g_nvp_hash[codename]
315 fp.write(" { \"%s\", \"%s\", %s, models_%s, %s },\n" % (codename,
316 name, len(series["models"]), c_codename, nvp))
317 fp.write("};\n")
diff --git a/utils/nwztools/database/models.txt b/utils/nwztools/database/models.txt
new file mode 100644
index 0000000000..89a372f1bd
--- /dev/null
+++ b/utils/nwztools/database/models.txt
@@ -0,0 +1,181 @@
10x10000,NWZ-A815
20x10001,NWZ-A816
30x10002,NWZ-A818
40x1000000,NW-S615F
50x1000001,NW-S616F
60x1010000,NW-S715F
70x1010001,NW-S716F
80x1010002,NW-S718F
90x1020000,NWZ-S615F
100x1020001,NWZ-S616F
110x1020002,NWZ-S618F
120x1030000,NWZ-S515
130x1030001,NWZ-S516
140x1040000,NWZ-S715F
150x1040001,NWZ-S716F
160x1040002,NWZ-S718F
170x2000001,NW-A916
180x2000002,NW-A918
190x2000004,NW-A919
200x3000001,NWZ-A826
210x3000002,NWZ-A828
220x3000004,NWZ-A829
230x3010001,NW-A826
240x3010002,NW-A828
250x3010004,NW-A829
260x3020001,NWZ-A726B
270x3020002,NWZ-A728B
280x3020004,NWZ-A729B
290x3030001,NWZ-A726
300x3030002,NWZ-A728
310x3030004,NWZ-A729
320x4000001,NW-S636F
330x4000002,NW-S638F
340x4000004,NW-S639F
350x4010001,NW-S736F
360x4010002,NW-S738F
370x4010004,NW-S739F
380x4020001,NWZ-S636F
390x4020002,NWZ-S638F
400x4020004,NWZ-S639F
410x4030001,NWZ-S736F
420x4030002,NWZ-S738F
430x4030004,NWZ-S739F
440x5000002,NW-X1040
450x5000004,NW-X1050
460x5000005,NW-X1060
470x5010002,NWZ-NONAME
480x5010004,NWZ-NONAME
490x5010005,NWZ-NONAME
500x5020002,NWZ-X1040
510x5020004,NWZ-X1050
520x5020005,NWZ-X1060
530x5040002,NWZ-X1041
540x5040004,NWZ-X1051
550x5040005,NWZ-X1061
560x6010002,NW-S644
570x6010004,NW-S645
580x6010005,NW-S646
590x6020002,NWZ-S744
600x6020004,NWZ-S745
610x6020005,NWZ-S746
620x6030002,NW-S744
630x6030004,NW-S745
640x6030005,NW-S746
650x7000004,NWZ-A845
660x7000005,NWZ-A846
670x7000006,NWZ-A847
680x7010004,NW-A845
690x7010005,NW-A846
700x7010006,NW-A847
710x9000002,NW-S754
720x9000004,NW-S755
730x9000005,NW-S756
740x8000000,NW-E052
750x8000001,NW-E053
760x8000002,NW-E054
770xb000001,NWZ-E453
780xb000002,NWZ-E454
790xb000004,NWZ-E455
800xc000001,NWZ-E353
810xc000002,NWZ-E354
820xc000004,NWZ-E355
830xd000001,NWZ-E553
840xd000002,NWZ-E554
850xd000004,NWZ-E555
860xd000005,NWZ-E556
870xe000004,NWZ-A855
880xe000005,NWZ-A856
890xe000006,NWZ-A857
900xf000002,NWZ-S754
910xf000004,NWZ-S755
920x10000000,NWZ-E052
930x10000001,NWZ-E053
940x11000001,NW-A863
950x11000002,NW-A864
960x11000004,NW-A865
970x11000005,NW-A866
980x11000006,NW-A867
990x11010001,NWZ-A863
1000x11010002,NWZ-A864
1010x11010004,NWZ-A865
1020x11010005,NWZ-A866
1030x11010006,NWZ-A867
1040x11020001,NWZ-A863
1050x11020002,NWZ-A864
1060x11020004,NWZ-A865
1070x11020005,NWZ-A866
1080x11020006,NWZ-A867
1090x12000001,NW-S763
1100x12000002,NW-S764
1110x12000004,NW-S765
1120x12000005,NW-S766
1130x12000006,NW-S767
1140x12010001,NWZ-S763
1150x12010002,NWZ-S764
1160x12010004,NWZ-S765
1170x12010005,NWZ-S766
1180x12010006,NWZ-S767
1190x13000001,NWZ-E463
1200x13000002,NWZ-E464
1210x13000004,NWZ-E465
1220x14000000,NW-E062
1230x14000001,NW-E063
1240x14000002,NW-E064
1250x14000004,NW-E065
1260x14000005,NW-E066
1270x15000001,NWZ-E473
1280x15000002,NWZ-E474
1290x15000004,NWZ-E475
1300x15000005,NWZ-E476
1310x15010001,NWZ-E573
1320x15010002,NWZ-E574
1330x15010004,NWZ-E575
1340x15010005,NWZ-E576
1350x16000001,NW-S773
1360x16000002,NW-S774
1370x16000004,NW-S775
1380x16000005,NW-S776
1390x16010001,NWZ-S773
1400x16010002,NWZ-S774
1410x16010004,NWZ-S775
1420x16010005,NWZ-S776
1430x19000001,NW-S783
1440x19000002,NW-S784
1450x19000004,NW-S785
1460x19000005,NW-S786
1470x19010001,NW-E083
1480x19010002,NW-E084
1490x19010004,NW-E085
1500x19010005,NW-E086
1510x19020001,NWZ-E583
1520x19020002,NWZ-E584
1530x19020004,NWZ-E585
1540x19020005,NWZ-E586
1550x1a000001,NW-A13
1560x1a000002,NW-A14
1570x1a000004,NW-A15
1580x1a000005,NW-A16
1590x1a000006,NW-A17
1600x1a010001,NWZ-A13
1610x1a010002,NWZ-A14
1620x1a010004,NWZ-A15
1630x1a010005,NWZ-A16
1640x1a010006,NWZ-A17
1650x1b000001,NW-S13
1660x1b000002,NW-S14
1670x1b000004,NW-S15
1680x1b000005,NW-S16
1690x1b000006,NW-S17
1700x1c000001,NW-ZX103
1710x1c000002,NW-ZX104
1720x1c000004,NW-ZX105
1730x1c000005,NW-ZX106
1740x1c000006,NW-ZX107
1750x1c000007,NW-ZX100
1760x1d000001,NW-A23
1770x1d000002,NW-A24
1780x1d000004,NW-A25
1790x1d000005,NW-A26
1800x1d000006,NW-A27
1810x1d000007,NW-A28
diff --git a/utils/nwztools/database/nvp/Makefile b/utils/nwztools/database/nvp/Makefile
new file mode 100644
index 0000000000..d12bcb3451
--- /dev/null
+++ b/utils/nwztools/database/nvp/Makefile
@@ -0,0 +1,26 @@
1DEFINES=
2CC=gcc
3CXX=g++
4LD=g++
5PROFILE=
6CFLAGS=-g $(PROFILE) -std=c99 -W -Wall $(DEFINES) `xml2-config --cflags`
7CXXFLAGS=-g $(PROFILE) -W -Wall $(DEFINES) `xml2-config --cflags`
8LDFLAGS=$(PROFILE) `xml2-config --libs`
9BINS=nvptool
10
11all: $(BINS)
12
13%.o: %.c
14 $(CC) $(CFLAGS) -c -o $@ $<
15
16%.o: %.cpp
17 $(CXX) $(CXXFLAGS) -c -o $@ $<
18
19nvptool: nvptool.o
20 $(LD) -o $@ $^ $(LDFLAGS)
21
22clean:
23 rm -fr *.o
24
25veryclean:
26 rm -rf $(BINS)
diff --git a/utils/nwztools/database/nvp/README b/utils/nwztools/database/nvp/README
new file mode 100644
index 0000000000..cb403291c8
--- /dev/null
+++ b/utils/nwztools/database/nvp/README
@@ -0,0 +1,67 @@
1The NVP map varies a lot from players to players, it is inconceivable to build
2it by hand. The approach taken is to extract it from the kernel of each player.
3Since Sony provides the kernel of all players, it is 'only' a matter of
4downloading all of them. A bit of back story on the NVP: it is non-volatile
5area of the flash that is divided in regions and then "sectors" (unrelated to
6hard drive sectors). Each "sector" stores the data of a "node". The ABI
7between the NVP driver and the userspace is an index: the userspace gives the
8index of a node, and then drives looksup its table to see where it is and what
9is its size. The index map changes over time so Sony introduces standard "names"
10for its entries, those are 3-letters acronym (for example "fup" or "bti" or "shp")
11that have a corresponding index. For some reason, the driver also contains a
12description of the nodes, in english (so "bti" stands for "boot image").
13
14parse_nvp_header.sh
15===================
16
17This script is given a file name, a kernel directory or a kernel tgz and it will
18try to extract the mapping automatically. It produces a list of pairs
19 <node>,<name>
20where <node> is the index of the node (that's the only thing that is usable on
21a running device) and <name> is the standard name of the node. Note that is
22some kind of acronym (like 'fup') and the description needs to be generated
23separatly (see other section).
24
25parse_all_nvp_headers.sh
26========================
27
28This scripts expects a directory to have the following structure:
29 dir/
30 nwz-a10/
31 linux-kernel-*.tgz
32 nwz-e460/
33 linxu-kernel-*.tgz
34 ...
35Each sudirectory must the series name (as used in ../series.txt) and the kernel
36must be a tgz (end in .tgz and not .tar.gz) of the form linux-kernel-*.tgz. Usually
37the variable bit will be the version but some kernels have unknown versions. It
38will then run parse_nvp_header.sh on each of them and store the result in a
39file called <series name>.txt
40
41NOTE: the kernel can be symlinks to other files
42
43nvptool
44=======
45
46The kernel headers do no contain the description of the nvp node names.
47This one can be extract from the icx_nvp[_emmc].ko driver on target using complicated
48elf parsing done by nvptool. Technically nvptoo can find much more information
49like the node -> humanname mapping as well and the actual sector on the disk but
50since we can already extract it easily from the headers, we only extract description
51names from it.
52
53parse_all_nvp_nodes.sh
54======================
55
56This scripts expects a directory to have the following structure:
57 dir/
58 nwz-a10/
59 rootfs.tgz
60 nwz-e460/
61 rootfs.tgz
62 ...
63Each sudirectory must the series name (as used in ../series.txt) and the rootfs
64must be a tar. It will then extract the relevant icx_nvp driver from it and run
65nvptool on it to produce a file called nodes-<series name>.txt
66
67NOTE: the rootfs can be symlinks to other files
diff --git a/utils/nwztools/database/nvp/nodes-nwz-a10.txt b/utils/nwztools/database/nvp/nodes-nwz-a10.txt
new file mode 100644
index 0000000000..2beb185b6c
--- /dev/null
+++ b/utils/nwztools/database/nvp/nodes-nwz-a10.txt
@@ -0,0 +1,89 @@
11,4,system information
22,32,u-boot password
33,4,firmware update flag
44,4,beep ok flag
55,4,hold mode
66,16,rtc alarm
77,64,model id
88,5,product code
99,16,serial number
1010,8,update file name
1111,64,key and signature
1212,32,ship information
1313,4,test mode flag
1414,4,getty mode flag
1515,16,fm parameter
1616,64,sound driver parameter
1717,64,noise cancel driver parameter
1818,512,bluetooth pskey
1977,4,wifi protected setup
2085,4,battery calibration
2119,2048,bluetooth parameter
2220,512,btmw factory pair info
2321,512,btmw factory scdb
2422,4,btmw log mode flag
2578,4,application debug mode flag
2679,4,browser log mode flag
2780,4,time out to sleep
2881,4,europe vol regulation flag
2982,4,function information
3083,4,service id
3184,4,marlin key
3286,4,MSC only mode flag
3389,4,SD Card export flag
3423,704,aad/empr key
3524,160,aad icv
3625,520,empr icv
3726,4,key mode (debug/release)
3827,64,random data
3928,8224,slacker id file
4029,64,starfish id
4130,33024,marlin device key
4231,20,secure clock
4332,16,slacker time
4433,64,marlin time
4534,16384,EKB 0
4635,16384,EKB 1
4736,1024,EMPR 0
4837,1024,EMPR 1
4938,1024,EMPR 2
5039,1024,EMPR 3
5140,1024,EMPR 4
5241,1024,EMPR 5
5342,1024,EMPR 6
5443,1024,EMPR 7
5544,1024,EMPR 8
5645,1024,EMPR 9
5746,1024,EMPR 10
5847,1024,EMPR 11
5948,1024,EMPR 12
6049,1024,EMPR 13
6150,1024,EMPR 14
6251,1024,EMPR 15
6352,1024,EMPR 16
6453,1024,EMPR 17
6554,1024,EMPR 18
6655,1024,EMPR 19
6756,1024,EMPR 20
6857,1024,EMPR 21
6958,1024,EMPR 22
7059,1024,EMPR 23
7160,1024,EMPR 24
7261,1024,EMPR 25
7362,1024,EMPR 26
7463,1024,EMPR 27
7564,1024,EMPR 28
7665,1024,EMPR 29
7766,1024,EMPR 30
7867,1024,EMPR 31
7968,4,color variation
8069,4,speaker ship info
8170,8,middleware parameter
8271,4,quick shutdown flag
8372,262144,boot image
8473,262144,hold image
8574,262144,low battery image
8675,262144,update image
8776,262144,update error image
8887,262144,precharge image
8988,262144,dead battery image
diff --git a/utils/nwztools/database/nvp/nodes-nwz-a20.txt b/utils/nwztools/database/nvp/nodes-nwz-a20.txt
new file mode 100644
index 0000000000..2beb185b6c
--- /dev/null
+++ b/utils/nwztools/database/nvp/nodes-nwz-a20.txt
@@ -0,0 +1,89 @@
11,4,system information
22,32,u-boot password
33,4,firmware update flag
44,4,beep ok flag
55,4,hold mode
66,16,rtc alarm
77,64,model id
88,5,product code
99,16,serial number
1010,8,update file name
1111,64,key and signature
1212,32,ship information
1313,4,test mode flag
1414,4,getty mode flag
1515,16,fm parameter
1616,64,sound driver parameter
1717,64,noise cancel driver parameter
1818,512,bluetooth pskey
1977,4,wifi protected setup
2085,4,battery calibration
2119,2048,bluetooth parameter
2220,512,btmw factory pair info
2321,512,btmw factory scdb
2422,4,btmw log mode flag
2578,4,application debug mode flag
2679,4,browser log mode flag
2780,4,time out to sleep
2881,4,europe vol regulation flag
2982,4,function information
3083,4,service id
3184,4,marlin key
3286,4,MSC only mode flag
3389,4,SD Card export flag
3423,704,aad/empr key
3524,160,aad icv
3625,520,empr icv
3726,4,key mode (debug/release)
3827,64,random data
3928,8224,slacker id file
4029,64,starfish id
4130,33024,marlin device key
4231,20,secure clock
4332,16,slacker time
4433,64,marlin time
4534,16384,EKB 0
4635,16384,EKB 1
4736,1024,EMPR 0
4837,1024,EMPR 1
4938,1024,EMPR 2
5039,1024,EMPR 3
5140,1024,EMPR 4
5241,1024,EMPR 5
5342,1024,EMPR 6
5443,1024,EMPR 7
5544,1024,EMPR 8
5645,1024,EMPR 9
5746,1024,EMPR 10
5847,1024,EMPR 11
5948,1024,EMPR 12
6049,1024,EMPR 13
6150,1024,EMPR 14
6251,1024,EMPR 15
6352,1024,EMPR 16
6453,1024,EMPR 17
6554,1024,EMPR 18
6655,1024,EMPR 19
6756,1024,EMPR 20
6857,1024,EMPR 21
6958,1024,EMPR 22
7059,1024,EMPR 23
7160,1024,EMPR 24
7261,1024,EMPR 25
7362,1024,EMPR 26
7463,1024,EMPR 27
7564,1024,EMPR 28
7665,1024,EMPR 29
7766,1024,EMPR 30
7867,1024,EMPR 31
7968,4,color variation
8069,4,speaker ship info
8170,8,middleware parameter
8271,4,quick shutdown flag
8372,262144,boot image
8473,262144,hold image
8574,262144,low battery image
8675,262144,update image
8776,262144,update error image
8887,262144,precharge image
8988,262144,dead battery image
diff --git a/utils/nwztools/database/nvp/nodes-nwz-a820.txt b/utils/nwztools/database/nvp/nodes-nwz-a820.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/utils/nwztools/database/nvp/nodes-nwz-a820.txt
diff --git a/utils/nwztools/database/nvp/nodes-nwz-a860.txt b/utils/nwztools/database/nvp/nodes-nwz-a860.txt
new file mode 100644
index 0000000000..4a998d839a
--- /dev/null
+++ b/utils/nwztools/database/nvp/nodes-nwz-a860.txt
@@ -0,0 +1,89 @@
124,4,system information
223,32,u-boot password
39,4,firmware update flag
410,4,beep ok flag
534,16,rtc alarm
680,4,hold mode
716,64,model id
84,16,serial number
911,32,ship information
1068,4,color variation
1126,5,product code
1229,8,update file name
1332,64,key and signature
1417,4,test mode flag
1518,4,getty mode flag
1670,4,disable iptable flag
1730,64,sound driver parameter
1831,64,noise cancel driver parameter
1977,6,wifi mac address
2075,4,wifi protected setup
2182,16,fm parameter
2283,4,speaker ship info
2384,4,mass storage class mode
2425,4,exception monitor mode
2527,4,battery calibration
2686,512,bluetooth pskey
275,4096,application parameter
287,20,secure clock
2912,160,aad icv
3013,520,empr key
3176,16,slacker time
3221,4,key mode (debug/release)
3371,64,marlin time
3472,16384,marlin crl
3589,512,btmw factory pair info
3688,512,btmw factory scdb
3787,4,btmw log mode flag
3885,4,europe vol regulation flag
398,8,middleware parameter
4022,4,quick shutdown flag
4169,4,time out to sleep
4278,4,application debug mode flag
4379,4,browser log mode flag
443,704,aad key
4528,64,wmt key
4681,8224,slacker id file
4773,33024,marlin device key
4833,64,starfish id
4935,2048,bluetooth address
5014,16384,EKB 0
5115,16384,EKB 1
5274,24576,marlin user key
5336,1024,EMPR 0
5437,1024,EMPR 1
5538,1024,EMPR 2
5639,1024,EMPR 3
5740,1024,EMPR 4
5841,1024,EMPR 5
5942,1024,EMPR 6
6043,1024,EMPR 7
6144,1024,EMPR 8
6245,1024,EMPR 9
6346,1024,EMPR 10
6447,1024,EMPR 11
6548,1024,EMPR 12
6649,1024,EMPR 13
6750,1024,EMPR 14
6851,1024,EMPR 15
6952,1024,EMPR 16
7053,1024,EMPR 17
7154,1024,EMPR 18
7255,1024,EMPR 19
7356,1024,EMPR 20
7457,1024,EMPR 21
7558,1024,EMPR 22
7659,1024,EMPR 23
7760,1024,EMPR 24
7861,1024,EMPR 25
7962,1024,EMPR 26
8063,1024,EMPR 27
8164,1024,EMPR 28
8265,1024,EMPR 29
8366,1024,EMPR 30
8467,1024,EMPR 31
851,262144,boot image
862,262144,hold image
8720,262144,low battery image
8819,262144,update image
896,262144,update error image
diff --git a/utils/nwztools/database/nvp/nodes-nwz-e450.txt b/utils/nwztools/database/nvp/nodes-nwz-e450.txt
new file mode 100644
index 0000000000..438488acbc
--- /dev/null
+++ b/utils/nwztools/database/nvp/nodes-nwz-e450.txt
@@ -0,0 +1,78 @@
124,4,system information
223,32,u-boot password
39,4,firmware update flag
410,4,beep ok flag
534,16,rtc alarm
680,4,hold mode
716,64,model id
84,16,serial number
911,32,ship information
1068,4,color variation
1126,5,product code
1229,8,update file name
1332,64,key and signature
1417,4,test mode flag
1518,4,getty mode flag
1670,4,disable iptable flag
1730,64,sound driver parameter
1831,64,noise cancel driver parameter
1977,6,wifi mac address
2075,4,wifi protected setup
2182,16,fm parameter
2283,4,speaker ship info
2384,4,mass storage class mode
2425,4,exception monitor mode
255,4096,application parameter
2635,2048,bluetooth parameter
278,8,middleware parameter
2822,4,quick shutdown flag
2969,4,time out to sleep
3078,4,application debug mode flag
3179,4,browser log mode flag
327,20,secure clock
333,704,aad key
3412,160,aad icv
3513,520,empr key
3628,64,random data
3776,16,slacker time
3821,4,key mode (debug/release)
3981,8224,slacker id file
4014,16384,EKB 0
4115,16384,EKB 1
4236,1024,EMPR 0
4337,1024,EMPR 1
4438,1024,EMPR 2
4539,1024,EMPR 3
4640,1024,EMPR 4
4741,1024,EMPR 5
4842,1024,EMPR 6
4943,1024,EMPR 7
5044,1024,EMPR 8
5145,1024,EMPR 9
5246,1024,EMPR 10
5347,1024,EMPR 11
5448,1024,EMPR 12
5549,1024,EMPR 13
5650,1024,EMPR 14
5751,1024,EMPR 15
5852,1024,EMPR 16
5953,1024,EMPR 17
6054,1024,EMPR 18
6155,1024,EMPR 19
6256,1024,EMPR 20
6357,1024,EMPR 21
6458,1024,EMPR 22
6559,1024,EMPR 23
6660,1024,EMPR 24
6761,1024,EMPR 25
6862,1024,EMPR 26
6963,1024,EMPR 27
7064,1024,EMPR 28
7165,1024,EMPR 29
7266,1024,EMPR 30
7367,1024,EMPR 31
741,262144,boot image
752,262144,hold image
7620,262144,low battery image
7719,262144,update image
786,262144,update error image
diff --git a/utils/nwztools/database/nvp/nodes-nwz-e460.txt b/utils/nwztools/database/nvp/nodes-nwz-e460.txt
new file mode 100644
index 0000000000..4a998d839a
--- /dev/null
+++ b/utils/nwztools/database/nvp/nodes-nwz-e460.txt
@@ -0,0 +1,89 @@
124,4,system information
223,32,u-boot password
39,4,firmware update flag
410,4,beep ok flag
534,16,rtc alarm
680,4,hold mode
716,64,model id
84,16,serial number
911,32,ship information
1068,4,color variation
1126,5,product code
1229,8,update file name
1332,64,key and signature
1417,4,test mode flag
1518,4,getty mode flag
1670,4,disable iptable flag
1730,64,sound driver parameter
1831,64,noise cancel driver parameter
1977,6,wifi mac address
2075,4,wifi protected setup
2182,16,fm parameter
2283,4,speaker ship info
2384,4,mass storage class mode
2425,4,exception monitor mode
2527,4,battery calibration
2686,512,bluetooth pskey
275,4096,application parameter
287,20,secure clock
2912,160,aad icv
3013,520,empr key
3176,16,slacker time
3221,4,key mode (debug/release)
3371,64,marlin time
3472,16384,marlin crl
3589,512,btmw factory pair info
3688,512,btmw factory scdb
3787,4,btmw log mode flag
3885,4,europe vol regulation flag
398,8,middleware parameter
4022,4,quick shutdown flag
4169,4,time out to sleep
4278,4,application debug mode flag
4379,4,browser log mode flag
443,704,aad key
4528,64,wmt key
4681,8224,slacker id file
4773,33024,marlin device key
4833,64,starfish id
4935,2048,bluetooth address
5014,16384,EKB 0
5115,16384,EKB 1
5274,24576,marlin user key
5336,1024,EMPR 0
5437,1024,EMPR 1
5538,1024,EMPR 2
5639,1024,EMPR 3
5740,1024,EMPR 4
5841,1024,EMPR 5
5942,1024,EMPR 6
6043,1024,EMPR 7
6144,1024,EMPR 8
6245,1024,EMPR 9
6346,1024,EMPR 10
6447,1024,EMPR 11
6548,1024,EMPR 12
6649,1024,EMPR 13
6750,1024,EMPR 14
6851,1024,EMPR 15
6952,1024,EMPR 16
7053,1024,EMPR 17
7154,1024,EMPR 18
7255,1024,EMPR 19
7356,1024,EMPR 20
7457,1024,EMPR 21
7558,1024,EMPR 22
7659,1024,EMPR 23
7760,1024,EMPR 24
7861,1024,EMPR 25
7962,1024,EMPR 26
8063,1024,EMPR 27
8164,1024,EMPR 28
8265,1024,EMPR 29
8366,1024,EMPR 30
8467,1024,EMPR 31
851,262144,boot image
862,262144,hold image
8720,262144,low battery image
8819,262144,update image
896,262144,update error image
diff --git a/utils/nwztools/database/nvp/nodes-nwz-e580.txt b/utils/nwztools/database/nvp/nodes-nwz-e580.txt
new file mode 100644
index 0000000000..021cc9178d
--- /dev/null
+++ b/utils/nwztools/database/nvp/nodes-nwz-e580.txt
@@ -0,0 +1,88 @@
11,4,system information
22,32,u-boot password
33,4,firmware update flag
44,4,beep ok flag
55,4,hold mode
66,16,rtc alarm
77,64,model id
88,5,product code
99,16,serial number
1010,8,update file name
1111,64,key and signature
1212,32,ship information
1313,4,test mode flag
1414,4,getty mode flag
1515,16,fm parameter
1616,64,sound driver parameter
1717,64,noise cancel driver parameter
1818,512,bluetooth pskey
1977,4,wifi protected setup
2085,4,battery calibration
2119,2048,bluetooth parameter
2220,512,btmw factory pair info
2321,512,btmw factory scdb
2422,4,btmw log mode flag
2578,4,application debug mode flag
2679,4,browser log mode flag
2780,4,time out to sleep
2881,4,europe vol regulation flag
2982,4,function information
3083,4,service id
3184,4,marlin key
3286,4,MSC only mode flag
3323,704,aad/empr key
3424,160,aad icv
3525,520,empr icv
3626,4,key mode (debug/release)
3727,64,random data
3828,8224,slacker id file
3929,64,starfish id
4030,33024,marlin device key
4131,20,secure clock
4232,16,slacker time
4333,64,marlin time
4434,16384,EKB 0
4535,16384,EKB 1
4636,1024,EMPR 0
4737,1024,EMPR 1
4838,1024,EMPR 2
4939,1024,EMPR 3
5040,1024,EMPR 4
5141,1024,EMPR 5
5242,1024,EMPR 6
5343,1024,EMPR 7
5444,1024,EMPR 8
5545,1024,EMPR 9
5646,1024,EMPR 10
5747,1024,EMPR 11
5848,1024,EMPR 12
5949,1024,EMPR 13
6050,1024,EMPR 14
6151,1024,EMPR 15
6252,1024,EMPR 16
6353,1024,EMPR 17
6454,1024,EMPR 18
6555,1024,EMPR 19
6656,1024,EMPR 20
6757,1024,EMPR 21
6858,1024,EMPR 22
6959,1024,EMPR 23
7060,1024,EMPR 24
7161,1024,EMPR 25
7262,1024,EMPR 26
7363,1024,EMPR 27
7464,1024,EMPR 28
7565,1024,EMPR 29
7666,1024,EMPR 30
7767,1024,EMPR 31
7868,4,color variation
7969,4,speaker ship info
8070,8,middleware parameter
8171,4,quick shutdown flag
8272,262144,boot image
8373,262144,hold image
8474,262144,low battery image
8575,262144,update image
8676,262144,update error image
8787,262144,precharge image
8888,262144,dead battery image
diff --git a/utils/nwztools/database/nvp/nodes-nwz-zx100.txt b/utils/nwztools/database/nvp/nodes-nwz-zx100.txt
new file mode 100644
index 0000000000..2beb185b6c
--- /dev/null
+++ b/utils/nwztools/database/nvp/nodes-nwz-zx100.txt
@@ -0,0 +1,89 @@
11,4,system information
22,32,u-boot password
33,4,firmware update flag
44,4,beep ok flag
55,4,hold mode
66,16,rtc alarm
77,64,model id
88,5,product code
99,16,serial number
1010,8,update file name
1111,64,key and signature
1212,32,ship information
1313,4,test mode flag
1414,4,getty mode flag
1515,16,fm parameter
1616,64,sound driver parameter
1717,64,noise cancel driver parameter
1818,512,bluetooth pskey
1977,4,wifi protected setup
2085,4,battery calibration
2119,2048,bluetooth parameter
2220,512,btmw factory pair info
2321,512,btmw factory scdb
2422,4,btmw log mode flag
2578,4,application debug mode flag
2679,4,browser log mode flag
2780,4,time out to sleep
2881,4,europe vol regulation flag
2982,4,function information
3083,4,service id
3184,4,marlin key
3286,4,MSC only mode flag
3389,4,SD Card export flag
3423,704,aad/empr key
3524,160,aad icv
3625,520,empr icv
3726,4,key mode (debug/release)
3827,64,random data
3928,8224,slacker id file
4029,64,starfish id
4130,33024,marlin device key
4231,20,secure clock
4332,16,slacker time
4433,64,marlin time
4534,16384,EKB 0
4635,16384,EKB 1
4736,1024,EMPR 0
4837,1024,EMPR 1
4938,1024,EMPR 2
5039,1024,EMPR 3
5140,1024,EMPR 4
5241,1024,EMPR 5
5342,1024,EMPR 6
5443,1024,EMPR 7
5544,1024,EMPR 8
5645,1024,EMPR 9
5746,1024,EMPR 10
5847,1024,EMPR 11
5948,1024,EMPR 12
6049,1024,EMPR 13
6150,1024,EMPR 14
6251,1024,EMPR 15
6352,1024,EMPR 16
6453,1024,EMPR 17
6554,1024,EMPR 18
6655,1024,EMPR 19
6756,1024,EMPR 20
6857,1024,EMPR 21
6958,1024,EMPR 22
7059,1024,EMPR 23
7160,1024,EMPR 24
7261,1024,EMPR 25
7362,1024,EMPR 26
7463,1024,EMPR 27
7564,1024,EMPR 28
7665,1024,EMPR 29
7766,1024,EMPR 30
7867,1024,EMPR 31
7968,4,color variation
8069,4,speaker ship info
8170,8,middleware parameter
8271,4,quick shutdown flag
8372,262144,boot image
8473,262144,hold image
8574,262144,low battery image
8675,262144,update image
8776,262144,update error image
8887,262144,precharge image
8988,262144,dead battery image
diff --git a/utils/nwztools/database/nvp/nvptool.cpp b/utils/nwztools/database/nvp/nvptool.cpp
new file mode 100644
index 0000000000..1371e93b87
--- /dev/null
+++ b/utils/nwztools/database/nvp/nvptool.cpp
@@ -0,0 +1,754 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2016 Amaury Pouly
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include <cstdio>
23#include <stdint.h>
24#include <cstdlib>
25#include <cstring>
26#include <getopt.h>
27#include <cstdarg>
28#include <string>
29#include <fstream>
30#include <elf.h>
31
32bool g_verbose = false;
33bool g_unsafe = false;
34
35uint8_t *read_file(const std::string& path, size_t& size)
36{
37 std::ifstream fin(path.c_str(), std::ios::binary);
38 if(!fin)
39 {
40 printf("Error: cannot open '%s'\n", path.c_str());
41 return 0;
42 }
43 fin.seekg(0, std::ios::end);
44 size = fin.tellg();
45 fin.seekg(0, std::ios::beg);
46 uint8_t *buf = new uint8_t[size];
47 fin.read((char *)buf, size);
48 return buf;
49}
50
51bool write_file(const std::string& path, uint8_t *buf, size_t size)
52{
53 std::ofstream fout(path.c_str(), std::ios::binary);
54 if(!fout)
55 {
56 printf("Error: cannot open '%s'\n", path.c_str());
57 return false;
58 }
59 fout.write((char *)buf, size);
60 fout.close();
61 return true;
62}
63
64/* ELF code */
65uint8_t *g_elf_buf;
66size_t g_elf_size;
67Elf32_Shdr *g_elf_symtab;
68Elf32_Shdr *g_elf_symtab_strtab;
69Elf32_Shdr *g_elf_shstrtab;
70
71Elf32_Ehdr *elf_ehdr()
72{
73 return (Elf32_Ehdr *)g_elf_buf;
74}
75
76#define NTH_SHDR_OFF(n) \
77 (elf_ehdr()->e_shoff + elf_ehdr()->e_shentsize * (n))
78
79Elf32_Shdr *elf_shdr(size_t index)
80{
81 if(index >= elf_ehdr()->e_shnum)
82 {
83 printf("Warning: section index is out of bounds\n");
84 return nullptr;
85 }
86 return (Elf32_Shdr *)(g_elf_buf + NTH_SHDR_OFF(index));
87}
88
89size_t elf_shnum()
90{
91 return elf_ehdr()->e_shnum;
92}
93
94const char *elf_get_str(Elf32_Shdr *strtab, Elf32_Word index)
95{
96 /* sanity checks */
97 if(strtab->sh_type != SHT_STRTAB)
98 {
99 printf("Warning: string access to a non-string-table section\n");
100 return nullptr;
101 }
102 if(strtab->sh_offset + strtab->sh_size > g_elf_size)
103 {
104 printf("Warning: string table section does not fit in the file\n");
105 return nullptr;
106 }
107 if(index >= strtab->sh_size)
108 {
109 printf("Warning: string access to string table is out of bounds\n");
110 return nullptr;
111 }
112 char *buf = (char *)(g_elf_buf + strtab->sh_offset);
113 if(buf[strtab->sh_size - 1] != 0)
114 {
115 printf("Warning: string table is not zero terminated\n");
116 return nullptr;
117 }
118 return buf + index;
119}
120
121const char *elf_get_section_name(size_t index)
122{
123 Elf32_Shdr *shdr = elf_shdr(index);
124 return shdr ? elf_get_str(g_elf_shstrtab, shdr->sh_name) : nullptr;
125}
126
127const char *elf_get_symbol_name(Elf32_Sym *sym)
128{
129 if(ELF32_ST_TYPE(sym->st_info) == STT_SECTION)
130 return elf_get_section_name(sym->st_shndx);
131 else
132 return elf_get_str(g_elf_symtab_strtab, sym->st_name);
133}
134
135Elf32_Sym *elf_get_symbol_by_name(const char *name)
136{
137 Elf32_Sym *sym = (Elf32_Sym *)(g_elf_buf + g_elf_symtab->sh_offset);
138 size_t nr_syms = g_elf_symtab->sh_size / sizeof(Elf32_Sym);
139 for(size_t i = 0; i < nr_syms; i++)
140 {
141 const char *s = elf_get_symbol_name(&sym[i]);
142 if(s != nullptr && strcmp(name, s) == 0)
143 return &sym[i];
144 }
145 return nullptr;
146}
147
148Elf32_Sym *elf_get_symbol_by_address(size_t shndx, Elf32_Word address)
149{
150 Elf32_Sym *sym = (Elf32_Sym *)(g_elf_buf + g_elf_symtab->sh_offset);
151 size_t nr_syms = g_elf_symtab->sh_size / sizeof(Elf32_Sym);
152 for(size_t i = 0; i < nr_syms; i++)
153 {
154 if(sym[i].st_shndx == shndx && sym[i].st_value == address)
155 return &sym[i];
156 }
157 return nullptr;
158}
159
160Elf32_Sym *elf_get_symbol_by_index(size_t index)
161{
162 Elf32_Sym *sym = (Elf32_Sym *)(g_elf_buf + g_elf_symtab->sh_offset);
163 size_t nr_syms = g_elf_symtab->sh_size / sizeof(Elf32_Sym);
164 if(index >= nr_syms)
165 return nullptr;
166 return &sym[index];
167}
168
169void *elf_get_section_ptr(size_t shndx, Elf32_Word address, size_t size)
170{
171 Elf32_Shdr *shdr = elf_shdr(shndx);
172 if(shdr == nullptr)
173 return nullptr;
174 if(address + size > shdr->sh_size)
175 return nullptr;
176 if(shdr->sh_offset + shdr->sh_size > g_elf_size)
177 return nullptr;
178 return g_elf_buf + shdr->sh_offset + address;
179}
180
181/* make sure the string has a final zero in the section, optionally check characters
182 * are printable */
183const char *elf_get_string_ptr_safe(size_t shndx, Elf32_Word offset, bool want_print = true)
184{
185 Elf32_Shdr *shdr = elf_shdr(shndx);
186 if(shdr == nullptr)
187 return nullptr;
188 /* address must be in the section */
189 if(offset >= shdr->sh_size)
190 return nullptr;
191 /* determine maximum size */
192 size_t max_sz = shdr->sh_size - offset;
193 const char *ptr = (const char *)(g_elf_buf + shdr->sh_offset + offset);
194 for(size_t i = 0; i < max_sz; i++)
195 {
196 if(ptr[i] == 0) /* found final 0, everything is fine */
197 return ptr;
198 if(want_print && !isprint(ptr[i]))
199 return nullptr;
200 }
201 return nullptr;
202}
203
204size_t elf_find_reloc_section(size_t shndx)
205{
206 /* find the relocation section */
207 for(size_t i = 0; i < elf_ehdr()->e_shnum; i++)
208 {
209 Elf32_Shdr *shdr = elf_shdr(i);
210 if(shdr->sh_type != SHT_REL && shdr->sh_type != SHT_RELA)
211 continue;
212 if(shdr->sh_info != shndx)
213 continue;
214 return i;
215 }
216 return 0;
217}
218
219void *elf_get_symbol_ptr(Elf32_Sym *sym, size_t size)
220{
221 /* NOTE: also works for STT_SECTION since offset will be 0 */
222 return elf_get_section_ptr(sym->st_shndx, sym->st_value, size);
223}
224
225/* take the position of a 32-bit address in the section and apply relocation if
226 * any */
227void *elf_reloc_addr32(size_t shndx, Elf32_Word offset)
228{
229 /* read value */
230 uint32_t *val = (uint32_t *)elf_get_section_ptr(shndx, offset, 4);
231 if(val == nullptr)
232 return 0; /* invalid */
233 /* find reloc section if any */
234 size_t relshndx = elf_find_reloc_section(shndx);
235 if(relshndx == 0)
236 return g_elf_buf + *val; /* no relocation applies */
237 Elf32_Shdr *shdr = elf_shdr(relshndx);
238 /* find relocation that applies */
239 if(shdr->sh_type == SHT_RELA)
240 {
241 printf("Warning: unsupported RELA relocation type\n");
242 return 0;
243 }
244 Elf32_Rel *rel = (Elf32_Rel *)elf_get_section_ptr(relshndx, 0, shdr->sh_size);
245 if(rel == nullptr)
246 {
247 printf("Warning: invalid relocation section\n");
248 return 0;
249 }
250 size_t sym_count = shdr->sh_size / sizeof(Elf32_Rel);
251 for(size_t i = 0; i < sym_count; i++)
252 {
253 /* for relocatable files, r_offset is the offset in the section */
254 if(rel[i].r_offset != offset)
255 continue;
256 /* find symbol, ignore shdr->sh_link and assume it is g_elf_symtab
257 * since the file should have only one symbol table anyway */
258 Elf32_Sym *sym = elf_get_symbol_by_index(ELF32_R_SYM(rel[i].r_info));
259 /* found it! */
260 if(g_verbose)
261 {
262 printf("[section %zu (%s) offset %#x reloc val %#x type %d sym %d (%s)]\n",
263 shndx, elf_get_section_name(shndx), offset, *val,
264 ELF32_R_TYPE(rel[i].r_info), ELF32_R_SYM(rel[i].r_info),
265 sym ? elf_get_symbol_name(sym) : "<undef>");
266 }
267 /* apply reloc */
268 if(ELF32_R_TYPE(rel[i].r_info) == R_ARM_ABS32)
269 {
270 if(sym == nullptr)
271 {
272 printf("Warning: R_ARM_ABS32 reloc with invalid symbol reference\n");
273 return 0;
274 }
275 return *val + (uint8_t *)elf_get_symbol_ptr(sym, 0);
276 }
277 else
278 {
279 printf("Warning: unsupported relocation type %d\n", ELF32_R_TYPE(rel[i].r_info));
280 return 0;
281 }
282 }
283 /* no reloc applies */
284 if(g_verbose)
285 {
286 printf("[section %zu (%s) offset %#x no reloc found]\n", shndx,
287 elf_get_section_name(shndx), offset);
288 }
289 return g_elf_buf + *val; /* no relocation applies */
290}
291
292size_t elf_map_virt_addr(uint32_t address, Elf32_Word& out_off)
293{
294 /* for relocatable file, this is trivial */
295 for(size_t i = 0; i < elf_ehdr()->e_shnum; i++)
296 {
297 Elf32_Shdr *shdr = elf_shdr(i);
298 if(shdr->sh_offset <= address && address < shdr->sh_offset + shdr->sh_size)
299 {
300 out_off = address - shdr->sh_offset;
301 if(g_verbose)
302 {
303 printf("[map %#x to section %zi (%s) at %#x]\n", address, i,
304 elf_get_section_name(i), out_off);
305 }
306 return i;
307 }
308 }
309 return 0; /* section 0 is always invalid */
310}
311
312size_t elf_map_ptr(void *ptr, Elf32_Word& out_off)
313{
314 uint32_t addr = (uint32_t)((uint8_t *)ptr - g_elf_buf);
315 return elf_map_virt_addr(addr, out_off);
316}
317
318/* same as elf_reloc_addr32 but find section automatically from pointer */
319void *elf_reloc_addr32_ptr(uint32_t *val)
320{
321 Elf32_Word off;
322 size_t sec = elf_map_ptr((void *)val, off);
323 /* if it does not belong to any section, don't do anything */
324 if(sec == 0)
325 {
326 printf("Warning: reloc addr pointer not in any section\n");
327 return g_elf_buf + *val;
328 }
329 return elf_reloc_addr32(sec, off);
330}
331
332Elf32_Sym *elf_get_symbol_by_ptr(void *ptr)
333{
334 Elf32_Word off;
335 size_t sec = elf_map_ptr(ptr, off);
336 return sec ? elf_get_symbol_by_address(sec, off) : nullptr;
337}
338
339/* check if a string is safe */
340bool elf_is_str_ptr_safe(const char *str)
341{
342 Elf32_Word name_off;
343 /* find the section it belongs to */
344 size_t name_shndx = elf_map_ptr((void *)str, name_off);
345 if(name_shndx == 0)
346 return false;
347 /* check the string fit in the section */
348 return elf_get_string_ptr_safe(name_shndx, name_off) != nullptr;
349}
350
351bool elf_is_ptr_safe(void *ptr, size_t sz)
352{
353 Elf32_Word ptr_off;
354 /* find the section it belongs to */
355 size_t ptr_shndx = elf_map_ptr((void *)ptr, ptr_off);
356 if(ptr_shndx == 0)
357 return false;
358 /* check the string fit in the section */
359 return elf_get_section_ptr(ptr_shndx, ptr_off, sz) != nullptr;
360}
361
362bool elf_init()
363{
364 if(g_elf_size < sizeof(Elf32_Ehdr))
365 {
366 printf("Invalid ELF file: too small\n");
367 return false;
368 }
369 Elf32_Ehdr *ehdr = elf_ehdr();
370 if(ehdr->e_ident[EI_MAG0] != ELFMAG0 ||
371 ehdr->e_ident[EI_MAG1] != ELFMAG1 ||
372 ehdr->e_ident[EI_MAG2] != ELFMAG2 ||
373 ehdr->e_ident[EI_MAG3] != ELFMAG3)
374 {
375 printf("Invalid ELF file: invalid ident\n");
376 return false;
377 }
378 /* we only support relocatable files */
379 if(ehdr->e_type != ET_REL)
380 {
381 printf("Unsupported ELF file: this is not a relocatable file\n");
382 return false;
383 }
384 if(ehdr->e_ident[EI_CLASS] != ELFCLASS32 || ehdr->e_machine != EM_ARM)
385 {
386 printf("Unsupported ELF file: this is not a 32-bit ARM ELF file\n");
387 return false;
388 }
389 /* go through sections */
390 if(ehdr->e_shoff == 0)
391 {
392 printf("Invalid ELF file: no sections\n");
393 return false;
394 }
395 if(ehdr->e_shentsize < sizeof(Elf32_Shdr))
396 {
397 printf("Invalid ELF file: section entry size too small\n");
398 return false;
399 }
400 if(NTH_SHDR_OFF(ehdr->e_shnum) > g_elf_size)
401 {
402 printf("Invalid ELF file: sections header does not fit in the file\n");
403 return false;
404 }
405 for(size_t i = 0; i < ehdr->e_shnum; i++)
406 {
407 Elf32_Shdr *shdr = (Elf32_Shdr *)(g_elf_buf + NTH_SHDR_OFF(i));
408 if(shdr->sh_type == SHT_SYMTAB)
409 g_elf_symtab = shdr;
410 }
411 /* handle symbol table */
412 if(g_elf_symtab)
413 {
414 if(g_elf_symtab->sh_offset + g_elf_symtab->sh_size > g_elf_size)
415 {
416 printf("Invalid ELF file: symtab does not file in the file\n");
417 return false;
418 }
419 g_elf_symtab_strtab = elf_shdr(g_elf_symtab->sh_link);
420 if(g_elf_symtab_strtab == nullptr)
421 {
422 printf("Invalid ELF file: symtab's strtab is not valid\n");
423 }
424 if(g_elf_symtab_strtab->sh_type != SHT_STRTAB)
425 {
426 printf("Invalid ELF file: symtab's strtab is not a string table\n");
427 return false;
428 }
429 }
430 /* handle section string table */
431 if(ehdr->e_shstrndx != SHN_UNDEF)
432 {
433 g_elf_shstrtab = elf_shdr(ehdr->e_shstrndx);
434 if(g_elf_shstrtab == nullptr)
435 {
436 printf("Invalid ELF file: section string table is invalid\n");
437 return false;
438 }
439 }
440
441 return true;
442}
443
444/* main code */
445
446void usage()
447{
448 printf("usage: nvptool [options] inputs...\n");
449 printf("options:\n");
450 printf(" -h/--help Display help\n");
451 printf(" -x/--extract Extract nvp map from icx_nvp_emmc.ko\n");
452 printf(" -o/--output Set output file\n");
453 printf(" -v/--verbose Enable debug output\n");
454 printf(" -u/--unsafe Perform potentially unsafe operations\n");
455 exit(1);
456}
457
458struct zone_info_v1_t
459{
460 uint32_t node;
461 uint32_t start;
462 uint32_t count;
463 uint32_t size;
464 uint32_t semaphore[4]; /* a 16-byte structure, useless for us */
465 uint32_t name; /* pointer to string */
466} __attribute__((packed));
467
468struct zone_info_v2_t
469{
470 uint32_t node;
471 uint32_t start;
472 uint32_t count;
473 uint32_t size;
474 uint32_t semaphore[3]; /* a 12-byte structure, useless for us */
475 uint32_t name; /* pointer to string */
476} __attribute__((packed));
477
478struct area_info_v1_t
479{
480 uint32_t type; /* 1 = large, 2 = small */
481 uint32_t zoneinfo; /* pointer to zone_info_t[] */
482 uint32_t zonecount;
483 uint32_t semaphore[4]; /* a 16-byte structure, useless for us */
484 uint32_t name; /* pointer to string */
485} __attribute__((packed));
486
487struct area_info_v2_t
488{
489 uint32_t type; /* 1 = large, 2 = small */
490 uint32_t zoneinfo; /* pointer to zone_info_t[] */
491 uint32_t zonecount;
492 uint32_t semaphore[3]; /* a 16-byte structure, useless for us */
493 uint32_t name; /* pointer to string */
494} __attribute__((packed));
495
496int guess_version(void *area_info_ptr)
497{
498 /* the "semaphore" part is always filled with zeroes, so simply check if there
499 * are 3 or 4 of them */
500 area_info_v1_t *ai_v1 = (area_info_v1_t *)area_info_ptr;
501 if(ai_v1->semaphore[3] == 0)
502 return 1; /* v1: semaphore has 4 fields */
503 else
504 return 2; /* v2: semaphore has 3 fields */
505}
506
507int do_extract(const char *output, int argc, char **argv)
508{
509 if(argc != 1)
510 {
511 printf("You need to specify exactly one input file to extract from.\n");
512 return 3;
513 }
514 FILE *fout = NULL;
515 if(output)
516 {
517 fout = fopen(output, "w");
518 if(fout == NULL)
519 {
520 printf("Cannot open output file '%s'\n", output);
521 return 4;
522 }
523 }
524 /* read elf file */
525 g_elf_buf = read_file(argv[0], g_elf_size);
526 if(g_elf_buf == nullptr)
527 {
528 printf("Cannot open input file '%s'\n", argv[0]);
529 return 1;
530 }
531 if(!elf_init())
532 {
533 printf("This is not a valid ELF file\n");
534 return 1;
535 }
536 if(g_elf_symtab == nullptr)
537 {
538 printf("This ELF file does not have a symbol table\n");
539 return 1;
540 }
541 /* look for symbol 'AreaInfo' */
542 Elf32_Sym *sym_AreaInfo = elf_get_symbol_by_name("AreaInfo");
543 if(sym_AreaInfo == nullptr)
544 {
545 printf("Cannot find symbol 'AreaInfo'\n");
546 return 1;
547 }
548 printf("AreaInfo:\n");
549 if(g_verbose)
550 {
551 printf("[%u bytes at address %#x in section %u (%s)]\n",
552 (unsigned)sym_AreaInfo->st_size, (unsigned)sym_AreaInfo->st_value,
553 (unsigned)sym_AreaInfo->st_shndx, elf_get_section_name(sym_AreaInfo->st_shndx));
554 }
555 /* guess version */
556 int ver = guess_version(elf_get_symbol_ptr(sym_AreaInfo, sizeof(area_info_v1_t)));
557 if(g_verbose)
558 printf("[guessed version: %d]\n", ver);
559 size_t sizeof_area_info = (ver == 1) ? sizeof(area_info_v1_t) : sizeof(area_info_v2_t);
560 size_t sizeof_zone_info = (ver == 1) ? sizeof(zone_info_v1_t) : sizeof(zone_info_v2_t);
561 /* sanity check AreaInfo */
562 size_t area_count = sym_AreaInfo->st_size / sizeof_area_info;
563 if(!g_unsafe && (sym_AreaInfo->st_size % sizeof_area_info) != 0)
564 {
565 printf("AreaInfo size (%u) is a not a multiple of area_info_t size (%zu).\n",
566 (unsigned)sym_AreaInfo->st_size, sizeof_area_info);
567 printf("Use unsafe option to override this check\n");
568 return 1;
569 }
570 area_info_v1_t *AreaInfo_v1 = (area_info_v1_t *)elf_get_symbol_ptr(sym_AreaInfo,
571 sym_AreaInfo->st_size);
572 area_info_v2_t *AreaInfo_v2 = (area_info_v2_t *)AreaInfo_v1;
573 if(AreaInfo_v1 == nullptr)
574 {
575 printf("Symbol does not point to a valid address\n");
576 return 1;
577 }
578 for(size_t i = 0; i < area_count; i++)
579 {
580 uint32_t type;
581 uint32_t *zoneinfo_ptr;
582 uint32_t zonecount;
583 uint32_t *name_ptr;
584
585 if(ver == 1)
586 {
587 type = AreaInfo_v1[i].type;
588 zoneinfo_ptr = &AreaInfo_v1[i].zoneinfo;
589 zonecount = AreaInfo_v1[i].zonecount;
590 name_ptr = &AreaInfo_v1[i].name;
591 }
592 else
593 {
594 type = AreaInfo_v2[i].type;
595 zoneinfo_ptr = &AreaInfo_v2[i].zoneinfo;
596 zonecount = AreaInfo_v2[i].zonecount;
597 name_ptr = &AreaInfo_v2[i].name;
598 }
599
600 if(g_verbose)
601 {
602 printf(" [type=%u info=%#x count=%u name=%#x]\n", type, *zoneinfo_ptr,
603 zonecount, *name_ptr);
604 }
605 /* translate name address */
606 const char *name = (const char *)elf_reloc_addr32_ptr(name_ptr);
607 if(name == nullptr || !elf_is_str_ptr_safe(name))
608 {
609 printf(" Entry name is not a string\n");
610 continue;
611 }
612 /* skip reserved entries */
613 if(*zoneinfo_ptr == 0)
614 {
615 printf(" %s\n", name);
616 continue;
617 }
618 /* relocate the zoneinfo pointer */
619 void *Zone = elf_reloc_addr32_ptr(zoneinfo_ptr);;
620 if(Zone == nullptr)
621 {
622 printf(" %s\n", name);
623 printf(" Zone info pointer is not valid\n");
624 continue;
625 }
626 /* in safe mode, make sure the zone info pointer is a symbol */
627 Elf32_Sym *zoneinfo_sym = elf_get_symbol_by_ptr((void *)Zone);
628 const char *zoneinfo_sym_name = "<no symbol>";
629 if(zoneinfo_sym)
630 zoneinfo_sym_name = elf_get_symbol_name(zoneinfo_sym);
631 printf(" %s (%s)\n", name, zoneinfo_sym_name);
632 if(!g_unsafe && !zoneinfo_sym)
633 {
634 printf(" Zone info pointer does not correspond to any symbol.\n");
635 printf(" Use unsafe option to override this check\n");
636 continue;
637 }
638 /* if we have the symbol, make sure the claimed size match */
639 if(!g_unsafe && zoneinfo_sym)
640 {
641 if(zoneinfo_sym->st_size != sizeof_zone_info * zonecount)
642 {
643 printf(" Zone info symbol size (%u) does not match expected size (%zu)\n",
644 (unsigned)zoneinfo_sym->st_size, sizeof_zone_info * zonecount);
645 printf(" Use unsafe option to override this check\n");
646 continue;
647 }
648 }
649 /* sanity check */
650 if(!elf_is_ptr_safe((void *)Zone, sizeof_zone_info * zonecount))
651 {
652 printf(" Zone info pointer is not valid\n");
653 continue;
654 }
655 /* read zone */
656 zone_info_v1_t *Zone_v1 = (zone_info_v1_t *)Zone;
657 zone_info_v2_t *Zone_v2 = (zone_info_v2_t *)Zone;
658 for(size_t j = 0; j < zonecount; j++)
659 {
660 uint32_t node, start, count, size;
661 uint32_t *name_ptr;
662
663 if(ver == 1)
664 {
665 node = Zone_v1[j].node;
666 start = Zone_v1[j].start;
667 count = Zone_v1[j].count;
668 size = Zone_v1[j].size;
669 name_ptr = &Zone_v1[j].name;
670 }
671 else
672 {
673 node = Zone_v2[j].node;
674 start = Zone_v2[j].start;
675 count = Zone_v2[j].count;
676 size = Zone_v2[j].size;
677 name_ptr = &Zone_v2[j].name;
678 }
679
680 if(g_verbose)
681 {
682 printf(" [node=%u start=%#x count=%u size=%u name=%#x]\n",
683 node, start, count, size, *name_ptr);
684 }
685 /* translate name address */
686 const char *name = (const char *)elf_reloc_addr32_ptr(name_ptr);
687 if(name == nullptr || !elf_is_str_ptr_safe(name))
688 {
689 printf(" Entry name is not a string\n");
690 continue;
691 }
692 printf(" %s: node %03u, size %u\n", name, node, size);
693 if(fout)
694 fprintf(fout, "%u,%u,%s\n", node, size, name);
695 }
696 }
697 if(fout)
698 fclose(fout);
699 /* success */
700 return 0;
701}
702
703int main(int argc, char **argv)
704{
705 const char *output = NULL;
706 bool extract = false;
707
708 if(argc <= 1)
709 usage();
710
711 while(1)
712 {
713 static struct option long_options[] =
714 {
715 {"help", no_argument, 0, 'h'},
716 {"extract", no_argument, 0, 'x'},
717 {"output", required_argument, 0, 'o'},
718 {"verbose", no_argument, 0, 'v'},
719 {"unsafe", no_argument, 0, 'u'},
720 {0, 0, 0, 0}
721 };
722
723 int c = getopt_long(argc, argv, "hxo:vu", long_options, NULL);
724 if(c == -1)
725 break;
726 switch(c)
727 {
728 case -1:
729 break;
730 case 'h':
731 usage();
732 break;
733 case 'o':
734 output = optarg;
735 break;
736 case 'x':
737 extract = true;
738 break;
739 case 'v':
740 g_verbose = true;
741 break;
742 case 'u':
743 g_unsafe = true;
744 break;
745 default:
746 abort();
747 }
748 }
749
750 if(extract)
751 return do_extract(output, argc - optind, argv + optind);
752 printf("You need to specify an operation. Run nvptool -h for help\n");
753 return 1;
754}
diff --git a/utils/nwztools/database/nvp/nw-a30.txt b/utils/nwztools/database/nvp/nw-a30.txt
new file mode 100644
index 0000000000..dd058fb15e
--- /dev/null
+++ b/utils/nwztools/database/nvp/nw-a30.txt
@@ -0,0 +1,92 @@
1dbg,000
2syi,001
3ubp,002
4fup,003
5prk,004
6hld,005
7rtc,006
8mid,007
9pcd,008
10ser,009
11ufn,010
12kas,011
13shp,012
14tst,013
15gty,014
16fmp,015
17sdp,016
18ncp,017
19psk,018
20nvr,077
21she,084
22btc,085
23ins,089
24ctr,090
25sku,091
26bpr,019
27bfp,020
28bfd,021
29bml,022
30apd,078
31blf,079
32slp,080
33vrt,081
34fni,082
35sid,083
36mso,086
37cng,023
38lyr,024
39dbv,025
40fur,026
41ums,027
42skd,028
43ups,029
44mdk,030
45fvi,031
46mac,032
47fpi,033
48tr0,034
49tr1,035
50e00,036
51e01,037
52e02,038
53e03,039
54e04,040
55e05,041
56e06,042
57e07,043
58e08,044
59e09,045
60e10,046
61e11,047
62e12,048
63e13,049
64e14,050
65e15,051
66e16,052
67e17,053
68e18,054
69e19,055
70e20,056
71e21,057
72e22,058
73e23,059
74e24,060
75e25,061
76e26,062
77e27,063
78e28,064
79e29,065
80e30,066
81e31,067
82clv,068
83sps,069
84rbt,070
85edw,071
86bti,072
87hdi,073
88lbi,074
89fui,075
90eri,076
91pci,087
92dbi,088
diff --git a/utils/nwztools/database/nvp/nw-e060.txt b/utils/nwztools/database/nvp/nw-e060.txt
new file mode 100644
index 0000000000..f3b5e8738a
--- /dev/null
+++ b/utils/nwztools/database/nvp/nw-e060.txt
@@ -0,0 +1,90 @@
1dbg,000
2bti,001
3hdi,002
4cng,003
5ser,004
6app,005
7eri,006
8dcc,007
9mdl,008
10fup,009
11bok,010
12shp,011
13dba,012
14dbv,013
15tr0,014
16tr1,015
17mid,016
18tst,017
19gty,018
20fui,019
21lbi,020
22dor,021
23edw,022
24ubp,023
25syi,024
26exm,025
27pcd,026
28btc,027
29rnd,028
30ufn,029
31sdp,030
32ncp,031
33kas,032
34sfi,033
35rtc,034
36bpr,035
37e00,036
38e01,037
39e02,038
40e03,039
41e04,040
42e05,041
43e06,042
44e07,043
45e08,044
46e09,045
47e10,046
48e11,047
49e12,048
50e13,049
51e14,050
52e15,051
53e16,052
54e17,053
55e18,054
56e19,055
57e20,056
58e21,057
59e22,058
60e23,059
61e24,060
62e25,061
63e26,062
64e27,063
65e28,064
66e29,065
67e30,066
68e31,067
69clv,068
70slp,069
71ipt,070
72mtm,071
73mcr,072
74mdk,073
75muk,074
76pts,075
77skt,076
78mac,077
79apd,078
80blf,079
81hld,080
82skd,081
83fmp,082
84sps,083
85msc,084
86vrt,085
87psk,086
88bml,087
89bfd,088
90bfp,089
diff --git a/utils/nwztools/database/nvp/nw-e080.txt b/utils/nwztools/database/nvp/nw-e080.txt
new file mode 100644
index 0000000000..95d2025905
--- /dev/null
+++ b/utils/nwztools/database/nvp/nw-e080.txt
@@ -0,0 +1,89 @@
1dbg,000
2syi,001
3ubp,002
4fup,003
5bok,004
6hld,005
7rtc,006
8mid,007
9pcd,008
10ser,009
11ufn,010
12kas,011
13shp,012
14tst,013
15gty,014
16fmp,015
17sdp,016
18ncp,017
19psk,018
20pts,077
21bpr,019
22bfp,020
23bfd,021
24bml,022
25apd,078
26blf,079
27slp,080
28vrt,081
29fni,082
30sid,083
31mlk,084
32mso,086
33cng,023
34dba,024
35dbv,025
36dor,026
37rnd,027
38skd,028
39sfi,029
40mdk,030
41dcc,031
42skt,032
43mtm,033
44tr0,034
45tr1,035
46e00,036
47e01,037
48e02,038
49e03,039
50e04,040
51e05,041
52e06,042
53e07,043
54e08,044
55e09,045
56e10,046
57e11,047
58e12,048
59e13,049
60e14,050
61e15,051
62e16,052
63e17,053
64e18,054
65e19,055
66e20,056
67e21,057
68e22,058
69e23,059
70e24,060
71e25,061
72e26,062
73e27,063
74e28,064
75e29,065
76e30,066
77e31,067
78clv,068
79sps,069
80mdl,070
81edw,071
82bti,072
83hdi,073
84lbi,074
85fui,075
86eri,076
87btc,085
88pci,087
89dbi,088
diff --git a/utils/nwztools/database/nvp/nw-s780.txt b/utils/nwztools/database/nvp/nw-s780.txt
new file mode 100644
index 0000000000..95d2025905
--- /dev/null
+++ b/utils/nwztools/database/nvp/nw-s780.txt
@@ -0,0 +1,89 @@
1dbg,000
2syi,001
3ubp,002
4fup,003
5bok,004
6hld,005
7rtc,006
8mid,007
9pcd,008
10ser,009
11ufn,010
12kas,011
13shp,012
14tst,013
15gty,014
16fmp,015
17sdp,016
18ncp,017
19psk,018
20pts,077
21bpr,019
22bfp,020
23bfd,021
24bml,022
25apd,078
26blf,079
27slp,080
28vrt,081
29fni,082
30sid,083
31mlk,084
32mso,086
33cng,023
34dba,024
35dbv,025
36dor,026
37rnd,027
38skd,028
39sfi,029
40mdk,030
41dcc,031
42skt,032
43mtm,033
44tr0,034
45tr1,035
46e00,036
47e01,037
48e02,038
49e03,039
50e04,040
51e05,041
52e06,042
53e07,043
54e08,044
55e09,045
56e10,046
57e11,047
58e12,048
59e13,049
60e14,050
61e15,051
62e16,052
63e17,053
64e18,054
65e19,055
66e20,056
67e21,057
68e22,058
69e23,059
70e24,060
71e25,061
72e26,062
73e27,063
74e28,064
75e29,065
76e30,066
77e31,067
78clv,068
79sps,069
80mdl,070
81edw,071
82bti,072
83hdi,073
84lbi,074
85fui,075
86eri,076
87btc,085
88pci,087
89dbi,088
diff --git a/utils/nwztools/database/nvp/nwz-a10.txt b/utils/nwztools/database/nvp/nwz-a10.txt
new file mode 100644
index 0000000000..e7ed5a0bd4
--- /dev/null
+++ b/utils/nwztools/database/nvp/nwz-a10.txt
@@ -0,0 +1,90 @@
1dbg,000
2syi,001
3ubp,002
4fup,003
5bok,004
6hld,005
7rtc,006
8mid,007
9pcd,008
10ser,009
11ufn,010
12kas,011
13shp,012
14tst,013
15gty,014
16fmp,015
17sdp,016
18ncp,017
19psk,018
20pts,077
21btc,085
22bpr,019
23bfp,020
24bfd,021
25bml,022
26apd,078
27blf,079
28slp,080
29vrt,081
30fni,082
31sid,083
32mlk,084
33mso,086
34sdc,089
35cng,023
36dba,024
37dbv,025
38dor,026
39rnd,027
40skd,028
41sfi,029
42mdk,030
43dcc,031
44skt,032
45mtm,033
46tr0,034
47tr1,035
48e00,036
49e01,037
50e02,038
51e03,039
52e04,040
53e05,041
54e06,042
55e07,043
56e08,044
57e09,045
58e10,046
59e11,047
60e12,048
61e13,049
62e14,050
63e15,051
64e16,052
65e17,053
66e18,054
67e19,055
68e20,056
69e21,057
70e22,058
71e23,059
72e24,060
73e25,061
74e26,062
75e27,063
76e28,064
77e29,065
78e30,066
79e31,067
80clv,068
81sps,069
82mdl,070
83edw,071
84bti,072
85hdi,073
86lbi,074
87fui,075
88eri,076
89pci,087
90dbi,088
diff --git a/utils/nwztools/database/nvp/nwz-a20.txt b/utils/nwztools/database/nvp/nwz-a20.txt
new file mode 100644
index 0000000000..e7ed5a0bd4
--- /dev/null
+++ b/utils/nwztools/database/nvp/nwz-a20.txt
@@ -0,0 +1,90 @@
1dbg,000
2syi,001
3ubp,002
4fup,003
5bok,004
6hld,005
7rtc,006
8mid,007
9pcd,008
10ser,009
11ufn,010
12kas,011
13shp,012
14tst,013
15gty,014
16fmp,015
17sdp,016
18ncp,017
19psk,018
20pts,077
21btc,085
22bpr,019
23bfp,020
24bfd,021
25bml,022
26apd,078
27blf,079
28slp,080
29vrt,081
30fni,082
31sid,083
32mlk,084
33mso,086
34sdc,089
35cng,023
36dba,024
37dbv,025
38dor,026
39rnd,027
40skd,028
41sfi,029
42mdk,030
43dcc,031
44skt,032
45mtm,033
46tr0,034
47tr1,035
48e00,036
49e01,037
50e02,038
51e03,039
52e04,040
53e05,041
54e06,042
55e07,043
56e08,044
57e09,045
58e10,046
59e11,047
60e12,048
61e13,049
62e14,050
63e15,051
64e16,052
65e17,053
66e18,054
67e19,055
68e20,056
69e21,057
70e22,058
71e23,059
72e24,060
73e25,061
74e26,062
75e27,063
76e28,064
77e29,065
78e30,066
79e31,067
80clv,068
81sps,069
82mdl,070
83edw,071
84bti,072
85hdi,073
86lbi,074
87fui,075
88eri,076
89pci,087
90dbi,088
diff --git a/utils/nwztools/database/nvp/nwz-a850.txt b/utils/nwztools/database/nvp/nwz-a850.txt
new file mode 100644
index 0000000000..d5f5a05cc0
--- /dev/null
+++ b/utils/nwztools/database/nvp/nwz-a850.txt
@@ -0,0 +1,79 @@
1dbg,000
2bti,001
3hdi,002
4cng,003
5ser,004
6app,005
7eri,006
8dcc,007
9mdl,008
10fup,009
11bok,010
12shp,011
13dba,012
14dbv,013
15tr0,014
16tr1,015
17mid,016
18tst,017
19gty,018
20fui,019
21lbi,020
22dor,021
23edw,022
24ubp,023
25syi,024
26exm,025
27pcd,026
28rnd,028
29ufn,029
30sdp,030
31ncp,031
32kas,032
33rtc,034
34bpr,035
35e00,036
36e01,037
37e02,038
38e03,039
39e04,040
40e05,041
41e06,042
42e07,043
43e08,044
44e09,045
45e10,046
46e11,047
47e12,048
48e13,049
49e14,050
50e15,051
51e16,052
52e17,053
53e18,054
54e19,055
55e20,056
56e21,057
57e22,058
58e23,059
59e24,060
60e25,061
61e26,062
62e27,063
63e28,064
64e29,065
65e30,066
66e31,067
67clv,068
68slp,069
69ipt,070
70pts,075
71skt,076
72mac,077
73apd,078
74blf,079
75hld,080
76skd,081
77fmp,082
78sps,083
79msc,084
diff --git a/utils/nwztools/database/nvp/nwz-a860.txt b/utils/nwztools/database/nvp/nwz-a860.txt
new file mode 100644
index 0000000000..f3b5e8738a
--- /dev/null
+++ b/utils/nwztools/database/nvp/nwz-a860.txt
@@ -0,0 +1,90 @@
1dbg,000
2bti,001
3hdi,002
4cng,003
5ser,004
6app,005
7eri,006
8dcc,007
9mdl,008
10fup,009
11bok,010
12shp,011
13dba,012
14dbv,013
15tr0,014
16tr1,015
17mid,016
18tst,017
19gty,018
20fui,019
21lbi,020
22dor,021
23edw,022
24ubp,023
25syi,024
26exm,025
27pcd,026
28btc,027
29rnd,028
30ufn,029
31sdp,030
32ncp,031
33kas,032
34sfi,033
35rtc,034
36bpr,035
37e00,036
38e01,037
39e02,038
40e03,039
41e04,040
42e05,041
43e06,042
44e07,043
45e08,044
46e09,045
47e10,046
48e11,047
49e12,048
50e13,049
51e14,050
52e15,051
53e16,052
54e17,053
55e18,054
56e19,055
57e20,056
58e21,057
59e22,058
60e23,059
61e24,060
62e25,061
63e26,062
64e27,063
65e28,064
66e29,065
67e30,066
68e31,067
69clv,068
70slp,069
71ipt,070
72mtm,071
73mcr,072
74mdk,073
75muk,074
76pts,075
77skt,076
78mac,077
79apd,078
80blf,079
81hld,080
82skd,081
83fmp,082
84sps,083
85msc,084
86vrt,085
87psk,086
88bml,087
89bfd,088
90bfp,089
diff --git a/utils/nwztools/database/nvp/nwz-e350.txt b/utils/nwztools/database/nvp/nwz-e350.txt
new file mode 100644
index 0000000000..d5f5a05cc0
--- /dev/null
+++ b/utils/nwztools/database/nvp/nwz-e350.txt
@@ -0,0 +1,79 @@
1dbg,000
2bti,001
3hdi,002
4cng,003
5ser,004
6app,005
7eri,006
8dcc,007
9mdl,008
10fup,009
11bok,010
12shp,011
13dba,012
14dbv,013
15tr0,014
16tr1,015
17mid,016
18tst,017
19gty,018
20fui,019
21lbi,020
22dor,021
23edw,022
24ubp,023
25syi,024
26exm,025
27pcd,026
28rnd,028
29ufn,029
30sdp,030
31ncp,031
32kas,032
33rtc,034
34bpr,035
35e00,036
36e01,037
37e02,038
38e03,039
39e04,040
40e05,041
41e06,042
42e07,043
43e08,044
44e09,045
45e10,046
46e11,047
47e12,048
48e13,049
49e14,050
50e15,051
51e16,052
52e17,053
53e18,054
54e19,055
55e20,056
56e21,057
57e22,058
58e23,059
59e24,060
60e25,061
61e26,062
62e27,063
63e28,064
64e29,065
65e30,066
66e31,067
67clv,068
68slp,069
69ipt,070
70pts,075
71skt,076
72mac,077
73apd,078
74blf,079
75hld,080
76skd,081
77fmp,082
78sps,083
79msc,084
diff --git a/utils/nwztools/database/nvp/nwz-e450.txt b/utils/nwztools/database/nvp/nwz-e450.txt
new file mode 100644
index 0000000000..d5f5a05cc0
--- /dev/null
+++ b/utils/nwztools/database/nvp/nwz-e450.txt
@@ -0,0 +1,79 @@
1dbg,000
2bti,001
3hdi,002
4cng,003
5ser,004
6app,005
7eri,006
8dcc,007
9mdl,008
10fup,009
11bok,010
12shp,011
13dba,012
14dbv,013
15tr0,014
16tr1,015
17mid,016
18tst,017
19gty,018
20fui,019
21lbi,020
22dor,021
23edw,022
24ubp,023
25syi,024
26exm,025
27pcd,026
28rnd,028
29ufn,029
30sdp,030
31ncp,031
32kas,032
33rtc,034
34bpr,035
35e00,036
36e01,037
37e02,038
38e03,039
39e04,040
40e05,041
41e06,042
42e07,043
43e08,044
44e09,045
45e10,046
46e11,047
47e12,048
48e13,049
49e14,050
50e15,051
51e16,052
52e17,053
53e18,054
54e19,055
55e20,056
56e21,057
57e22,058
58e23,059
59e24,060
60e25,061
61e26,062
62e27,063
63e28,064
64e29,065
65e30,066
66e31,067
67clv,068
68slp,069
69ipt,070
70pts,075
71skt,076
72mac,077
73apd,078
74blf,079
75hld,080
76skd,081
77fmp,082
78sps,083
79msc,084
diff --git a/utils/nwztools/database/nvp/nwz-e460.txt b/utils/nwztools/database/nvp/nwz-e460.txt
new file mode 100644
index 0000000000..f3b5e8738a
--- /dev/null
+++ b/utils/nwztools/database/nvp/nwz-e460.txt
@@ -0,0 +1,90 @@
1dbg,000
2bti,001
3hdi,002
4cng,003
5ser,004
6app,005
7eri,006
8dcc,007
9mdl,008
10fup,009
11bok,010
12shp,011
13dba,012
14dbv,013
15tr0,014
16tr1,015
17mid,016
18tst,017
19gty,018
20fui,019
21lbi,020
22dor,021
23edw,022
24ubp,023
25syi,024
26exm,025
27pcd,026
28btc,027
29rnd,028
30ufn,029
31sdp,030
32ncp,031
33kas,032
34sfi,033
35rtc,034
36bpr,035
37e00,036
38e01,037
39e02,038
40e03,039
41e04,040
42e05,041
43e06,042
44e07,043
45e08,044
46e09,045
47e10,046
48e11,047
49e12,048
50e13,049
51e14,050
52e15,051
53e16,052
54e17,053
55e18,054
56e19,055
57e20,056
58e21,057
59e22,058
60e23,059
61e24,060
62e25,061
63e26,062
64e27,063
65e28,064
66e29,065
67e30,066
68e31,067
69clv,068
70slp,069
71ipt,070
72mtm,071
73mcr,072
74mdk,073
75muk,074
76pts,075
77skt,076
78mac,077
79apd,078
80blf,079
81hld,080
82skd,081
83fmp,082
84sps,083
85msc,084
86vrt,085
87psk,086
88bml,087
89bfd,088
90bfp,089
diff --git a/utils/nwztools/database/nvp/nwz-e470.txt b/utils/nwztools/database/nvp/nwz-e470.txt
new file mode 100644
index 0000000000..d69cd3ac6b
--- /dev/null
+++ b/utils/nwztools/database/nvp/nwz-e470.txt
@@ -0,0 +1,87 @@
1dbg,000
2syi,001
3ubp,002
4fup,003
5bok,004
6hld,005
7rtc,006
8mid,007
9pcd,008
10ser,009
11ufn,010
12kas,011
13shp,012
14tst,013
15gty,014
16fmp,015
17sdp,016
18ncp,017
19psk,018
20pts,077
21bpr,019
22bfp,020
23bfd,021
24bml,022
25apd,078
26blf,079
27slp,080
28vrt,081
29fni,082
30sid,083
31mlk,084
32mso,086
33cng,023
34dba,024
35dbv,025
36dor,026
37rnd,027
38skd,028
39sfi,029
40mdk,030
41dcc,031
42skt,032
43mtm,033
44tr0,034
45tr1,035
46e00,036
47e01,037
48e02,038
49e03,039
50e04,040
51e05,041
52e06,042
53e07,043
54e08,044
55e09,045
56e10,046
57e11,047
58e12,048
59e13,049
60e14,050
61e15,051
62e16,052
63e17,053
64e18,054
65e19,055
66e20,056
67e21,057
68e22,058
69e23,059
70e24,060
71e25,061
72e26,062
73e27,063
74e28,064
75e29,065
76e30,066
77e31,067
78clv,068
79sps,069
80mdl,070
81edw,071
82bti,072
83hdi,073
84lbi,074
85fui,075
86eri,076
87btc,085
diff --git a/utils/nwztools/database/nvp/nwz-e580.txt b/utils/nwztools/database/nvp/nwz-e580.txt
new file mode 100644
index 0000000000..95d2025905
--- /dev/null
+++ b/utils/nwztools/database/nvp/nwz-e580.txt
@@ -0,0 +1,89 @@
1dbg,000
2syi,001
3ubp,002
4fup,003
5bok,004
6hld,005
7rtc,006
8mid,007
9pcd,008
10ser,009
11ufn,010
12kas,011
13shp,012
14tst,013
15gty,014
16fmp,015
17sdp,016
18ncp,017
19psk,018
20pts,077
21bpr,019
22bfp,020
23bfd,021
24bml,022
25apd,078
26blf,079
27slp,080
28vrt,081
29fni,082
30sid,083
31mlk,084
32mso,086
33cng,023
34dba,024
35dbv,025
36dor,026
37rnd,027
38skd,028
39sfi,029
40mdk,030
41dcc,031
42skt,032
43mtm,033
44tr0,034
45tr1,035
46e00,036
47e01,037
48e02,038
49e03,039
50e04,040
51e05,041
52e06,042
53e07,043
54e08,044
55e09,045
56e10,046
57e11,047
58e12,048
59e13,049
60e14,050
61e15,051
62e16,052
63e17,053
64e18,054
65e19,055
66e20,056
67e21,057
68e22,058
69e23,059
70e24,060
71e25,061
72e26,062
73e27,063
74e28,064
75e29,065
76e30,066
77e31,067
78clv,068
79sps,069
80mdl,070
81edw,071
82bti,072
83hdi,073
84lbi,074
85fui,075
86eri,076
87btc,085
88pci,087
89dbi,088
diff --git a/utils/nwztools/database/nvp/nwz-s760.txt b/utils/nwztools/database/nvp/nwz-s760.txt
new file mode 100644
index 0000000000..f3b5e8738a
--- /dev/null
+++ b/utils/nwztools/database/nvp/nwz-s760.txt
@@ -0,0 +1,90 @@
1dbg,000
2bti,001
3hdi,002
4cng,003
5ser,004
6app,005
7eri,006
8dcc,007
9mdl,008
10fup,009
11bok,010
12shp,011
13dba,012
14dbv,013
15tr0,014
16tr1,015
17mid,016
18tst,017
19gty,018
20fui,019
21lbi,020
22dor,021
23edw,022
24ubp,023
25syi,024
26exm,025
27pcd,026
28btc,027
29rnd,028
30ufn,029
31sdp,030
32ncp,031
33kas,032
34sfi,033
35rtc,034
36bpr,035
37e00,036
38e01,037
39e02,038
40e03,039
41e04,040
42e05,041
43e06,042
44e07,043
45e08,044
46e09,045
47e10,046
48e11,047
49e12,048
50e13,049
51e14,050
52e15,051
53e16,052
54e17,053
55e18,054
56e19,055
57e20,056
58e21,057
59e22,058
60e23,059
61e24,060
62e25,061
63e26,062
64e27,063
65e28,064
66e29,065
67e30,066
68e31,067
69clv,068
70slp,069
71ipt,070
72mtm,071
73mcr,072
74mdk,073
75muk,074
76pts,075
77skt,076
78mac,077
79apd,078
80blf,079
81hld,080
82skd,081
83fmp,082
84sps,083
85msc,084
86vrt,085
87psk,086
88bml,087
89bfd,088
90bfp,089
diff --git a/utils/nwztools/database/nvp/nwz-zx100.txt b/utils/nwztools/database/nvp/nwz-zx100.txt
new file mode 100644
index 0000000000..e7ed5a0bd4
--- /dev/null
+++ b/utils/nwztools/database/nvp/nwz-zx100.txt
@@ -0,0 +1,90 @@
1dbg,000
2syi,001
3ubp,002
4fup,003
5bok,004
6hld,005
7rtc,006
8mid,007
9pcd,008
10ser,009
11ufn,010
12kas,011
13shp,012
14tst,013
15gty,014
16fmp,015
17sdp,016
18ncp,017
19psk,018
20pts,077
21btc,085
22bpr,019
23bfp,020
24bfd,021
25bml,022
26apd,078
27blf,079
28slp,080
29vrt,081
30fni,082
31sid,083
32mlk,084
33mso,086
34sdc,089
35cng,023
36dba,024
37dbv,025
38dor,026
39rnd,027
40skd,028
41sfi,029
42mdk,030
43dcc,031
44skt,032
45mtm,033
46tr0,034
47tr1,035
48e00,036
49e01,037
50e02,038
51e03,039
52e04,040
53e05,041
54e06,042
55e07,043
56e08,044
57e09,045
58e10,046
59e11,047
60e12,048
61e13,049
62e14,050
63e15,051
64e16,052
65e17,053
66e18,054
67e19,055
68e20,056
69e21,057
70e22,058
71e23,059
72e24,060
73e25,061
74e26,062
75e27,063
76e28,064
77e29,065
78e30,066
79e31,067
80clv,068
81sps,069
82mdl,070
83edw,071
84bti,072
85hdi,073
86lbi,074
87fui,075
88eri,076
89pci,087
90dbi,088
diff --git a/utils/nwztools/database/nvp/nwz-zx2.txt b/utils/nwztools/database/nvp/nwz-zx2.txt
new file mode 100644
index 0000000000..ebc6c8d56d
--- /dev/null
+++ b/utils/nwztools/database/nvp/nwz-zx2.txt
@@ -0,0 +1,90 @@
1dbg,000
2bti,001
3hdi,002
4cng,003
5ser,004
6app,005
7eri,006
8dcc,007
9mdl,008
10fup,009
11bok,010
12shp,011
13dba,012
14dbv,013
15tr0,014
16tr1,015
17mid,016
18tst,017
19gty,018
20fui,019
21lbi,020
22dor,021
23edw,022
24ubp,023
25syi,024
26exm,025
27pcd,026
28cgp,027
29rnd,028
30ufn,029
31sdp,030
32ncp,031
33kas,032
34sfi,033
35rtc,034
36bpr,035
37e00,036
38e01,037
39e02,038
40e03,039
41e04,040
42e05,041
43e06,042
44e07,043
45e08,044
46e09,045
47e10,046
48e11,047
49e12,048
50e13,049
51e14,050
52e15,051
53e16,052
54e17,053
55e18,054
56e19,055
57e20,056
58e21,057
59e22,058
60e23,059
61e24,060
62e25,061
63e26,062
64e27,063
65e28,064
66e29,065
67e30,066
68e31,067
69clv,068
70slp,069
71ipt,070
72mtm,071
73mcr,072
74mdk,073
75muk,074
76pts,075
77skt,076
78mac,077
79apd,078
80blf,079
81hld,080
82skd,081
83fmp,082
84sps,083
85msc,084
86vrt,085
87psk,086
88bml,087
89bfd,088
90bfp,089
diff --git a/utils/nwztools/database/nvp/parse_all_nvp_headers.sh b/utils/nwztools/database/nvp/parse_all_nvp_headers.sh
new file mode 100755
index 0000000000..e84eaae8f5
--- /dev/null
+++ b/utils/nwztools/database/nvp/parse_all_nvp_headers.sh
@@ -0,0 +1,33 @@
1#
2# usage: parse_all_nvp_headers /path/to/directory
3#
4# the expected structure is:
5# nwz-*/<kernel>
6# nw-*/<kernel/
7# where <kernel> must be of the form
8# linux-kernel-*.tgz
9#
10if [ "$#" -lt 1 ]; then
11 >&2 echo "usage: parse_all_nvp_header.sh /path/to/directory"
12 exit 1
13fi
14
15# list interesting directories
16for dir in `find "$1" -maxdepth 1 -name "nw-*" -or -name "nwz-*"`
17do
18 # extract codename
19 codename=`basename "$dir"`
20 # only consider linux based targets
21 if [ -e "$dir/not_linux" ]; then
22 #echo "$codename: not linux based"
23 continue
24 fi
25 # check if we can find a kernel
26 kernel_tgz=`find "$dir" -maxdepth 1 -name "linux-kernel-*.tgz"`
27 if [ "$kernel_tgz" == "" ]; then
28 echo "$codename: no kernel found"
29 continue
30 fi
31 echo "$codename: found kernel `basename $kernel_tgz`"
32 ./parse_nvp_header.sh "$kernel_tgz" > "$codename.txt"
33done
diff --git a/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh b/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh
new file mode 100755
index 0000000000..3aae79deb0
--- /dev/null
+++ b/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh
@@ -0,0 +1,32 @@
1#
2# usage: parse_all_nvp_nodes /path/to/directory
3#
4# the expected structure is:
5# nwz-*/rootfs.tar
6# nwz-*/rootfs.tar
7#
8if [ "$#" -lt 1 ]; then
9 >&2 echo "usage: parse_all_nvp_header.sh /path/to/directory"
10 exit 1
11fi
12
13# list interesting directories
14for dir in `find "$1" -maxdepth 1 -name "nw-*" -or -name "nwz-*"`
15do
16 # extract codename
17 codename=`basename "$dir"`
18 # only consider linux based targets
19 if [ -e "$dir/not_linux" ]; then
20 #echo "$codename: not linux based"
21 continue
22 fi
23 # check if we can find a rootfs
24 rootfs_tgz="$dir/rootfs.tgz"
25 if [ ! -e "$rootfs_tgz" ]; then
26 echo "$codename: no rootfs found"
27 continue
28 fi
29 echo "$codename: found rootfs `basename $rootfs_tgz`"
30 ./parse_nvp_nodes.sh "$rootfs_tgz" "nodes-$codename.txt"
31done
32
diff --git a/utils/nwztools/database/nvp/parse_nvp_header.sh b/utils/nwztools/database/nvp/parse_nvp_header.sh
new file mode 100755
index 0000000000..853df93557
--- /dev/null
+++ b/utils/nwztools/database/nvp/parse_nvp_header.sh
@@ -0,0 +1,77 @@
1# usage
2# parse_header.sh /path/to/icx_nvp.h
3# parse_header.sh /path/to/linux/source [file]
4# parse_header.sh /path/to/linux.tgz [file]
5# the optional argument is an additional filter when there are several matches
6# and is an argument to grep
7#
8if [ "$#" -lt 1 ]; then
9 >&2 echo "usage: parse_header.sh /path/to/icx_nvp.h|/path/to/kernel/source|/path/to/kernel.tgz [filter]"
10 exit 1
11fi
12
13FILE="$1"
14IN_TGZ="0"
15FILTER="$2"
16
17# for directories, list all files
18if [ -d "$FILE" ]; then
19 LIST=`find "$FILE"`
20else
21 # otherwise try un unpack it using tar, to see if it's an archive
22 LIST=`tar -tzf "$FILE"`
23 if [ "$?" == 0 ]; then
24 IN_TGZ="1"
25 TGZ="$FILE"
26 else
27 # assume the input is just the right file
28 LIST="$FILE"
29 fi
30fi
31
32# apply user filter
33if [ "$FILTER" != "" ]; then
34 LIST=`echo "$LIST" | grep "$FILTER"`
35fi
36# if file contains icx_nvp_emmc.h, we want that
37if [ "`echo "$LIST" | grep "icx_nvp_emmc.h" | wc -l`" = "1" ]; then
38 LIST=`echo "$LIST" | grep "icx_nvp_emmc.h"`
39else
40 LIST=`echo "$LIST" | grep 'icx[[:digit:]]*_nvp[[:alpha:]_]*.h'`
41fi
42LIST_CNT=`echo "$LIST" | wc -l`
43if [ "$LIST_CNT" = "0" ]; then
44 >&2 echo "No icx nvp file found"
45 exit 1
46elif [ "$LIST_CNT" != "1" ]; then
47 >&2 echo "Several matches for icx nvp:"
48 >&2 echo "$LIST"
49 exit 1
50else
51 FILE="$LIST"
52fi
53
54# if file is in archive, we need to extract it
55if [ "$IN_TGZ" = "1" ]; then
56 >&2 echo "Extracting $FILE from $TGZ"
57 TMP=`mktemp`
58 tar -Ozxf "$TGZ" "$FILE" > $TMP
59 if [ "$?" != 0 ]; then
60 >&2 echo "Extraction failed"
61 exit 1
62 fi
63 FILE="$TMP"
64else
65 >&2 echo "Analyzing $FILE"
66fi
67
68cat "$FILE" | awk ' \
69BEGIN { \
70 expr = "#define[[:space:]]+ICX_NVP_NODE_([[:alnum:]]+)[[:space:]]+ICX_NVP_NODE_BASE[[:space:]]*\"([[:digit:]]+)\""; \
71} \
72{ \
73 if($0 ~ expr) \
74 { \
75 print(tolower(gensub(expr, "\\1,\\2", "g", $0)));
76 } \
77}'
diff --git a/utils/nwztools/database/nvp/parse_nvp_nodes.sh b/utils/nwztools/database/nvp/parse_nvp_nodes.sh
new file mode 100755
index 0000000000..cf42504e32
--- /dev/null
+++ b/utils/nwztools/database/nvp/parse_nvp_nodes.sh
@@ -0,0 +1,58 @@
1# usage
2# parse_nodes.sh /path/to/icx_nvp_emmc.ko output_file
3# parse_nodes.sh /path/to/rootfs/dir output_file
4# parse_nodes.sh /path/to/rootfs.tgz output_file
5#
6if [ "$#" -lt 2 ]; then
7 >&2 echo "usage: parse_header.sh /path/to/icx_nvp.ko|/path/to/rootfs/dir|/path/to/rootfs.tgz output_file"
8 exit 1
9fi
10
11FILE="$1"
12IN_TGZ="0"
13OUTPUT="$2"
14
15# for directories, list all files
16if [ -d "$FILE" ]; then
17 LIST=`find "$FILE"`
18else
19 # otherwise try un unpack it using tar, to see if it's an archive
20 LIST=`tar -tzf "$FILE"`
21 if [ "$?" == 0 ]; then
22 IN_TGZ="1"
23 TGZ="$FILE"
24 else
25 # assume the input is just the right file
26 LIST="$FILE"
27 fi
28fi
29
30# look for icx_nvp_emmc.ko
31LIST=`echo "$LIST" | grep "icx[[:digit:]]*_nvp[[:alpha:]_]*.ko"`
32LIST_CNT=`echo "$LIST" | wc -l`
33if [ "$LIST" == "" ]; then
34 >&2 echo "No icx nvp file found"
35 exit 1
36elif [ "$LIST_CNT" != "1" ]; then
37 >&2 echo "Several matches for icx nvp:"
38 >&2 echo "$LIST"
39 exit 1
40else
41 FILE="$LIST"
42fi
43
44# if file is in archive, we need to extract it
45if [ "$IN_TGZ" = "1" ]; then
46 >&2 echo "Extracting $FILE from $TGZ"
47 TMP=`mktemp`
48 tar -Ozxf "$TGZ" "$FILE" > $TMP
49 if [ "$?" != 0 ]; then
50 >&2 echo "Extraction failed"
51 exit 1
52 fi
53 FILE="$TMP"
54else
55 >&2 echo "Analyzing $FILE"
56fi
57
58./nvptool -x "$FILE" -o "$OUTPUT" >/dev/null
diff --git a/utils/nwztools/database/nwz_db.c b/utils/nwztools/database/nwz_db.c
new file mode 100644
index 0000000000..3288fc1bec
--- /dev/null
+++ b/utils/nwztools/database/nwz_db.c
@@ -0,0 +1,1268 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2016 Amaury Pouly
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ****************************************************************************/
20
21/** /!\ This file was automatically generated, DO NOT MODIFY IT DIRECTLY /!\ */
22
23#include "nwz_db.h"
24
25struct nwz_model_info_t nwz_model[NWZ_MODEL_COUNT] =
26{
27 { 0x10000, "NWZ-A815" },
28 { 0x10001, "NWZ-A816" },
29 { 0x10002, "NWZ-A818" },
30 { 0x1000000, "NW-S615F" },
31 { 0x1000001, "NW-S616F" },
32 { 0x1010000, "NW-S715F" },
33 { 0x1010001, "NW-S716F" },
34 { 0x1010002, "NW-S718F" },
35 { 0x1020000, "NWZ-S615F" },
36 { 0x1020001, "NWZ-S616F" },
37 { 0x1020002, "NWZ-S618F" },
38 { 0x1030000, "NWZ-S515" },
39 { 0x1030001, "NWZ-S516" },
40 { 0x1040000, "NWZ-S715F" },
41 { 0x1040001, "NWZ-S716F" },
42 { 0x1040002, "NWZ-S718F" },
43 { 0x2000001, "NW-A916" },
44 { 0x2000002, "NW-A918" },
45 { 0x2000004, "NW-A919" },
46 { 0x3000001, "NWZ-A826" },
47 { 0x3000002, "NWZ-A828" },
48 { 0x3000004, "NWZ-A829" },
49 { 0x3010001, "NW-A826" },
50 { 0x3010002, "NW-A828" },
51 { 0x3010004, "NW-A829" },
52 { 0x3020001, "NWZ-A726B" },
53 { 0x3020002, "NWZ-A728B" },
54 { 0x3020004, "NWZ-A729B" },
55 { 0x3030001, "NWZ-A726" },
56 { 0x3030002, "NWZ-A728" },
57 { 0x3030004, "NWZ-A729" },
58 { 0x4000001, "NW-S636F" },
59 { 0x4000002, "NW-S638F" },
60 { 0x4000004, "NW-S639F" },
61 { 0x4010001, "NW-S736F" },
62 { 0x4010002, "NW-S738F" },
63 { 0x4010004, "NW-S739F" },
64 { 0x4020001, "NWZ-S636F" },
65 { 0x4020002, "NWZ-S638F" },
66 { 0x4020004, "NWZ-S639F" },
67 { 0x4030001, "NWZ-S736F" },
68 { 0x4030002, "NWZ-S738F" },
69 { 0x4030004, "NWZ-S739F" },
70 { 0x5000002, "NW-X1040" },
71 { 0x5000004, "NW-X1050" },
72 { 0x5000005, "NW-X1060" },
73 { 0x5010002, "NWZ-NONAME" },
74 { 0x5010004, "NWZ-NONAME" },
75 { 0x5010005, "NWZ-NONAME" },
76 { 0x5020002, "NWZ-X1040" },
77 { 0x5020004, "NWZ-X1050" },
78 { 0x5020005, "NWZ-X1060" },
79 { 0x5040002, "NWZ-X1041" },
80 { 0x5040004, "NWZ-X1051" },
81 { 0x5040005, "NWZ-X1061" },
82 { 0x6010002, "NW-S644" },
83 { 0x6010004, "NW-S645" },
84 { 0x6010005, "NW-S646" },
85 { 0x6020002, "NWZ-S744" },
86 { 0x6020004, "NWZ-S745" },
87 { 0x6020005, "NWZ-S746" },
88 { 0x6030002, "NW-S744" },
89 { 0x6030004, "NW-S745" },
90 { 0x6030005, "NW-S746" },
91 { 0x7000004, "NWZ-A845" },
92 { 0x7000005, "NWZ-A846" },
93 { 0x7000006, "NWZ-A847" },
94 { 0x7010004, "NW-A845" },
95 { 0x7010005, "NW-A846" },
96 { 0x7010006, "NW-A847" },
97 { 0x8000000, "NW-E052" },
98 { 0x8000001, "NW-E053" },
99 { 0x8000002, "NW-E054" },
100 { 0x9000002, "NW-S754" },
101 { 0x9000004, "NW-S755" },
102 { 0x9000005, "NW-S756" },
103 { 0xb000001, "NWZ-E453" },
104 { 0xb000002, "NWZ-E454" },
105 { 0xb000004, "NWZ-E455" },
106 { 0xc000001, "NWZ-E353" },
107 { 0xc000002, "NWZ-E354" },
108 { 0xc000004, "NWZ-E355" },
109 { 0xd000001, "NWZ-E553" },
110 { 0xd000002, "NWZ-E554" },
111 { 0xd000004, "NWZ-E555" },
112 { 0xd000005, "NWZ-E556" },
113 { 0xe000004, "NWZ-A855" },
114 { 0xe000005, "NWZ-A856" },
115 { 0xe000006, "NWZ-A857" },
116 { 0xf000002, "NWZ-S754" },
117 { 0xf000004, "NWZ-S755" },
118 { 0x10000000, "NWZ-E052" },
119 { 0x10000001, "NWZ-E053" },
120 { 0x11000001, "NW-A863" },
121 { 0x11000002, "NW-A864" },
122 { 0x11000004, "NW-A865" },
123 { 0x11000005, "NW-A866" },
124 { 0x11000006, "NW-A867" },
125 { 0x11010001, "NWZ-A863" },
126 { 0x11010002, "NWZ-A864" },
127 { 0x11010004, "NWZ-A865" },
128 { 0x11010005, "NWZ-A866" },
129 { 0x11010006, "NWZ-A867" },
130 { 0x11020001, "NWZ-A863" },
131 { 0x11020002, "NWZ-A864" },
132 { 0x11020004, "NWZ-A865" },
133 { 0x11020005, "NWZ-A866" },
134 { 0x11020006, "NWZ-A867" },
135 { 0x12000001, "NW-S763" },
136 { 0x12000002, "NW-S764" },
137 { 0x12000004, "NW-S765" },
138 { 0x12000005, "NW-S766" },
139 { 0x12000006, "NW-S767" },
140 { 0x12010001, "NWZ-S763" },
141 { 0x12010002, "NWZ-S764" },
142 { 0x12010004, "NWZ-S765" },
143 { 0x12010005, "NWZ-S766" },
144 { 0x12010006, "NWZ-S767" },
145 { 0x13000001, "NWZ-E463" },
146 { 0x13000002, "NWZ-E464" },
147 { 0x13000004, "NWZ-E465" },
148 { 0x14000000, "NW-E062" },
149 { 0x14000001, "NW-E063" },
150 { 0x14000002, "NW-E064" },
151 { 0x14000004, "NW-E065" },
152 { 0x14000005, "NW-E066" },
153 { 0x15000001, "NWZ-E473" },
154 { 0x15000002, "NWZ-E474" },
155 { 0x15000004, "NWZ-E475" },
156 { 0x15000005, "NWZ-E476" },
157 { 0x15010001, "NWZ-E573" },
158 { 0x15010002, "NWZ-E574" },
159 { 0x15010004, "NWZ-E575" },
160 { 0x15010005, "NWZ-E576" },
161 { 0x16000001, "NW-S773" },
162 { 0x16000002, "NW-S774" },
163 { 0x16000004, "NW-S775" },
164 { 0x16000005, "NW-S776" },
165 { 0x16010001, "NWZ-S773" },
166 { 0x16010002, "NWZ-S774" },
167 { 0x16010004, "NWZ-S775" },
168 { 0x16010005, "NWZ-S776" },
169 { 0x19000001, "NW-S783" },
170 { 0x19000002, "NW-S784" },
171 { 0x19000004, "NW-S785" },
172 { 0x19000005, "NW-S786" },
173 { 0x19010001, "NW-E083" },
174 { 0x19010002, "NW-E084" },
175 { 0x19010004, "NW-E085" },
176 { 0x19010005, "NW-E086" },
177 { 0x19020001, "NWZ-E583" },
178 { 0x19020002, "NWZ-E584" },
179 { 0x19020004, "NWZ-E585" },
180 { 0x19020005, "NWZ-E586" },
181 { 0x1a000001, "NW-A13" },
182 { 0x1a000002, "NW-A14" },
183 { 0x1a000004, "NW-A15" },
184 { 0x1a000005, "NW-A16" },
185 { 0x1a000006, "NW-A17" },
186 { 0x1a010001, "NWZ-A13" },
187 { 0x1a010002, "NWZ-A14" },
188 { 0x1a010004, "NWZ-A15" },
189 { 0x1a010005, "NWZ-A16" },
190 { 0x1a010006, "NWZ-A17" },
191 { 0x1b000001, "NW-S13" },
192 { 0x1b000002, "NW-S14" },
193 { 0x1b000004, "NW-S15" },
194 { 0x1b000005, "NW-S16" },
195 { 0x1b000006, "NW-S17" },
196 { 0x1c000001, "NW-ZX103" },
197 { 0x1c000002, "NW-ZX104" },
198 { 0x1c000004, "NW-ZX105" },
199 { 0x1c000005, "NW-ZX106" },
200 { 0x1c000006, "NW-ZX107" },
201 { 0x1c000007, "NW-ZX100" },
202 { 0x1d000001, "NW-A23" },
203 { 0x1d000002, "NW-A24" },
204 { 0x1d000004, "NW-A25" },
205 { 0x1d000005, "NW-A26" },
206 { 0x1d000006, "NW-A27" },
207 { 0x1d000007, "NW-A28" },
208};
209
210static int nvp_index_28dc2c[NWZ_NVP_COUNT] =
211{
212 [NWZ_NVP_APD] = 78,
213 [NWZ_NVP_APP] = NWZ_NVP_INVALID,
214 [NWZ_NVP_BFD] = 21,
215 [NWZ_NVP_BFP] = 20,
216 [NWZ_NVP_BLF] = 79,
217 [NWZ_NVP_BML] = 22,
218 [NWZ_NVP_BOK] = 4,
219 [NWZ_NVP_BPR] = 19,
220 [NWZ_NVP_BTC] = 85,
221 [NWZ_NVP_BTI] = 72,
222 [NWZ_NVP_CGP] = NWZ_NVP_INVALID,
223 [NWZ_NVP_CLV] = 68,
224 [NWZ_NVP_CNG] = 23,
225 [NWZ_NVP_CTR] = NWZ_NVP_INVALID,
226 [NWZ_NVP_DBA] = 24,
227 [NWZ_NVP_DBG] = 0,
228 [NWZ_NVP_DBI] = NWZ_NVP_INVALID,
229 [NWZ_NVP_DBV] = 25,
230 [NWZ_NVP_DCC] = 31,
231 [NWZ_NVP_DOR] = 26,
232 [NWZ_NVP_E00] = 36,
233 [NWZ_NVP_E01] = 37,
234 [NWZ_NVP_E02] = 38,
235 [NWZ_NVP_E03] = 39,
236 [NWZ_NVP_E04] = 40,
237 [NWZ_NVP_E05] = 41,
238 [NWZ_NVP_E06] = 42,
239 [NWZ_NVP_E07] = 43,
240 [NWZ_NVP_E08] = 44,
241 [NWZ_NVP_E09] = 45,
242 [NWZ_NVP_E10] = 46,
243 [NWZ_NVP_E11] = 47,
244 [NWZ_NVP_E12] = 48,
245 [NWZ_NVP_E13] = 49,
246 [NWZ_NVP_E14] = 50,
247 [NWZ_NVP_E15] = 51,
248 [NWZ_NVP_E16] = 52,
249 [NWZ_NVP_E17] = 53,
250 [NWZ_NVP_E18] = 54,
251 [NWZ_NVP_E19] = 55,
252 [NWZ_NVP_E20] = 56,
253 [NWZ_NVP_E21] = 57,
254 [NWZ_NVP_E22] = 58,
255 [NWZ_NVP_E23] = 59,
256 [NWZ_NVP_E24] = 60,
257 [NWZ_NVP_E25] = 61,
258 [NWZ_NVP_E26] = 62,
259 [NWZ_NVP_E27] = 63,
260 [NWZ_NVP_E28] = 64,
261 [NWZ_NVP_E29] = 65,
262 [NWZ_NVP_E30] = 66,
263 [NWZ_NVP_E31] = 67,
264 [NWZ_NVP_EDW] = 71,
265 [NWZ_NVP_ERI] = 76,
266 [NWZ_NVP_EXM] = NWZ_NVP_INVALID,
267 [NWZ_NVP_FMP] = 15,
268 [NWZ_NVP_FNI] = 82,
269 [NWZ_NVP_FPI] = NWZ_NVP_INVALID,
270 [NWZ_NVP_FUI] = 75,
271 [NWZ_NVP_FUP] = 3,
272 [NWZ_NVP_FUR] = NWZ_NVP_INVALID,
273 [NWZ_NVP_FVI] = NWZ_NVP_INVALID,
274 [NWZ_NVP_GTY] = 14,
275 [NWZ_NVP_HDI] = 73,
276 [NWZ_NVP_HLD] = 5,
277 [NWZ_NVP_INS] = NWZ_NVP_INVALID,
278 [NWZ_NVP_IPT] = NWZ_NVP_INVALID,
279 [NWZ_NVP_KAS] = 11,
280 [NWZ_NVP_LBI] = 74,
281 [NWZ_NVP_LYR] = NWZ_NVP_INVALID,
282 [NWZ_NVP_MAC] = NWZ_NVP_INVALID,
283 [NWZ_NVP_MCR] = NWZ_NVP_INVALID,
284 [NWZ_NVP_MDK] = 30,
285 [NWZ_NVP_MDL] = 70,
286 [NWZ_NVP_MID] = 7,
287 [NWZ_NVP_MLK] = 84,
288 [NWZ_NVP_MSC] = NWZ_NVP_INVALID,
289 [NWZ_NVP_MSO] = 86,
290 [NWZ_NVP_MTM] = 33,
291 [NWZ_NVP_MUK] = NWZ_NVP_INVALID,
292 [NWZ_NVP_NCP] = 17,
293 [NWZ_NVP_NVR] = NWZ_NVP_INVALID,
294 [NWZ_NVP_PCD] = 8,
295 [NWZ_NVP_PCI] = NWZ_NVP_INVALID,
296 [NWZ_NVP_PRK] = NWZ_NVP_INVALID,
297 [NWZ_NVP_PSK] = 18,
298 [NWZ_NVP_PTS] = 77,
299 [NWZ_NVP_RBT] = NWZ_NVP_INVALID,
300 [NWZ_NVP_RND] = 27,
301 [NWZ_NVP_RTC] = 6,
302 [NWZ_NVP_SDC] = NWZ_NVP_INVALID,
303 [NWZ_NVP_SDP] = 16,
304 [NWZ_NVP_SER] = 9,
305 [NWZ_NVP_SFI] = 29,
306 [NWZ_NVP_SHE] = NWZ_NVP_INVALID,
307 [NWZ_NVP_SHP] = 12,
308 [NWZ_NVP_SID] = 83,
309 [NWZ_NVP_SKD] = 28,
310 [NWZ_NVP_SKT] = 32,
311 [NWZ_NVP_SKU] = NWZ_NVP_INVALID,
312 [NWZ_NVP_SLP] = 80,
313 [NWZ_NVP_SPS] = 69,
314 [NWZ_NVP_SYI] = 1,
315 [NWZ_NVP_TR0] = 34,
316 [NWZ_NVP_TR1] = 35,
317 [NWZ_NVP_TST] = 13,
318 [NWZ_NVP_UBP] = 2,
319 [NWZ_NVP_UFN] = 10,
320 [NWZ_NVP_UMS] = NWZ_NVP_INVALID,
321 [NWZ_NVP_UPS] = NWZ_NVP_INVALID,
322 [NWZ_NVP_VRT] = 81,
323};
324
325static int nvp_index_0ac81d[NWZ_NVP_COUNT] =
326{
327 [NWZ_NVP_APD] = 78,
328 [NWZ_NVP_APP] = 5,
329 [NWZ_NVP_BFD] = NWZ_NVP_INVALID,
330 [NWZ_NVP_BFP] = NWZ_NVP_INVALID,
331 [NWZ_NVP_BLF] = 79,
332 [NWZ_NVP_BML] = NWZ_NVP_INVALID,
333 [NWZ_NVP_BOK] = 10,
334 [NWZ_NVP_BPR] = 35,
335 [NWZ_NVP_BTC] = NWZ_NVP_INVALID,
336 [NWZ_NVP_BTI] = 1,
337 [NWZ_NVP_CGP] = NWZ_NVP_INVALID,
338 [NWZ_NVP_CLV] = 68,
339 [NWZ_NVP_CNG] = 3,
340 [NWZ_NVP_CTR] = NWZ_NVP_INVALID,
341 [NWZ_NVP_DBA] = 12,
342 [NWZ_NVP_DBG] = 0,
343 [NWZ_NVP_DBI] = NWZ_NVP_INVALID,
344 [NWZ_NVP_DBV] = 13,
345 [NWZ_NVP_DCC] = 7,
346 [NWZ_NVP_DOR] = 21,
347 [NWZ_NVP_E00] = 36,
348 [NWZ_NVP_E01] = 37,
349 [NWZ_NVP_E02] = 38,
350 [NWZ_NVP_E03] = 39,
351 [NWZ_NVP_E04] = 40,
352 [NWZ_NVP_E05] = 41,
353 [NWZ_NVP_E06] = 42,
354 [NWZ_NVP_E07] = 43,
355 [NWZ_NVP_E08] = 44,
356 [NWZ_NVP_E09] = 45,
357 [NWZ_NVP_E10] = 46,
358 [NWZ_NVP_E11] = 47,
359 [NWZ_NVP_E12] = 48,
360 [NWZ_NVP_E13] = 49,
361 [NWZ_NVP_E14] = 50,
362 [NWZ_NVP_E15] = 51,
363 [NWZ_NVP_E16] = 52,
364 [NWZ_NVP_E17] = 53,
365 [NWZ_NVP_E18] = 54,
366 [NWZ_NVP_E19] = 55,
367 [NWZ_NVP_E20] = 56,
368 [NWZ_NVP_E21] = 57,
369 [NWZ_NVP_E22] = 58,
370 [NWZ_NVP_E23] = 59,
371 [NWZ_NVP_E24] = 60,
372 [NWZ_NVP_E25] = 61,
373 [NWZ_NVP_E26] = 62,
374 [NWZ_NVP_E27] = 63,
375 [NWZ_NVP_E28] = 64,
376 [NWZ_NVP_E29] = 65,
377 [NWZ_NVP_E30] = 66,
378 [NWZ_NVP_E31] = 67,
379 [NWZ_NVP_EDW] = 22,
380 [NWZ_NVP_ERI] = 6,
381 [NWZ_NVP_EXM] = 25,
382 [NWZ_NVP_FMP] = 82,
383 [NWZ_NVP_FNI] = NWZ_NVP_INVALID,
384 [NWZ_NVP_FPI] = NWZ_NVP_INVALID,
385 [NWZ_NVP_FUI] = 19,
386 [NWZ_NVP_FUP] = 9,
387 [NWZ_NVP_FUR] = NWZ_NVP_INVALID,
388 [NWZ_NVP_FVI] = NWZ_NVP_INVALID,
389 [NWZ_NVP_GTY] = 18,
390 [NWZ_NVP_HDI] = 2,
391 [NWZ_NVP_HLD] = 80,
392 [NWZ_NVP_INS] = NWZ_NVP_INVALID,
393 [NWZ_NVP_IPT] = 70,
394 [NWZ_NVP_KAS] = 32,
395 [NWZ_NVP_LBI] = 20,
396 [NWZ_NVP_LYR] = NWZ_NVP_INVALID,
397 [NWZ_NVP_MAC] = 77,
398 [NWZ_NVP_MCR] = NWZ_NVP_INVALID,
399 [NWZ_NVP_MDK] = NWZ_NVP_INVALID,
400 [NWZ_NVP_MDL] = 8,
401 [NWZ_NVP_MID] = 16,
402 [NWZ_NVP_MLK] = NWZ_NVP_INVALID,
403 [NWZ_NVP_MSC] = 84,
404 [NWZ_NVP_MSO] = NWZ_NVP_INVALID,
405 [NWZ_NVP_MTM] = NWZ_NVP_INVALID,
406 [NWZ_NVP_MUK] = NWZ_NVP_INVALID,
407 [NWZ_NVP_NCP] = 31,
408 [NWZ_NVP_NVR] = NWZ_NVP_INVALID,
409 [NWZ_NVP_PCD] = 26,
410 [NWZ_NVP_PCI] = NWZ_NVP_INVALID,
411 [NWZ_NVP_PRK] = NWZ_NVP_INVALID,
412 [NWZ_NVP_PSK] = NWZ_NVP_INVALID,
413 [NWZ_NVP_PTS] = 75,
414 [NWZ_NVP_RBT] = NWZ_NVP_INVALID,
415 [NWZ_NVP_RND] = 28,
416 [NWZ_NVP_RTC] = 34,
417 [NWZ_NVP_SDC] = NWZ_NVP_INVALID,
418 [NWZ_NVP_SDP] = 30,
419 [NWZ_NVP_SER] = 4,
420 [NWZ_NVP_SFI] = NWZ_NVP_INVALID,
421 [NWZ_NVP_SHE] = NWZ_NVP_INVALID,
422 [NWZ_NVP_SHP] = 11,
423 [NWZ_NVP_SID] = NWZ_NVP_INVALID,
424 [NWZ_NVP_SKD] = 81,
425 [NWZ_NVP_SKT] = 76,
426 [NWZ_NVP_SKU] = NWZ_NVP_INVALID,
427 [NWZ_NVP_SLP] = 69,
428 [NWZ_NVP_SPS] = 83,
429 [NWZ_NVP_SYI] = 24,
430 [NWZ_NVP_TR0] = 14,
431 [NWZ_NVP_TR1] = 15,
432 [NWZ_NVP_TST] = 17,
433 [NWZ_NVP_UBP] = 23,
434 [NWZ_NVP_UFN] = 29,
435 [NWZ_NVP_UMS] = NWZ_NVP_INVALID,
436 [NWZ_NVP_UPS] = NWZ_NVP_INVALID,
437 [NWZ_NVP_VRT] = NWZ_NVP_INVALID,
438};
439
440static int nvp_index_f505c8[NWZ_NVP_COUNT] =
441{
442 [NWZ_NVP_APD] = 78,
443 [NWZ_NVP_APP] = 5,
444 [NWZ_NVP_BFD] = 88,
445 [NWZ_NVP_BFP] = 89,
446 [NWZ_NVP_BLF] = 79,
447 [NWZ_NVP_BML] = 87,
448 [NWZ_NVP_BOK] = 10,
449 [NWZ_NVP_BPR] = 35,
450 [NWZ_NVP_BTC] = 27,
451 [NWZ_NVP_BTI] = 1,
452 [NWZ_NVP_CGP] = NWZ_NVP_INVALID,
453 [NWZ_NVP_CLV] = 68,
454 [NWZ_NVP_CNG] = 3,
455 [NWZ_NVP_CTR] = NWZ_NVP_INVALID,
456 [NWZ_NVP_DBA] = 12,
457 [NWZ_NVP_DBG] = 0,
458 [NWZ_NVP_DBI] = NWZ_NVP_INVALID,
459 [NWZ_NVP_DBV] = 13,
460 [NWZ_NVP_DCC] = 7,
461 [NWZ_NVP_DOR] = 21,
462 [NWZ_NVP_E00] = 36,
463 [NWZ_NVP_E01] = 37,
464 [NWZ_NVP_E02] = 38,
465 [NWZ_NVP_E03] = 39,
466 [NWZ_NVP_E04] = 40,
467 [NWZ_NVP_E05] = 41,
468 [NWZ_NVP_E06] = 42,
469 [NWZ_NVP_E07] = 43,
470 [NWZ_NVP_E08] = 44,
471 [NWZ_NVP_E09] = 45,
472 [NWZ_NVP_E10] = 46,
473 [NWZ_NVP_E11] = 47,
474 [NWZ_NVP_E12] = 48,
475 [NWZ_NVP_E13] = 49,
476 [NWZ_NVP_E14] = 50,
477 [NWZ_NVP_E15] = 51,
478 [NWZ_NVP_E16] = 52,
479 [NWZ_NVP_E17] = 53,
480 [NWZ_NVP_E18] = 54,
481 [NWZ_NVP_E19] = 55,
482 [NWZ_NVP_E20] = 56,
483 [NWZ_NVP_E21] = 57,
484 [NWZ_NVP_E22] = 58,
485 [NWZ_NVP_E23] = 59,
486 [NWZ_NVP_E24] = 60,
487 [NWZ_NVP_E25] = 61,
488 [NWZ_NVP_E26] = 62,
489 [NWZ_NVP_E27] = 63,
490 [NWZ_NVP_E28] = 64,
491 [NWZ_NVP_E29] = 65,
492 [NWZ_NVP_E30] = 66,
493 [NWZ_NVP_E31] = 67,
494 [NWZ_NVP_EDW] = 22,
495 [NWZ_NVP_ERI] = 6,
496 [NWZ_NVP_EXM] = 25,
497 [NWZ_NVP_FMP] = 82,
498 [NWZ_NVP_FNI] = NWZ_NVP_INVALID,
499 [NWZ_NVP_FPI] = NWZ_NVP_INVALID,
500 [NWZ_NVP_FUI] = 19,
501 [NWZ_NVP_FUP] = 9,
502 [NWZ_NVP_FUR] = NWZ_NVP_INVALID,
503 [NWZ_NVP_FVI] = NWZ_NVP_INVALID,
504 [NWZ_NVP_GTY] = 18,
505 [NWZ_NVP_HDI] = 2,
506 [NWZ_NVP_HLD] = 80,
507 [NWZ_NVP_INS] = NWZ_NVP_INVALID,
508 [NWZ_NVP_IPT] = 70,
509 [NWZ_NVP_KAS] = 32,
510 [NWZ_NVP_LBI] = 20,
511 [NWZ_NVP_LYR] = NWZ_NVP_INVALID,
512 [NWZ_NVP_MAC] = 77,
513 [NWZ_NVP_MCR] = 72,
514 [NWZ_NVP_MDK] = 73,
515 [NWZ_NVP_MDL] = 8,
516 [NWZ_NVP_MID] = 16,
517 [NWZ_NVP_MLK] = NWZ_NVP_INVALID,
518 [NWZ_NVP_MSC] = 84,
519 [NWZ_NVP_MSO] = NWZ_NVP_INVALID,
520 [NWZ_NVP_MTM] = 71,
521 [NWZ_NVP_MUK] = 74,
522 [NWZ_NVP_NCP] = 31,
523 [NWZ_NVP_NVR] = NWZ_NVP_INVALID,
524 [NWZ_NVP_PCD] = 26,
525 [NWZ_NVP_PCI] = NWZ_NVP_INVALID,
526 [NWZ_NVP_PRK] = NWZ_NVP_INVALID,
527 [NWZ_NVP_PSK] = 86,
528 [NWZ_NVP_PTS] = 75,
529 [NWZ_NVP_RBT] = NWZ_NVP_INVALID,
530 [NWZ_NVP_RND] = 28,
531 [NWZ_NVP_RTC] = 34,
532 [NWZ_NVP_SDC] = NWZ_NVP_INVALID,
533 [NWZ_NVP_SDP] = 30,
534 [NWZ_NVP_SER] = 4,
535 [NWZ_NVP_SFI] = 33,
536 [NWZ_NVP_SHE] = NWZ_NVP_INVALID,
537 [NWZ_NVP_SHP] = 11,
538 [NWZ_NVP_SID] = NWZ_NVP_INVALID,
539 [NWZ_NVP_SKD] = 81,
540 [NWZ_NVP_SKT] = 76,
541 [NWZ_NVP_SKU] = NWZ_NVP_INVALID,
542 [NWZ_NVP_SLP] = 69,
543 [NWZ_NVP_SPS] = 83,
544 [NWZ_NVP_SYI] = 24,
545 [NWZ_NVP_TR0] = 14,
546 [NWZ_NVP_TR1] = 15,
547 [NWZ_NVP_TST] = 17,
548 [NWZ_NVP_UBP] = 23,
549 [NWZ_NVP_UFN] = 29,
550 [NWZ_NVP_UMS] = NWZ_NVP_INVALID,
551 [NWZ_NVP_UPS] = NWZ_NVP_INVALID,
552 [NWZ_NVP_VRT] = 85,
553};
554
555static int nvp_index_398250[NWZ_NVP_COUNT] =
556{
557 [NWZ_NVP_APD] = 78,
558 [NWZ_NVP_APP] = NWZ_NVP_INVALID,
559 [NWZ_NVP_BFD] = 21,
560 [NWZ_NVP_BFP] = 20,
561 [NWZ_NVP_BLF] = 79,
562 [NWZ_NVP_BML] = 22,
563 [NWZ_NVP_BOK] = NWZ_NVP_INVALID,
564 [NWZ_NVP_BPR] = 19,
565 [NWZ_NVP_BTC] = 85,
566 [NWZ_NVP_BTI] = 72,
567 [NWZ_NVP_CGP] = NWZ_NVP_INVALID,
568 [NWZ_NVP_CLV] = 68,
569 [NWZ_NVP_CNG] = 23,
570 [NWZ_NVP_CTR] = 90,
571 [NWZ_NVP_DBA] = NWZ_NVP_INVALID,
572 [NWZ_NVP_DBG] = 0,
573 [NWZ_NVP_DBI] = 88,
574 [NWZ_NVP_DBV] = 25,
575 [NWZ_NVP_DCC] = NWZ_NVP_INVALID,
576 [NWZ_NVP_DOR] = NWZ_NVP_INVALID,
577 [NWZ_NVP_E00] = 36,
578 [NWZ_NVP_E01] = 37,
579 [NWZ_NVP_E02] = 38,
580 [NWZ_NVP_E03] = 39,
581 [NWZ_NVP_E04] = 40,
582 [NWZ_NVP_E05] = 41,
583 [NWZ_NVP_E06] = 42,
584 [NWZ_NVP_E07] = 43,
585 [NWZ_NVP_E08] = 44,
586 [NWZ_NVP_E09] = 45,
587 [NWZ_NVP_E10] = 46,
588 [NWZ_NVP_E11] = 47,
589 [NWZ_NVP_E12] = 48,
590 [NWZ_NVP_E13] = 49,
591 [NWZ_NVP_E14] = 50,
592 [NWZ_NVP_E15] = 51,
593 [NWZ_NVP_E16] = 52,
594 [NWZ_NVP_E17] = 53,
595 [NWZ_NVP_E18] = 54,
596 [NWZ_NVP_E19] = 55,
597 [NWZ_NVP_E20] = 56,
598 [NWZ_NVP_E21] = 57,
599 [NWZ_NVP_E22] = 58,
600 [NWZ_NVP_E23] = 59,
601 [NWZ_NVP_E24] = 60,
602 [NWZ_NVP_E25] = 61,
603 [NWZ_NVP_E26] = 62,
604 [NWZ_NVP_E27] = 63,
605 [NWZ_NVP_E28] = 64,
606 [NWZ_NVP_E29] = 65,
607 [NWZ_NVP_E30] = 66,
608 [NWZ_NVP_E31] = 67,
609 [NWZ_NVP_EDW] = 71,
610 [NWZ_NVP_ERI] = 76,
611 [NWZ_NVP_EXM] = NWZ_NVP_INVALID,
612 [NWZ_NVP_FMP] = 15,
613 [NWZ_NVP_FNI] = 82,
614 [NWZ_NVP_FPI] = 33,
615 [NWZ_NVP_FUI] = 75,
616 [NWZ_NVP_FUP] = 3,
617 [NWZ_NVP_FUR] = 26,
618 [NWZ_NVP_FVI] = 31,
619 [NWZ_NVP_GTY] = 14,
620 [NWZ_NVP_HDI] = 73,
621 [NWZ_NVP_HLD] = 5,
622 [NWZ_NVP_INS] = 89,
623 [NWZ_NVP_IPT] = NWZ_NVP_INVALID,
624 [NWZ_NVP_KAS] = 11,
625 [NWZ_NVP_LBI] = 74,
626 [NWZ_NVP_LYR] = 24,
627 [NWZ_NVP_MAC] = 32,
628 [NWZ_NVP_MCR] = NWZ_NVP_INVALID,
629 [NWZ_NVP_MDK] = 30,
630 [NWZ_NVP_MDL] = NWZ_NVP_INVALID,
631 [NWZ_NVP_MID] = 7,
632 [NWZ_NVP_MLK] = NWZ_NVP_INVALID,
633 [NWZ_NVP_MSC] = NWZ_NVP_INVALID,
634 [NWZ_NVP_MSO] = 86,
635 [NWZ_NVP_MTM] = NWZ_NVP_INVALID,
636 [NWZ_NVP_MUK] = NWZ_NVP_INVALID,
637 [NWZ_NVP_NCP] = 17,
638 [NWZ_NVP_NVR] = 77,
639 [NWZ_NVP_PCD] = 8,
640 [NWZ_NVP_PCI] = 87,
641 [NWZ_NVP_PRK] = 4,
642 [NWZ_NVP_PSK] = 18,
643 [NWZ_NVP_PTS] = NWZ_NVP_INVALID,
644 [NWZ_NVP_RBT] = 70,
645 [NWZ_NVP_RND] = NWZ_NVP_INVALID,
646 [NWZ_NVP_RTC] = 6,
647 [NWZ_NVP_SDC] = NWZ_NVP_INVALID,
648 [NWZ_NVP_SDP] = 16,
649 [NWZ_NVP_SER] = 9,
650 [NWZ_NVP_SFI] = NWZ_NVP_INVALID,
651 [NWZ_NVP_SHE] = 84,
652 [NWZ_NVP_SHP] = 12,
653 [NWZ_NVP_SID] = 83,
654 [NWZ_NVP_SKD] = 28,
655 [NWZ_NVP_SKT] = NWZ_NVP_INVALID,
656 [NWZ_NVP_SKU] = 91,
657 [NWZ_NVP_SLP] = 80,
658 [NWZ_NVP_SPS] = 69,
659 [NWZ_NVP_SYI] = 1,
660 [NWZ_NVP_TR0] = 34,
661 [NWZ_NVP_TR1] = 35,
662 [NWZ_NVP_TST] = 13,
663 [NWZ_NVP_UBP] = 2,
664 [NWZ_NVP_UFN] = 10,
665 [NWZ_NVP_UMS] = 27,
666 [NWZ_NVP_UPS] = 29,
667 [NWZ_NVP_VRT] = 81,
668};
669
670static int nvp_index_6485c8[NWZ_NVP_COUNT] =
671{
672 [NWZ_NVP_APD] = 78,
673 [NWZ_NVP_APP] = NWZ_NVP_INVALID,
674 [NWZ_NVP_BFD] = 21,
675 [NWZ_NVP_BFP] = 20,
676 [NWZ_NVP_BLF] = 79,
677 [NWZ_NVP_BML] = 22,
678 [NWZ_NVP_BOK] = 4,
679 [NWZ_NVP_BPR] = 19,
680 [NWZ_NVP_BTC] = 85,
681 [NWZ_NVP_BTI] = 72,
682 [NWZ_NVP_CGP] = NWZ_NVP_INVALID,
683 [NWZ_NVP_CLV] = 68,
684 [NWZ_NVP_CNG] = 23,
685 [NWZ_NVP_CTR] = NWZ_NVP_INVALID,
686 [NWZ_NVP_DBA] = 24,
687 [NWZ_NVP_DBG] = 0,
688 [NWZ_NVP_DBI] = 88,
689 [NWZ_NVP_DBV] = 25,
690 [NWZ_NVP_DCC] = 31,
691 [NWZ_NVP_DOR] = 26,
692 [NWZ_NVP_E00] = 36,
693 [NWZ_NVP_E01] = 37,
694 [NWZ_NVP_E02] = 38,
695 [NWZ_NVP_E03] = 39,
696 [NWZ_NVP_E04] = 40,
697 [NWZ_NVP_E05] = 41,
698 [NWZ_NVP_E06] = 42,
699 [NWZ_NVP_E07] = 43,
700 [NWZ_NVP_E08] = 44,
701 [NWZ_NVP_E09] = 45,
702 [NWZ_NVP_E10] = 46,
703 [NWZ_NVP_E11] = 47,
704 [NWZ_NVP_E12] = 48,
705 [NWZ_NVP_E13] = 49,
706 [NWZ_NVP_E14] = 50,
707 [NWZ_NVP_E15] = 51,
708 [NWZ_NVP_E16] = 52,
709 [NWZ_NVP_E17] = 53,
710 [NWZ_NVP_E18] = 54,
711 [NWZ_NVP_E19] = 55,
712 [NWZ_NVP_E20] = 56,
713 [NWZ_NVP_E21] = 57,
714 [NWZ_NVP_E22] = 58,
715 [NWZ_NVP_E23] = 59,
716 [NWZ_NVP_E24] = 60,
717 [NWZ_NVP_E25] = 61,
718 [NWZ_NVP_E26] = 62,
719 [NWZ_NVP_E27] = 63,
720 [NWZ_NVP_E28] = 64,
721 [NWZ_NVP_E29] = 65,
722 [NWZ_NVP_E30] = 66,
723 [NWZ_NVP_E31] = 67,
724 [NWZ_NVP_EDW] = 71,
725 [NWZ_NVP_ERI] = 76,
726 [NWZ_NVP_EXM] = NWZ_NVP_INVALID,
727 [NWZ_NVP_FMP] = 15,
728 [NWZ_NVP_FNI] = 82,
729 [NWZ_NVP_FPI] = NWZ_NVP_INVALID,
730 [NWZ_NVP_FUI] = 75,
731 [NWZ_NVP_FUP] = 3,
732 [NWZ_NVP_FUR] = NWZ_NVP_INVALID,
733 [NWZ_NVP_FVI] = NWZ_NVP_INVALID,
734 [NWZ_NVP_GTY] = 14,
735 [NWZ_NVP_HDI] = 73,
736 [NWZ_NVP_HLD] = 5,
737 [NWZ_NVP_INS] = NWZ_NVP_INVALID,
738 [NWZ_NVP_IPT] = NWZ_NVP_INVALID,
739 [NWZ_NVP_KAS] = 11,
740 [NWZ_NVP_LBI] = 74,
741 [NWZ_NVP_LYR] = NWZ_NVP_INVALID,
742 [NWZ_NVP_MAC] = NWZ_NVP_INVALID,
743 [NWZ_NVP_MCR] = NWZ_NVP_INVALID,
744 [NWZ_NVP_MDK] = 30,
745 [NWZ_NVP_MDL] = 70,
746 [NWZ_NVP_MID] = 7,
747 [NWZ_NVP_MLK] = 84,
748 [NWZ_NVP_MSC] = NWZ_NVP_INVALID,
749 [NWZ_NVP_MSO] = 86,
750 [NWZ_NVP_MTM] = 33,
751 [NWZ_NVP_MUK] = NWZ_NVP_INVALID,
752 [NWZ_NVP_NCP] = 17,
753 [NWZ_NVP_NVR] = NWZ_NVP_INVALID,
754 [NWZ_NVP_PCD] = 8,
755 [NWZ_NVP_PCI] = 87,
756 [NWZ_NVP_PRK] = NWZ_NVP_INVALID,
757 [NWZ_NVP_PSK] = 18,
758 [NWZ_NVP_PTS] = 77,
759 [NWZ_NVP_RBT] = NWZ_NVP_INVALID,
760 [NWZ_NVP_RND] = 27,
761 [NWZ_NVP_RTC] = 6,
762 [NWZ_NVP_SDC] = NWZ_NVP_INVALID,
763 [NWZ_NVP_SDP] = 16,
764 [NWZ_NVP_SER] = 9,
765 [NWZ_NVP_SFI] = 29,
766 [NWZ_NVP_SHE] = NWZ_NVP_INVALID,
767 [NWZ_NVP_SHP] = 12,
768 [NWZ_NVP_SID] = 83,
769 [NWZ_NVP_SKD] = 28,
770 [NWZ_NVP_SKT] = 32,
771 [NWZ_NVP_SKU] = NWZ_NVP_INVALID,
772 [NWZ_NVP_SLP] = 80,
773 [NWZ_NVP_SPS] = 69,
774 [NWZ_NVP_SYI] = 1,
775 [NWZ_NVP_TR0] = 34,
776 [NWZ_NVP_TR1] = 35,
777 [NWZ_NVP_TST] = 13,
778 [NWZ_NVP_UBP] = 2,
779 [NWZ_NVP_UFN] = 10,
780 [NWZ_NVP_UMS] = NWZ_NVP_INVALID,
781 [NWZ_NVP_UPS] = NWZ_NVP_INVALID,
782 [NWZ_NVP_VRT] = 81,
783};
784
785static int nvp_index_92faee[NWZ_NVP_COUNT] =
786{
787 [NWZ_NVP_APD] = 78,
788 [NWZ_NVP_APP] = NWZ_NVP_INVALID,
789 [NWZ_NVP_BFD] = 21,
790 [NWZ_NVP_BFP] = 20,
791 [NWZ_NVP_BLF] = 79,
792 [NWZ_NVP_BML] = 22,
793 [NWZ_NVP_BOK] = 4,
794 [NWZ_NVP_BPR] = 19,
795 [NWZ_NVP_BTC] = 85,
796 [NWZ_NVP_BTI] = 72,
797 [NWZ_NVP_CGP] = NWZ_NVP_INVALID,
798 [NWZ_NVP_CLV] = 68,
799 [NWZ_NVP_CNG] = 23,
800 [NWZ_NVP_CTR] = NWZ_NVP_INVALID,
801 [NWZ_NVP_DBA] = 24,
802 [NWZ_NVP_DBG] = 0,
803 [NWZ_NVP_DBI] = 88,
804 [NWZ_NVP_DBV] = 25,
805 [NWZ_NVP_DCC] = 31,
806 [NWZ_NVP_DOR] = 26,
807 [NWZ_NVP_E00] = 36,
808 [NWZ_NVP_E01] = 37,
809 [NWZ_NVP_E02] = 38,
810 [NWZ_NVP_E03] = 39,
811 [NWZ_NVP_E04] = 40,
812 [NWZ_NVP_E05] = 41,
813 [NWZ_NVP_E06] = 42,
814 [NWZ_NVP_E07] = 43,
815 [NWZ_NVP_E08] = 44,
816 [NWZ_NVP_E09] = 45,
817 [NWZ_NVP_E10] = 46,
818 [NWZ_NVP_E11] = 47,
819 [NWZ_NVP_E12] = 48,
820 [NWZ_NVP_E13] = 49,
821 [NWZ_NVP_E14] = 50,
822 [NWZ_NVP_E15] = 51,
823 [NWZ_NVP_E16] = 52,
824 [NWZ_NVP_E17] = 53,
825 [NWZ_NVP_E18] = 54,
826 [NWZ_NVP_E19] = 55,
827 [NWZ_NVP_E20] = 56,
828 [NWZ_NVP_E21] = 57,
829 [NWZ_NVP_E22] = 58,
830 [NWZ_NVP_E23] = 59,
831 [NWZ_NVP_E24] = 60,
832 [NWZ_NVP_E25] = 61,
833 [NWZ_NVP_E26] = 62,
834 [NWZ_NVP_E27] = 63,
835 [NWZ_NVP_E28] = 64,
836 [NWZ_NVP_E29] = 65,
837 [NWZ_NVP_E30] = 66,
838 [NWZ_NVP_E31] = 67,
839 [NWZ_NVP_EDW] = 71,
840 [NWZ_NVP_ERI] = 76,
841 [NWZ_NVP_EXM] = NWZ_NVP_INVALID,
842 [NWZ_NVP_FMP] = 15,
843 [NWZ_NVP_FNI] = 82,
844 [NWZ_NVP_FPI] = NWZ_NVP_INVALID,
845 [NWZ_NVP_FUI] = 75,
846 [NWZ_NVP_FUP] = 3,
847 [NWZ_NVP_FUR] = NWZ_NVP_INVALID,
848 [NWZ_NVP_FVI] = NWZ_NVP_INVALID,
849 [NWZ_NVP_GTY] = 14,
850 [NWZ_NVP_HDI] = 73,
851 [NWZ_NVP_HLD] = 5,
852 [NWZ_NVP_INS] = NWZ_NVP_INVALID,
853 [NWZ_NVP_IPT] = NWZ_NVP_INVALID,
854 [NWZ_NVP_KAS] = 11,
855 [NWZ_NVP_LBI] = 74,
856 [NWZ_NVP_LYR] = NWZ_NVP_INVALID,
857 [NWZ_NVP_MAC] = NWZ_NVP_INVALID,
858 [NWZ_NVP_MCR] = NWZ_NVP_INVALID,
859 [NWZ_NVP_MDK] = 30,
860 [NWZ_NVP_MDL] = 70,
861 [NWZ_NVP_MID] = 7,
862 [NWZ_NVP_MLK] = 84,
863 [NWZ_NVP_MSC] = NWZ_NVP_INVALID,
864 [NWZ_NVP_MSO] = 86,
865 [NWZ_NVP_MTM] = 33,
866 [NWZ_NVP_MUK] = NWZ_NVP_INVALID,
867 [NWZ_NVP_NCP] = 17,
868 [NWZ_NVP_NVR] = NWZ_NVP_INVALID,
869 [NWZ_NVP_PCD] = 8,
870 [NWZ_NVP_PCI] = 87,
871 [NWZ_NVP_PRK] = NWZ_NVP_INVALID,
872 [NWZ_NVP_PSK] = 18,
873 [NWZ_NVP_PTS] = 77,
874 [NWZ_NVP_RBT] = NWZ_NVP_INVALID,
875 [NWZ_NVP_RND] = 27,
876 [NWZ_NVP_RTC] = 6,
877 [NWZ_NVP_SDC] = 89,
878 [NWZ_NVP_SDP] = 16,
879 [NWZ_NVP_SER] = 9,
880 [NWZ_NVP_SFI] = 29,
881 [NWZ_NVP_SHE] = NWZ_NVP_INVALID,
882 [NWZ_NVP_SHP] = 12,
883 [NWZ_NVP_SID] = 83,
884 [NWZ_NVP_SKD] = 28,
885 [NWZ_NVP_SKT] = 32,
886 [NWZ_NVP_SKU] = NWZ_NVP_INVALID,
887 [NWZ_NVP_SLP] = 80,
888 [NWZ_NVP_SPS] = 69,
889 [NWZ_NVP_SYI] = 1,
890 [NWZ_NVP_TR0] = 34,
891 [NWZ_NVP_TR1] = 35,
892 [NWZ_NVP_TST] = 13,
893 [NWZ_NVP_UBP] = 2,
894 [NWZ_NVP_UFN] = 10,
895 [NWZ_NVP_UMS] = NWZ_NVP_INVALID,
896 [NWZ_NVP_UPS] = NWZ_NVP_INVALID,
897 [NWZ_NVP_VRT] = 81,
898};
899
900static int nvp_index_c8fc85[NWZ_NVP_COUNT] =
901{
902 [NWZ_NVP_APD] = 78,
903 [NWZ_NVP_APP] = 5,
904 [NWZ_NVP_BFD] = 88,
905 [NWZ_NVP_BFP] = 89,
906 [NWZ_NVP_BLF] = 79,
907 [NWZ_NVP_BML] = 87,
908 [NWZ_NVP_BOK] = 10,
909 [NWZ_NVP_BPR] = 35,
910 [NWZ_NVP_BTC] = NWZ_NVP_INVALID,
911 [NWZ_NVP_BTI] = 1,
912 [NWZ_NVP_CGP] = 27,
913 [NWZ_NVP_CLV] = 68,
914 [NWZ_NVP_CNG] = 3,
915 [NWZ_NVP_CTR] = NWZ_NVP_INVALID,
916 [NWZ_NVP_DBA] = 12,
917 [NWZ_NVP_DBG] = 0,
918 [NWZ_NVP_DBI] = NWZ_NVP_INVALID,
919 [NWZ_NVP_DBV] = 13,
920 [NWZ_NVP_DCC] = 7,
921 [NWZ_NVP_DOR] = 21,
922 [NWZ_NVP_E00] = 36,
923 [NWZ_NVP_E01] = 37,
924 [NWZ_NVP_E02] = 38,
925 [NWZ_NVP_E03] = 39,
926 [NWZ_NVP_E04] = 40,
927 [NWZ_NVP_E05] = 41,
928 [NWZ_NVP_E06] = 42,
929 [NWZ_NVP_E07] = 43,
930 [NWZ_NVP_E08] = 44,
931 [NWZ_NVP_E09] = 45,
932 [NWZ_NVP_E10] = 46,
933 [NWZ_NVP_E11] = 47,
934 [NWZ_NVP_E12] = 48,
935 [NWZ_NVP_E13] = 49,
936 [NWZ_NVP_E14] = 50,
937 [NWZ_NVP_E15] = 51,
938 [NWZ_NVP_E16] = 52,
939 [NWZ_NVP_E17] = 53,
940 [NWZ_NVP_E18] = 54,
941 [NWZ_NVP_E19] = 55,
942 [NWZ_NVP_E20] = 56,
943 [NWZ_NVP_E21] = 57,
944 [NWZ_NVP_E22] = 58,
945 [NWZ_NVP_E23] = 59,
946 [NWZ_NVP_E24] = 60,
947 [NWZ_NVP_E25] = 61,
948 [NWZ_NVP_E26] = 62,
949 [NWZ_NVP_E27] = 63,
950 [NWZ_NVP_E28] = 64,
951 [NWZ_NVP_E29] = 65,
952 [NWZ_NVP_E30] = 66,
953 [NWZ_NVP_E31] = 67,
954 [NWZ_NVP_EDW] = 22,
955 [NWZ_NVP_ERI] = 6,
956 [NWZ_NVP_EXM] = 25,
957 [NWZ_NVP_FMP] = 82,
958 [NWZ_NVP_FNI] = NWZ_NVP_INVALID,
959 [NWZ_NVP_FPI] = NWZ_NVP_INVALID,
960 [NWZ_NVP_FUI] = 19,
961 [NWZ_NVP_FUP] = 9,
962 [NWZ_NVP_FUR] = NWZ_NVP_INVALID,
963 [NWZ_NVP_FVI] = NWZ_NVP_INVALID,
964 [NWZ_NVP_GTY] = 18,
965 [NWZ_NVP_HDI] = 2,
966 [NWZ_NVP_HLD] = 80,
967 [NWZ_NVP_INS] = NWZ_NVP_INVALID,
968 [NWZ_NVP_IPT] = 70,
969 [NWZ_NVP_KAS] = 32,
970 [NWZ_NVP_LBI] = 20,
971 [NWZ_NVP_LYR] = NWZ_NVP_INVALID,
972 [NWZ_NVP_MAC] = 77,
973 [NWZ_NVP_MCR] = 72,
974 [NWZ_NVP_MDK] = 73,
975 [NWZ_NVP_MDL] = 8,
976 [NWZ_NVP_MID] = 16,
977 [NWZ_NVP_MLK] = NWZ_NVP_INVALID,
978 [NWZ_NVP_MSC] = 84,
979 [NWZ_NVP_MSO] = NWZ_NVP_INVALID,
980 [NWZ_NVP_MTM] = 71,
981 [NWZ_NVP_MUK] = 74,
982 [NWZ_NVP_NCP] = 31,
983 [NWZ_NVP_NVR] = NWZ_NVP_INVALID,
984 [NWZ_NVP_PCD] = 26,
985 [NWZ_NVP_PCI] = NWZ_NVP_INVALID,
986 [NWZ_NVP_PRK] = NWZ_NVP_INVALID,
987 [NWZ_NVP_PSK] = 86,
988 [NWZ_NVP_PTS] = 75,
989 [NWZ_NVP_RBT] = NWZ_NVP_INVALID,
990 [NWZ_NVP_RND] = 28,
991 [NWZ_NVP_RTC] = 34,
992 [NWZ_NVP_SDC] = NWZ_NVP_INVALID,
993 [NWZ_NVP_SDP] = 30,
994 [NWZ_NVP_SER] = 4,
995 [NWZ_NVP_SFI] = 33,
996 [NWZ_NVP_SHE] = NWZ_NVP_INVALID,
997 [NWZ_NVP_SHP] = 11,
998 [NWZ_NVP_SID] = NWZ_NVP_INVALID,
999 [NWZ_NVP_SKD] = 81,
1000 [NWZ_NVP_SKT] = 76,
1001 [NWZ_NVP_SKU] = NWZ_NVP_INVALID,
1002 [NWZ_NVP_SLP] = 69,
1003 [NWZ_NVP_SPS] = 83,
1004 [NWZ_NVP_SYI] = 24,
1005 [NWZ_NVP_TR0] = 14,
1006 [NWZ_NVP_TR1] = 15,
1007 [NWZ_NVP_TST] = 17,
1008 [NWZ_NVP_UBP] = 23,
1009 [NWZ_NVP_UFN] = 29,
1010 [NWZ_NVP_UMS] = NWZ_NVP_INVALID,
1011 [NWZ_NVP_UPS] = NWZ_NVP_INVALID,
1012 [NWZ_NVP_VRT] = 85,
1013};
1014
1015struct nwz_nvp_info_t nwz_nvp[NWZ_NVP_COUNT] =
1016{
1017 [NWZ_NVP_APD] = { "apd", 4, "application debug mode flag" },
1018 [NWZ_NVP_APP] = { "app", 4096, "application parameter" },
1019 [NWZ_NVP_BFD] = { "bfd", 512, "btmw factory scdb" },
1020 [NWZ_NVP_BFP] = { "bfp", 512, "btmw factory pair info" },
1021 [NWZ_NVP_BLF] = { "blf", 4, "browser log mode flag" },
1022 [NWZ_NVP_BML] = { "bml", 4, "btmw log mode flag" },
1023 [NWZ_NVP_BOK] = { "bok", 4, "beep ok flag" },
1024 [NWZ_NVP_BPR] = { "bpr", 2048, "bluetooth address | bluetooth parameter" },
1025 [NWZ_NVP_BTC] = { "btc", 4, "battery calibration" },
1026 [NWZ_NVP_BTI] = { "bti", 262144, "boot image" },
1027 [NWZ_NVP_CGP] = { "cgp", 0, "" },
1028 [NWZ_NVP_CLV] = { "clv", 4, "color variation" },
1029 [NWZ_NVP_CNG] = { "cng", 704, "aad/empr key | aad key" },
1030 [NWZ_NVP_CTR] = { "ctr", 0, "" },
1031 [NWZ_NVP_DBA] = { "dba", 160, "aad icv" },
1032 [NWZ_NVP_DBG] = { "dbg", 0, "" },
1033 [NWZ_NVP_DBI] = { "dbi", 262144, "dead battery image" },
1034 [NWZ_NVP_DBV] = { "dbv", 520, "empr icv | empr key" },
1035 [NWZ_NVP_DCC] = { "dcc", 20, "secure clock" },
1036 [NWZ_NVP_DOR] = { "dor", 4, "key mode (debug/release)" },
1037 [NWZ_NVP_E00] = { "e00", 1024, "EMPR 0" },
1038 [NWZ_NVP_E01] = { "e01", 1024, "EMPR 1" },
1039 [NWZ_NVP_E02] = { "e02", 1024, "EMPR 2" },
1040 [NWZ_NVP_E03] = { "e03", 1024, "EMPR 3" },
1041 [NWZ_NVP_E04] = { "e04", 1024, "EMPR 4" },
1042 [NWZ_NVP_E05] = { "e05", 1024, "EMPR 5" },
1043 [NWZ_NVP_E06] = { "e06", 1024, "EMPR 6" },
1044 [NWZ_NVP_E07] = { "e07", 1024, "EMPR 7" },
1045 [NWZ_NVP_E08] = { "e08", 1024, "EMPR 8" },
1046 [NWZ_NVP_E09] = { "e09", 1024, "EMPR 9" },
1047 [NWZ_NVP_E10] = { "e10", 1024, "EMPR 10" },
1048 [NWZ_NVP_E11] = { "e11", 1024, "EMPR 11" },
1049 [NWZ_NVP_E12] = { "e12", 1024, "EMPR 12" },
1050 [NWZ_NVP_E13] = { "e13", 1024, "EMPR 13" },
1051 [NWZ_NVP_E14] = { "e14", 1024, "EMPR 14" },
1052 [NWZ_NVP_E15] = { "e15", 1024, "EMPR 15" },
1053 [NWZ_NVP_E16] = { "e16", 1024, "EMPR 16" },
1054 [NWZ_NVP_E17] = { "e17", 1024, "EMPR 17" },
1055 [NWZ_NVP_E18] = { "e18", 1024, "EMPR 18" },
1056 [NWZ_NVP_E19] = { "e19", 1024, "EMPR 19" },
1057 [NWZ_NVP_E20] = { "e20", 1024, "EMPR 20" },
1058 [NWZ_NVP_E21] = { "e21", 1024, "EMPR 21" },
1059 [NWZ_NVP_E22] = { "e22", 1024, "EMPR 22" },
1060 [NWZ_NVP_E23] = { "e23", 1024, "EMPR 23" },
1061 [NWZ_NVP_E24] = { "e24", 1024, "EMPR 24" },
1062 [NWZ_NVP_E25] = { "e25", 1024, "EMPR 25" },
1063 [NWZ_NVP_E26] = { "e26", 1024, "EMPR 26" },
1064 [NWZ_NVP_E27] = { "e27", 1024, "EMPR 27" },
1065 [NWZ_NVP_E28] = { "e28", 1024, "EMPR 28" },
1066 [NWZ_NVP_E29] = { "e29", 1024, "EMPR 29" },
1067 [NWZ_NVP_E30] = { "e30", 1024, "EMPR 30" },
1068 [NWZ_NVP_E31] = { "e31", 1024, "EMPR 31" },
1069 [NWZ_NVP_EDW] = { "edw", 4, "quick shutdown flag" },
1070 [NWZ_NVP_ERI] = { "eri", 262144, "update error image" },
1071 [NWZ_NVP_EXM] = { "exm", 4, "exception monitor mode" },
1072 [NWZ_NVP_FMP] = { "fmp", 16, "fm parameter" },
1073 [NWZ_NVP_FNI] = { "fni", 4, "function information" },
1074 [NWZ_NVP_FPI] = { "fpi", 0, "" },
1075 [NWZ_NVP_FUI] = { "fui", 262144, "update image" },
1076 [NWZ_NVP_FUP] = { "fup", 4, "firmware update flag" },
1077 [NWZ_NVP_FUR] = { "fur", 0, "" },
1078 [NWZ_NVP_FVI] = { "fvi", 0, "" },
1079 [NWZ_NVP_GTY] = { "gty", 4, "getty mode flag" },
1080 [NWZ_NVP_HDI] = { "hdi", 262144, "hold image" },
1081 [NWZ_NVP_HLD] = { "hld", 4, "hold mode" },
1082 [NWZ_NVP_INS] = { "ins", 0, "" },
1083 [NWZ_NVP_IPT] = { "ipt", 4, "disable iptable flag" },
1084 [NWZ_NVP_KAS] = { "kas", 64, "key and signature" },
1085 [NWZ_NVP_LBI] = { "lbi", 262144, "low battery image" },
1086 [NWZ_NVP_LYR] = { "lyr", 0, "" },
1087 [NWZ_NVP_MAC] = { "mac", 6, "wifi mac address" },
1088 [NWZ_NVP_MCR] = { "mcr", 16384, "marlin crl" },
1089 [NWZ_NVP_MDK] = { "mdk", 33024, "marlin device key" },
1090 [NWZ_NVP_MDL] = { "mdl", 8, "middleware parameter" },
1091 [NWZ_NVP_MID] = { "mid", 64, "model id" },
1092 [NWZ_NVP_MLK] = { "mlk", 4, "marlin key" },
1093 [NWZ_NVP_MSC] = { "msc", 4, "mass storage class mode" },
1094 [NWZ_NVP_MSO] = { "mso", 4, "MSC only mode flag" },
1095 [NWZ_NVP_MTM] = { "mtm", 64, "marlin time" },
1096 [NWZ_NVP_MUK] = { "muk", 24576, "marlin user key" },
1097 [NWZ_NVP_NCP] = { "ncp", 64, "noise cancel driver parameter" },
1098 [NWZ_NVP_NVR] = { "nvr", 0, "" },
1099 [NWZ_NVP_PCD] = { "pcd", 5, "product code" },
1100 [NWZ_NVP_PCI] = { "pci", 262144, "precharge image" },
1101 [NWZ_NVP_PRK] = { "prk", 0, "" },
1102 [NWZ_NVP_PSK] = { "psk", 512, "bluetooth pskey" },
1103 [NWZ_NVP_PTS] = { "pts", 4, "wifi protected setup" },
1104 [NWZ_NVP_RBT] = { "rbt", 0, "" },
1105 [NWZ_NVP_RND] = { "rnd", 64, "wmt key | random data" },
1106 [NWZ_NVP_RTC] = { "rtc", 16, "rtc alarm" },
1107 [NWZ_NVP_SDC] = { "sdc", 4, "SD Card export flag" },
1108 [NWZ_NVP_SDP] = { "sdp", 64, "sound driver parameter" },
1109 [NWZ_NVP_SER] = { "ser", 16, "serial number" },
1110 [NWZ_NVP_SFI] = { "sfi", 64, "starfish id" },
1111 [NWZ_NVP_SHE] = { "she", 0, "" },
1112 [NWZ_NVP_SHP] = { "shp", 32, "ship information" },
1113 [NWZ_NVP_SID] = { "sid", 4, "service id" },
1114 [NWZ_NVP_SKD] = { "skd", 8224, "slacker id file" },
1115 [NWZ_NVP_SKT] = { "skt", 16, "slacker time" },
1116 [NWZ_NVP_SKU] = { "sku", 0, "" },
1117 [NWZ_NVP_SLP] = { "slp", 4, "time out to sleep" },
1118 [NWZ_NVP_SPS] = { "sps", 4, "speaker ship info" },
1119 [NWZ_NVP_SYI] = { "syi", 4, "system information" },
1120 [NWZ_NVP_TR0] = { "tr0", 16384, "EKB 0" },
1121 [NWZ_NVP_TR1] = { "tr1", 16384, "EKB 1" },
1122 [NWZ_NVP_TST] = { "tst", 4, "test mode flag" },
1123 [NWZ_NVP_UBP] = { "ubp", 32, "u-boot password" },
1124 [NWZ_NVP_UFN] = { "ufn", 8, "update file name" },
1125 [NWZ_NVP_UMS] = { "ums", 0, "" },
1126 [NWZ_NVP_UPS] = { "ups", 0, "" },
1127 [NWZ_NVP_VRT] = { "vrt", 4, "europe vol regulation flag" },
1128};
1129
1130static unsigned long models_nwz_a10[] = { 0x1a000001, 0x1a000002, 0x1a000004,
1131 0x1a000005, 0x1a000006, 0x1a010001, 0x1a010002, 0x1a010004, 0x1a010005,
1132 0x1a010006 };
1133
1134static unsigned long models_nwz_a20[] = { 0x1d000001, 0x1d000002, 0x1d000004,
1135 0x1d000005, 0x1d000006, 0x1d000007 };
1136
1137static unsigned long models_nw_a30[] = { };
1138
1139static unsigned long models_nwz_a720[] = { 0x3030001, 0x3030002, 0x3030004,
1140 0x3020001, 0x3020002, 0x3020004 };
1141
1142static unsigned long models_nwz_a810[] = { 0x10000, 0x10001, 0x10002 };
1143
1144static unsigned long models_nwz_a820[] = { 0x3010001, 0x3010002, 0x3010004,
1145 0x3000001, 0x3000002, 0x3000004 };
1146
1147static unsigned long models_nwz_a840[] = { 0x7010004, 0x7010005, 0x7010006,
1148 0x7000004, 0x7000005, 0x7000006 };
1149
1150static unsigned long models_nwz_a850[] = { 0xe000004, 0xe000005, 0xe000006 };
1151
1152static unsigned long models_nwz_a860[] = { 0x11000001, 0x11000002, 0x11000004,
1153 0x11000005, 0x11000006, 0x11010001, 0x11010002, 0x11010004, 0x11010005,
1154 0x11010006, 0x11020001, 0x11020002, 0x11020004, 0x11020005, 0x11020006 };
1155
1156static unsigned long models_nw_a910[] = { 0x2000001, 0x2000002, 0x2000004 };
1157
1158static unsigned long models_nwz_e050[] = { 0x8000000, 0x8000001, 0x8000002,
1159 0x10000000, 0x10000001 };
1160
1161static unsigned long models_nw_e060[] = { 0x14000000, 0x14000001, 0x14000002,
1162 0x14000004, 0x14000005 };
1163
1164static unsigned long models_nw_e080[] = { 0x19010001, 0x19010002, 0x19010004,
1165 0x19010005 };
1166
1167static unsigned long models_nwz_e350[] = { 0xc000001, 0xc000002, 0xc000004 };
1168
1169static unsigned long models_nwz_e450[] = { 0xb000001, 0xb000002, 0xb000004 };
1170
1171static unsigned long models_nwz_e460[] = { 0x13000001, 0x13000002, 0x13000004 };
1172
1173static unsigned long models_nwz_e470[] = { 0x15000001, 0x15000002, 0x15000004,
1174 0x15000005 };
1175
1176static unsigned long models_nwz_e550[] = { 0xd000001, 0xd000002, 0xd000004,
1177 0xd000005 };
1178
1179static unsigned long models_nwz_e570[] = { 0x15010001, 0x15010002, 0x15010004,
1180 0x15010005 };
1181
1182static unsigned long models_nwz_e580[] = { 0x19020001, 0x19020002, 0x19020004,
1183 0x19020005 };
1184
1185static unsigned long models_nw_s10[] = { 0x1b000001, 0x1b000002, 0x1b000004,
1186 0x1b000005, 0x1b000006 };
1187
1188static unsigned long models_nwz_s510[] = { 0x1030000, 0x1030001 };
1189
1190static unsigned long models_nwz_s610[] = { 0x1000000, 0x1000001, 0x1020000,
1191 0x1020001, 0x1020002 };
1192
1193static unsigned long models_nwz_s630[] = { 0x4000001, 0x4000002, 0x4000004,
1194 0x4020001, 0x4020002, 0x4020004 };
1195
1196static unsigned long models_nw_s640[] = { 0x6010002, 0x6010004, 0x6010005 };
1197
1198static unsigned long models_nwz_s710[] = { 0x1010000, 0x1010001, 0x1010002,
1199 0x1040000, 0x1040001, 0x1040002 };
1200
1201static unsigned long models_nwz_s730[] = { 0x4010001, 0x4010002, 0x4010004,
1202 0x4030001, 0x4030002, 0x4030004 };
1203
1204static unsigned long models_nwz_s740[] = { 0x6030002, 0x6030004, 0x6030005,
1205 0x6020002, 0x6020004, 0x6020005 };
1206
1207static unsigned long models_nwz_s750[] = { 0x9000002, 0x9000004, 0x9000005,
1208 0xf000002, 0xf000004 };
1209
1210static unsigned long models_nwz_s760[] = { 0x12000001, 0x12000002, 0x12000004,
1211 0x12000005, 0x12000006, 0x12010001, 0x12010002, 0x12010004, 0x12010005,
1212 0x12010006 };
1213
1214static unsigned long models_nwz_s770[] = { 0x16000001, 0x16000002, 0x16000004,
1215 0x16000005, 0x16010001, 0x16010002, 0x16010004, 0x16010005 };
1216
1217static unsigned long models_nw_s780[] = { 0x19000001, 0x19000002, 0x19000004,
1218 0x19000005 };
1219
1220static unsigned long models_nwz_x1000[] = { 0x5000002, 0x5000004, 0x5000005,
1221 0x5020002, 0x5040002, 0x5020004, 0x5040004, 0x5020005, 0x5040005 };
1222
1223static unsigned long models_nw_zx100[] = { 0x1c000007, 0x1c000001, 0x1c000002,
1224 0x1c000004, 0x1c000005, 0x1c000006 };
1225
1226static unsigned long models_nwz_zx2[] = { };
1227
1228static unsigned long models_nwz_noname[] = { 0x5010002, 0x5010004, 0x5010005 };
1229
1230struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT] =
1231{
1232 { "nwz-a10", "NWZ-A10 Series", 10, models_nwz_a10, &nvp_index_92faee },
1233 { "nwz-a20", "NW-A20 Series", 6, models_nwz_a20, &nvp_index_92faee },
1234 { "nw-a30", "NW-A30 Series", 0, models_nw_a30, &nvp_index_398250 },
1235 { "nwz-a720", "NWZ-A720 Series", 6, models_nwz_a720, 0 },
1236 { "nwz-a810", "NWZ-A810 Series", 3, models_nwz_a810, 0 },
1237 { "nwz-a820", "NWZ-A820 Series", 6, models_nwz_a820, 0 },
1238 { "nwz-a840", "NWZ-A840 Series", 6, models_nwz_a840, 0 },
1239 { "nwz-a850", "NWZ-A850 Series", 3, models_nwz_a850, &nvp_index_0ac81d },
1240 { "nwz-a860", "NWZ-A860 Series", 15, models_nwz_a860, &nvp_index_f505c8 },
1241 { "nw-a910", "NW-A910 Series", 3, models_nw_a910, 0 },
1242 { "nwz-e050", "NWZ-E050 Series", 5, models_nwz_e050, 0 },
1243 { "nw-e060", "NW-E060 Series", 5, models_nw_e060, &nvp_index_f505c8 },
1244 { "nw-e080", "NW-E080 Series", 4, models_nw_e080, &nvp_index_6485c8 },
1245 { "nwz-e350", "NWZ-E350 Series", 3, models_nwz_e350, &nvp_index_0ac81d },
1246 { "nwz-e450", "NWZ-E450 Series", 3, models_nwz_e450, &nvp_index_0ac81d },
1247 { "nwz-e460", "NWZ-E460 Series", 3, models_nwz_e460, &nvp_index_f505c8 },
1248 { "nwz-e470", "NWZ-E470 Series", 4, models_nwz_e470, &nvp_index_28dc2c },
1249 { "nwz-e550", "NWZ-E550 Series", 4, models_nwz_e550, 0 },
1250 { "nwz-e570", "NWZ-E570 Series", 4, models_nwz_e570, 0 },
1251 { "nwz-e580", "NWZ-E580 Series", 4, models_nwz_e580, &nvp_index_6485c8 },
1252 { "nw-s10", "NW-S10 Series", 5, models_nw_s10, 0 },
1253 { "nwz-s510", "NWZ-S510 Series", 2, models_nwz_s510, 0 },
1254 { "nwz-s610", "NWZ-S610 Series", 5, models_nwz_s610, 0 },
1255 { "nwz-s630", "NWZ-S630 Series", 6, models_nwz_s630, 0 },
1256 { "nw-s640", "NW-S640 Series", 3, models_nw_s640, 0 },
1257 { "nwz-s710", "NWZ-S710 Series", 6, models_nwz_s710, 0 },
1258 { "nwz-s730", "NWZ-S730 Series", 6, models_nwz_s730, 0 },
1259 { "nwz-s740", "NWZ-S740 Series", 6, models_nwz_s740, 0 },
1260 { "nwz-s750", "NWZ-S740 Series", 5, models_nwz_s750, 0 },
1261 { "nwz-s760", "NWZ-S740 Series", 10, models_nwz_s760, &nvp_index_f505c8 },
1262 { "nwz-s770", "NWZ-S770 Series", 8, models_nwz_s770, 0 },
1263 { "nw-s780", "NW-S780 Series", 4, models_nw_s780, &nvp_index_6485c8 },
1264 { "nwz-x1000", "NWZ-X1000 Series", 9, models_nwz_x1000, 0 },
1265 { "nw-zx100", "NW-ZX100 Series", 6, models_nw_zx100, 0 },
1266 { "nwz-zx2", "NW-ZX2", 0, models_nwz_zx2, &nvp_index_c8fc85 },
1267 { "nwz-noname", "NONAME", 3, models_nwz_noname, 0 },
1268};
diff --git a/utils/nwztools/database/nwz_db.h b/utils/nwztools/database/nwz_db.h
new file mode 100644
index 0000000000..95aff48afa
--- /dev/null
+++ b/utils/nwztools/database/nwz_db.h
@@ -0,0 +1,185 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2016 Amaury Pouly
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ****************************************************************************/
20#ifndef __NWZ_DB_H__
21#define __NWZ_DB_H__
22
23/** /!\ This file was automatically generated, DO NOT MODIFY IT DIRECTLY /!\ */
24
25/* List of all known NVP nodes */
26enum nwz_nvp_node_t
27{
28 NWZ_NVP_APD, /* application debug mode flag */
29 NWZ_NVP_APP, /* application parameter */
30 NWZ_NVP_BFD, /* btmw factory scdb */
31 NWZ_NVP_BFP, /* btmw factory pair info */
32 NWZ_NVP_BLF, /* browser log mode flag */
33 NWZ_NVP_BML, /* btmw log mode flag */
34 NWZ_NVP_BOK, /* beep ok flag */
35 NWZ_NVP_BPR, /* bluetooth address | bluetooth parameter */
36 NWZ_NVP_BTC, /* battery calibration */
37 NWZ_NVP_BTI, /* boot image */
38 NWZ_NVP_CGP, /* */
39 NWZ_NVP_CLV, /* color variation */
40 NWZ_NVP_CNG, /* aad/empr key | aad key */
41 NWZ_NVP_CTR, /* */
42 NWZ_NVP_DBA, /* aad icv */
43 NWZ_NVP_DBG, /* */
44 NWZ_NVP_DBI, /* dead battery image */
45 NWZ_NVP_DBV, /* empr icv | empr key */
46 NWZ_NVP_DCC, /* secure clock */
47 NWZ_NVP_DOR, /* key mode (debug/release) */
48 NWZ_NVP_E00, /* EMPR 0 */
49 NWZ_NVP_E01, /* EMPR 1 */
50 NWZ_NVP_E02, /* EMPR 2 */
51 NWZ_NVP_E03, /* EMPR 3 */
52 NWZ_NVP_E04, /* EMPR 4 */
53 NWZ_NVP_E05, /* EMPR 5 */
54 NWZ_NVP_E06, /* EMPR 6 */
55 NWZ_NVP_E07, /* EMPR 7 */
56 NWZ_NVP_E08, /* EMPR 8 */
57 NWZ_NVP_E09, /* EMPR 9 */
58 NWZ_NVP_E10, /* EMPR 10 */
59 NWZ_NVP_E11, /* EMPR 11 */
60 NWZ_NVP_E12, /* EMPR 12 */
61 NWZ_NVP_E13, /* EMPR 13 */
62 NWZ_NVP_E14, /* EMPR 14 */
63 NWZ_NVP_E15, /* EMPR 15 */
64 NWZ_NVP_E16, /* EMPR 16 */
65 NWZ_NVP_E17, /* EMPR 17 */
66 NWZ_NVP_E18, /* EMPR 18 */
67 NWZ_NVP_E19, /* EMPR 19 */
68 NWZ_NVP_E20, /* EMPR 20 */
69 NWZ_NVP_E21, /* EMPR 21 */
70 NWZ_NVP_E22, /* EMPR 22 */
71 NWZ_NVP_E23, /* EMPR 23 */
72 NWZ_NVP_E24, /* EMPR 24 */
73 NWZ_NVP_E25, /* EMPR 25 */
74 NWZ_NVP_E26, /* EMPR 26 */
75 NWZ_NVP_E27, /* EMPR 27 */
76 NWZ_NVP_E28, /* EMPR 28 */
77 NWZ_NVP_E29, /* EMPR 29 */
78 NWZ_NVP_E30, /* EMPR 30 */
79 NWZ_NVP_E31, /* EMPR 31 */
80 NWZ_NVP_EDW, /* quick shutdown flag */
81 NWZ_NVP_ERI, /* update error image */
82 NWZ_NVP_EXM, /* exception monitor mode */
83 NWZ_NVP_FMP, /* fm parameter */
84 NWZ_NVP_FNI, /* function information */
85 NWZ_NVP_FPI, /* */
86 NWZ_NVP_FUI, /* update image */
87 NWZ_NVP_FUP, /* firmware update flag */
88 NWZ_NVP_FUR, /* */
89 NWZ_NVP_FVI, /* */
90 NWZ_NVP_GTY, /* getty mode flag */
91 NWZ_NVP_HDI, /* hold image */
92 NWZ_NVP_HLD, /* hold mode */
93 NWZ_NVP_INS, /* */
94 NWZ_NVP_IPT, /* disable iptable flag */
95 NWZ_NVP_KAS, /* key and signature */
96 NWZ_NVP_LBI, /* low battery image */
97 NWZ_NVP_LYR, /* */
98 NWZ_NVP_MAC, /* wifi mac address */
99 NWZ_NVP_MCR, /* marlin crl */
100 NWZ_NVP_MDK, /* marlin device key */
101 NWZ_NVP_MDL, /* middleware parameter */
102 NWZ_NVP_MID, /* model id */
103 NWZ_NVP_MLK, /* marlin key */
104 NWZ_NVP_MSC, /* mass storage class mode */
105 NWZ_NVP_MSO, /* MSC only mode flag */
106 NWZ_NVP_MTM, /* marlin time */
107 NWZ_NVP_MUK, /* marlin user key */
108 NWZ_NVP_NCP, /* noise cancel driver parameter */
109 NWZ_NVP_NVR, /* */
110 NWZ_NVP_PCD, /* product code */
111 NWZ_NVP_PCI, /* precharge image */
112 NWZ_NVP_PRK, /* */
113 NWZ_NVP_PSK, /* bluetooth pskey */
114 NWZ_NVP_PTS, /* wifi protected setup */
115 NWZ_NVP_RBT, /* */
116 NWZ_NVP_RND, /* wmt key | random data */
117 NWZ_NVP_RTC, /* rtc alarm */
118 NWZ_NVP_SDC, /* SD Card export flag */
119 NWZ_NVP_SDP, /* sound driver parameter */
120 NWZ_NVP_SER, /* serial number */
121 NWZ_NVP_SFI, /* starfish id */
122 NWZ_NVP_SHE, /* */
123 NWZ_NVP_SHP, /* ship information */
124 NWZ_NVP_SID, /* service id */
125 NWZ_NVP_SKD, /* slacker id file */
126 NWZ_NVP_SKT, /* slacker time */
127 NWZ_NVP_SKU, /* */
128 NWZ_NVP_SLP, /* time out to sleep */
129 NWZ_NVP_SPS, /* speaker ship info */
130 NWZ_NVP_SYI, /* system information */
131 NWZ_NVP_TR0, /* EKB 0 */
132 NWZ_NVP_TR1, /* EKB 1 */
133 NWZ_NVP_TST, /* test mode flag */
134 NWZ_NVP_UBP, /* u-boot password */
135 NWZ_NVP_UFN, /* update file name */
136 NWZ_NVP_UMS, /* */
137 NWZ_NVP_UPS, /* */
138 NWZ_NVP_VRT, /* europe vol regulation flag */
139 NWZ_NVP_COUNT /* Number of nvp nodes */
140};
141
142/* Invalid NVP index */
143#define NWZ_NVP_INVALID -1 /* Non-existent entry */
144/* Number of models */
145#define NWZ_MODEL_COUNT 181
146/* Number of series */
147#define NWZ_SERIES_COUNT 36
148
149/* NVP node info */
150struct nwz_nvp_info_t
151{
152 const char *name; /* Sony's name: "bti" */
153 unsigned long size; /* Size in bytes */
154 const char *desc; /* Description: "bootloader image" */
155};
156
157/* NVP index map (nwz_nvp_node_t -> index) */
158typedef int nwz_nvp_index_t[NWZ_NVP_COUNT];
159
160/* Model info */
161struct nwz_model_info_t
162{
163 unsigned long mid; /* Model ID: first 4 bytes of the NVP mid entry */
164 const char *name; /* Human name: "NWZ-E463" */
165};
166
167/* Series info */
168struct nwz_series_info_t
169{
170 const char *codename; /* Rockbox codename: nwz-e460 */
171 const char *name; /* Human name: "NWZ-E460 Series" */
172 int mid_count; /* number of entries in mid_list */
173 unsigned long *mid; /* List of model IDs */
174 /* Pointer to a name -> index map, nonexistent entries map to NWZ_NVP_INVALID */
175 nwz_nvp_index_t *nvp_index;
176};
177
178/* List of all NVP entries, indexed by nwz_nvp_node_t */
179extern struct nwz_nvp_info_t nwz_nvp[NWZ_NVP_COUNT];
180/* List of all models, sorted by increasing values of model ID */
181extern struct nwz_model_info_t nwz_model[NWZ_MODEL_COUNT];
182/* List of all series */
183extern struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT];
184
185#endif /* __NWZ_DB_H__ */
diff --git a/utils/nwztools/database/series.txt b/utils/nwztools/database/series.txt
new file mode 100644
index 0000000000..bef49ee044
--- /dev/null
+++ b/utils/nwztools/database/series.txt
@@ -0,0 +1,36 @@
1nwz-a10,NWZ-A10 Series,0x1a000001,0x1a000002,0x1a000004,0x1a000005,0x1a000006,0x1a010001,0x1a010002,0x1a010004,0x1a010005,0x1a010006
2nwz-a20,NW-A20 Series,0x1d000001,0x1d000002,0x1d000004,0x1d000005,0x1d000006,0x1d000007
3nw-a30,NW-A30 Series,
4nwz-a720,NWZ-A720 Series,0x3030001,0x3030002,0x3030004,0x3020001,0x3020002,0x3020004
5nwz-a810,NWZ-A810 Series,0x10000,0x10001,0x10002
6nwz-a820,NWZ-A820 Series,0x3010001,0x3010002,0x3010004,0x3000001,0x3000002,0x3000004
7nwz-a840,NWZ-A840 Series,0x7010004,0x7010005,0x7010006,0x7000004,0x7000005,0x7000006
8nwz-a850,NWZ-A850 Series,0xe000004,0xe000005,0xe000006
9nwz-a860,NWZ-A860 Series,0x11000001,0x11000002,0x11000004,0x11000005,0x11000006,0x11010001,0x11010002,0x11010004,0x11010005,0x11010006,0x11020001,0x11020002,0x11020004,0x11020005,0x11020006
10nw-a910,NW-A910 Series,0x2000001,0x2000002,0x2000004
11nwz-e050,NWZ-E050 Series,0x8000000,0x8000001,0x8000002,0x10000000,0x10000001
12nw-e060,NW-E060 Series,0x14000000,0x14000001,0x14000002,0x14000004,0x14000005
13nw-e080,NW-E080 Series,0x19010001,0x19010002,0x19010004,0x19010005
14nwz-e350,NWZ-E350 Series,0xc000001,0xc000002,0xc000004
15nwz-e450,NWZ-E450 Series,0xb000001,0xb000002,0xb000004
16nwz-e460,NWZ-E460 Series,0x13000001,0x13000002,0x13000004
17nwz-e470,NWZ-E470 Series,0x15000001,0x15000002,0x15000004,0x15000005
18nwz-e550,NWZ-E550 Series,0xd000001,0xd000002,0xd000004,0xd000005
19nwz-e570,NWZ-E570 Series,0x15010001,0x15010002,0x15010004,0x15010005
20nwz-e580,NWZ-E580 Series,0x19020001,0x19020002,0x19020004,0x19020005
21nw-s10,NW-S10 Series,0x1b000001,0x1b000002,0x1b000004,0x1b000005,0x1b000006
22nwz-s510,NWZ-S510 Series,0x1030000,0x1030001
23nwz-s610,NWZ-S610 Series,0x1000000,0x1000001,0x1020000,0x1020001,0x1020002
24nwz-s630,NWZ-S630 Series,0x4000001,0x4000002,0x4000004,0x4020001,0x4020002,0x4020004
25nw-s640,NW-S640 Series,0x6010002,0x6010004,0x6010005
26nwz-s710,NWZ-S710 Series,0x1010000,0x1010001,0x1010002,0x1040000,0x1040001,0x1040002
27nwz-s730,NWZ-S730 Series,0x4010001,0x4010002,0x4010004,0x4030001,0x4030002,0x4030004
28nwz-s740,NWZ-S740 Series,0x6030002,0x6030004,0x6030005,0x6020002,0x6020004,0x6020005
29nwz-s750,NWZ-S740 Series,0x9000002,0x9000004,0x9000005,0xf000002,0xf000004
30nwz-s760,NWZ-S740 Series,0x12000001,0x12000002,0x12000004,0x12000005,0x12000006,0x12010001,0x12010002,0x12010004,0x12010005,0x12010006
31nwz-s770,NWZ-S770 Series,0x16000001,0x16000002,0x16000004,0x16000005,0x16010001,0x16010002,0x16010004,0x16010005
32nw-s780,NW-S780 Series,0x19000001,0x19000002,0x19000004,0x19000005
33nwz-x1000,NWZ-X1000 Series,0x5000002,0x5000004,0x5000005,0x5020002,0x5040002,0x5020004,0x5040004,0x5020005,0x5040005
34nw-zx100,NW-ZX100 Series,0x1c000007,0x1c000001,0x1c000002,0x1c000004,0x1c000005,0x1c000006
35nwz-zx2,NW-ZX2,
36nwz-noname,NONAME,0x5010002,0x5010004,0x5010005