diff options
Diffstat (limited to 'utils/nwztools/database/nvp')
31 files changed, 3061 insertions, 0 deletions
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 @@ | |||
1 | DEFINES= | ||
2 | CC=gcc | ||
3 | CXX=g++ | ||
4 | LD=g++ | ||
5 | PROFILE= | ||
6 | CFLAGS=-g $(PROFILE) -std=c99 -W -Wall $(DEFINES) `xml2-config --cflags` | ||
7 | CXXFLAGS=-g $(PROFILE) -W -Wall $(DEFINES) `xml2-config --cflags` | ||
8 | LDFLAGS=$(PROFILE) `xml2-config --libs` | ||
9 | BINS=nvptool | ||
10 | |||
11 | all: $(BINS) | ||
12 | |||
13 | %.o: %.c | ||
14 | $(CC) $(CFLAGS) -c -o $@ $< | ||
15 | |||
16 | %.o: %.cpp | ||
17 | $(CXX) $(CXXFLAGS) -c -o $@ $< | ||
18 | |||
19 | nvptool: nvptool.o | ||
20 | $(LD) -o $@ $^ $(LDFLAGS) | ||
21 | |||
22 | clean: | ||
23 | rm -fr *.o | ||
24 | |||
25 | veryclean: | ||
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 @@ | |||
1 | The NVP map varies a lot from players to players, it is inconceivable to build | ||
2 | it by hand. The approach taken is to extract it from the kernel of each player. | ||
3 | Since Sony provides the kernel of all players, it is 'only' a matter of | ||
4 | downloading all of them. A bit of back story on the NVP: it is non-volatile | ||
5 | area of the flash that is divided in regions and then "sectors" (unrelated to | ||
6 | hard drive sectors). Each "sector" stores the data of a "node". The ABI | ||
7 | between the NVP driver and the userspace is an index: the userspace gives the | ||
8 | index of a node, and then drives looksup its table to see where it is and what | ||
9 | is its size. The index map changes over time so Sony introduces standard "names" | ||
10 | for its entries, those are 3-letters acronym (for example "fup" or "bti" or "shp") | ||
11 | that have a corresponding index. For some reason, the driver also contains a | ||
12 | description of the nodes, in english (so "bti" stands for "boot image"). | ||
13 | |||
14 | parse_nvp_header.sh | ||
15 | =================== | ||
16 | |||
17 | This script is given a file name, a kernel directory or a kernel tgz and it will | ||
18 | try to extract the mapping automatically. It produces a list of pairs | ||
19 | <node>,<name> | ||
20 | where <node> is the index of the node (that's the only thing that is usable on | ||
21 | a running device) and <name> is the standard name of the node. Note that is | ||
22 | some kind of acronym (like 'fup') and the description needs to be generated | ||
23 | separatly (see other section). | ||
24 | |||
25 | parse_all_nvp_headers.sh | ||
26 | ======================== | ||
27 | |||
28 | This 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 | ... | ||
35 | Each sudirectory must the series name (as used in ../series.txt) and the kernel | ||
36 | must be a tgz (end in .tgz and not .tar.gz) of the form linux-kernel-*.tgz. Usually | ||
37 | the variable bit will be the version but some kernels have unknown versions. It | ||
38 | will then run parse_nvp_header.sh on each of them and store the result in a | ||
39 | file called <series name>.txt | ||
40 | |||
41 | NOTE: the kernel can be symlinks to other files | ||
42 | |||
43 | nvptool | ||
44 | ======= | ||
45 | |||
46 | The kernel headers do no contain the description of the nvp node names. | ||
47 | This one can be extract from the icx_nvp[_emmc].ko driver on target using complicated | ||
48 | elf parsing done by nvptool. Technically nvptoo can find much more information | ||
49 | like the node -> humanname mapping as well and the actual sector on the disk but | ||
50 | since we can already extract it easily from the headers, we only extract description | ||
51 | names from it. | ||
52 | |||
53 | parse_all_nvp_nodes.sh | ||
54 | ====================== | ||
55 | |||
56 | This scripts expects a directory to have the following structure: | ||
57 | dir/ | ||
58 | nwz-a10/ | ||
59 | rootfs.tgz | ||
60 | nwz-e460/ | ||
61 | rootfs.tgz | ||
62 | ... | ||
63 | Each sudirectory must the series name (as used in ../series.txt) and the rootfs | ||
64 | must be a tar. It will then extract the relevant icx_nvp driver from it and run | ||
65 | nvptool on it to produce a file called nodes-<series name>.txt | ||
66 | |||
67 | NOTE: 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 @@ | |||
1 | 1,4,system information | ||
2 | 2,32,u-boot password | ||
3 | 3,4,firmware update flag | ||
4 | 4,4,beep ok flag | ||
5 | 5,4,hold mode | ||
6 | 6,16,rtc alarm | ||
7 | 7,64,model id | ||
8 | 8,5,product code | ||
9 | 9,16,serial number | ||
10 | 10,8,update file name | ||
11 | 11,64,key and signature | ||
12 | 12,32,ship information | ||
13 | 13,4,test mode flag | ||
14 | 14,4,getty mode flag | ||
15 | 15,16,fm parameter | ||
16 | 16,64,sound driver parameter | ||
17 | 17,64,noise cancel driver parameter | ||
18 | 18,512,bluetooth pskey | ||
19 | 77,4,wifi protected setup | ||
20 | 85,4,battery calibration | ||
21 | 19,2048,bluetooth parameter | ||
22 | 20,512,btmw factory pair info | ||
23 | 21,512,btmw factory scdb | ||
24 | 22,4,btmw log mode flag | ||
25 | 78,4,application debug mode flag | ||
26 | 79,4,browser log mode flag | ||
27 | 80,4,time out to sleep | ||
28 | 81,4,europe vol regulation flag | ||
29 | 82,4,function information | ||
30 | 83,4,service id | ||
31 | 84,4,marlin key | ||
32 | 86,4,MSC only mode flag | ||
33 | 89,4,SD Card export flag | ||
34 | 23,704,aad/empr key | ||
35 | 24,160,aad icv | ||
36 | 25,520,empr icv | ||
37 | 26,4,key mode (debug/release) | ||
38 | 27,64,random data | ||
39 | 28,8224,slacker id file | ||
40 | 29,64,starfish id | ||
41 | 30,33024,marlin device key | ||
42 | 31,20,secure clock | ||
43 | 32,16,slacker time | ||
44 | 33,64,marlin time | ||
45 | 34,16384,EKB 0 | ||
46 | 35,16384,EKB 1 | ||
47 | 36,1024,EMPR 0 | ||
48 | 37,1024,EMPR 1 | ||
49 | 38,1024,EMPR 2 | ||
50 | 39,1024,EMPR 3 | ||
51 | 40,1024,EMPR 4 | ||
52 | 41,1024,EMPR 5 | ||
53 | 42,1024,EMPR 6 | ||
54 | 43,1024,EMPR 7 | ||
55 | 44,1024,EMPR 8 | ||
56 | 45,1024,EMPR 9 | ||
57 | 46,1024,EMPR 10 | ||
58 | 47,1024,EMPR 11 | ||
59 | 48,1024,EMPR 12 | ||
60 | 49,1024,EMPR 13 | ||
61 | 50,1024,EMPR 14 | ||
62 | 51,1024,EMPR 15 | ||
63 | 52,1024,EMPR 16 | ||
64 | 53,1024,EMPR 17 | ||
65 | 54,1024,EMPR 18 | ||
66 | 55,1024,EMPR 19 | ||
67 | 56,1024,EMPR 20 | ||
68 | 57,1024,EMPR 21 | ||
69 | 58,1024,EMPR 22 | ||
70 | 59,1024,EMPR 23 | ||
71 | 60,1024,EMPR 24 | ||
72 | 61,1024,EMPR 25 | ||
73 | 62,1024,EMPR 26 | ||
74 | 63,1024,EMPR 27 | ||
75 | 64,1024,EMPR 28 | ||
76 | 65,1024,EMPR 29 | ||
77 | 66,1024,EMPR 30 | ||
78 | 67,1024,EMPR 31 | ||
79 | 68,4,color variation | ||
80 | 69,4,speaker ship info | ||
81 | 70,8,middleware parameter | ||
82 | 71,4,quick shutdown flag | ||
83 | 72,262144,boot image | ||
84 | 73,262144,hold image | ||
85 | 74,262144,low battery image | ||
86 | 75,262144,update image | ||
87 | 76,262144,update error image | ||
88 | 87,262144,precharge image | ||
89 | 88,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 @@ | |||
1 | 1,4,system information | ||
2 | 2,32,u-boot password | ||
3 | 3,4,firmware update flag | ||
4 | 4,4,beep ok flag | ||
5 | 5,4,hold mode | ||
6 | 6,16,rtc alarm | ||
7 | 7,64,model id | ||
8 | 8,5,product code | ||
9 | 9,16,serial number | ||
10 | 10,8,update file name | ||
11 | 11,64,key and signature | ||
12 | 12,32,ship information | ||
13 | 13,4,test mode flag | ||
14 | 14,4,getty mode flag | ||
15 | 15,16,fm parameter | ||
16 | 16,64,sound driver parameter | ||
17 | 17,64,noise cancel driver parameter | ||
18 | 18,512,bluetooth pskey | ||
19 | 77,4,wifi protected setup | ||
20 | 85,4,battery calibration | ||
21 | 19,2048,bluetooth parameter | ||
22 | 20,512,btmw factory pair info | ||
23 | 21,512,btmw factory scdb | ||
24 | 22,4,btmw log mode flag | ||
25 | 78,4,application debug mode flag | ||
26 | 79,4,browser log mode flag | ||
27 | 80,4,time out to sleep | ||
28 | 81,4,europe vol regulation flag | ||
29 | 82,4,function information | ||
30 | 83,4,service id | ||
31 | 84,4,marlin key | ||
32 | 86,4,MSC only mode flag | ||
33 | 89,4,SD Card export flag | ||
34 | 23,704,aad/empr key | ||
35 | 24,160,aad icv | ||
36 | 25,520,empr icv | ||
37 | 26,4,key mode (debug/release) | ||
38 | 27,64,random data | ||
39 | 28,8224,slacker id file | ||
40 | 29,64,starfish id | ||
41 | 30,33024,marlin device key | ||
42 | 31,20,secure clock | ||
43 | 32,16,slacker time | ||
44 | 33,64,marlin time | ||
45 | 34,16384,EKB 0 | ||
46 | 35,16384,EKB 1 | ||
47 | 36,1024,EMPR 0 | ||
48 | 37,1024,EMPR 1 | ||
49 | 38,1024,EMPR 2 | ||
50 | 39,1024,EMPR 3 | ||
51 | 40,1024,EMPR 4 | ||
52 | 41,1024,EMPR 5 | ||
53 | 42,1024,EMPR 6 | ||
54 | 43,1024,EMPR 7 | ||
55 | 44,1024,EMPR 8 | ||
56 | 45,1024,EMPR 9 | ||
57 | 46,1024,EMPR 10 | ||
58 | 47,1024,EMPR 11 | ||
59 | 48,1024,EMPR 12 | ||
60 | 49,1024,EMPR 13 | ||
61 | 50,1024,EMPR 14 | ||
62 | 51,1024,EMPR 15 | ||
63 | 52,1024,EMPR 16 | ||
64 | 53,1024,EMPR 17 | ||
65 | 54,1024,EMPR 18 | ||
66 | 55,1024,EMPR 19 | ||
67 | 56,1024,EMPR 20 | ||
68 | 57,1024,EMPR 21 | ||
69 | 58,1024,EMPR 22 | ||
70 | 59,1024,EMPR 23 | ||
71 | 60,1024,EMPR 24 | ||
72 | 61,1024,EMPR 25 | ||
73 | 62,1024,EMPR 26 | ||
74 | 63,1024,EMPR 27 | ||
75 | 64,1024,EMPR 28 | ||
76 | 65,1024,EMPR 29 | ||
77 | 66,1024,EMPR 30 | ||
78 | 67,1024,EMPR 31 | ||
79 | 68,4,color variation | ||
80 | 69,4,speaker ship info | ||
81 | 70,8,middleware parameter | ||
82 | 71,4,quick shutdown flag | ||
83 | 72,262144,boot image | ||
84 | 73,262144,hold image | ||
85 | 74,262144,low battery image | ||
86 | 75,262144,update image | ||
87 | 76,262144,update error image | ||
88 | 87,262144,precharge image | ||
89 | 88,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 @@ | |||
1 | 24,4,system information | ||
2 | 23,32,u-boot password | ||
3 | 9,4,firmware update flag | ||
4 | 10,4,beep ok flag | ||
5 | 34,16,rtc alarm | ||
6 | 80,4,hold mode | ||
7 | 16,64,model id | ||
8 | 4,16,serial number | ||
9 | 11,32,ship information | ||
10 | 68,4,color variation | ||
11 | 26,5,product code | ||
12 | 29,8,update file name | ||
13 | 32,64,key and signature | ||
14 | 17,4,test mode flag | ||
15 | 18,4,getty mode flag | ||
16 | 70,4,disable iptable flag | ||
17 | 30,64,sound driver parameter | ||
18 | 31,64,noise cancel driver parameter | ||
19 | 77,6,wifi mac address | ||
20 | 75,4,wifi protected setup | ||
21 | 82,16,fm parameter | ||
22 | 83,4,speaker ship info | ||
23 | 84,4,mass storage class mode | ||
24 | 25,4,exception monitor mode | ||
25 | 27,4,battery calibration | ||
26 | 86,512,bluetooth pskey | ||
27 | 5,4096,application parameter | ||
28 | 7,20,secure clock | ||
29 | 12,160,aad icv | ||
30 | 13,520,empr key | ||
31 | 76,16,slacker time | ||
32 | 21,4,key mode (debug/release) | ||
33 | 71,64,marlin time | ||
34 | 72,16384,marlin crl | ||
35 | 89,512,btmw factory pair info | ||
36 | 88,512,btmw factory scdb | ||
37 | 87,4,btmw log mode flag | ||
38 | 85,4,europe vol regulation flag | ||
39 | 8,8,middleware parameter | ||
40 | 22,4,quick shutdown flag | ||
41 | 69,4,time out to sleep | ||
42 | 78,4,application debug mode flag | ||
43 | 79,4,browser log mode flag | ||
44 | 3,704,aad key | ||
45 | 28,64,wmt key | ||
46 | 81,8224,slacker id file | ||
47 | 73,33024,marlin device key | ||
48 | 33,64,starfish id | ||
49 | 35,2048,bluetooth address | ||
50 | 14,16384,EKB 0 | ||
51 | 15,16384,EKB 1 | ||
52 | 74,24576,marlin user key | ||
53 | 36,1024,EMPR 0 | ||
54 | 37,1024,EMPR 1 | ||
55 | 38,1024,EMPR 2 | ||
56 | 39,1024,EMPR 3 | ||
57 | 40,1024,EMPR 4 | ||
58 | 41,1024,EMPR 5 | ||
59 | 42,1024,EMPR 6 | ||
60 | 43,1024,EMPR 7 | ||
61 | 44,1024,EMPR 8 | ||
62 | 45,1024,EMPR 9 | ||
63 | 46,1024,EMPR 10 | ||
64 | 47,1024,EMPR 11 | ||
65 | 48,1024,EMPR 12 | ||
66 | 49,1024,EMPR 13 | ||
67 | 50,1024,EMPR 14 | ||
68 | 51,1024,EMPR 15 | ||
69 | 52,1024,EMPR 16 | ||
70 | 53,1024,EMPR 17 | ||
71 | 54,1024,EMPR 18 | ||
72 | 55,1024,EMPR 19 | ||
73 | 56,1024,EMPR 20 | ||
74 | 57,1024,EMPR 21 | ||
75 | 58,1024,EMPR 22 | ||
76 | 59,1024,EMPR 23 | ||
77 | 60,1024,EMPR 24 | ||
78 | 61,1024,EMPR 25 | ||
79 | 62,1024,EMPR 26 | ||
80 | 63,1024,EMPR 27 | ||
81 | 64,1024,EMPR 28 | ||
82 | 65,1024,EMPR 29 | ||
83 | 66,1024,EMPR 30 | ||
84 | 67,1024,EMPR 31 | ||
85 | 1,262144,boot image | ||
86 | 2,262144,hold image | ||
87 | 20,262144,low battery image | ||
88 | 19,262144,update image | ||
89 | 6,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 @@ | |||
1 | 24,4,system information | ||
2 | 23,32,u-boot password | ||
3 | 9,4,firmware update flag | ||
4 | 10,4,beep ok flag | ||
5 | 34,16,rtc alarm | ||
6 | 80,4,hold mode | ||
7 | 16,64,model id | ||
8 | 4,16,serial number | ||
9 | 11,32,ship information | ||
10 | 68,4,color variation | ||
11 | 26,5,product code | ||
12 | 29,8,update file name | ||
13 | 32,64,key and signature | ||
14 | 17,4,test mode flag | ||
15 | 18,4,getty mode flag | ||
16 | 70,4,disable iptable flag | ||
17 | 30,64,sound driver parameter | ||
18 | 31,64,noise cancel driver parameter | ||
19 | 77,6,wifi mac address | ||
20 | 75,4,wifi protected setup | ||
21 | 82,16,fm parameter | ||
22 | 83,4,speaker ship info | ||
23 | 84,4,mass storage class mode | ||
24 | 25,4,exception monitor mode | ||
25 | 5,4096,application parameter | ||
26 | 35,2048,bluetooth parameter | ||
27 | 8,8,middleware parameter | ||
28 | 22,4,quick shutdown flag | ||
29 | 69,4,time out to sleep | ||
30 | 78,4,application debug mode flag | ||
31 | 79,4,browser log mode flag | ||
32 | 7,20,secure clock | ||
33 | 3,704,aad key | ||
34 | 12,160,aad icv | ||
35 | 13,520,empr key | ||
36 | 28,64,random data | ||
37 | 76,16,slacker time | ||
38 | 21,4,key mode (debug/release) | ||
39 | 81,8224,slacker id file | ||
40 | 14,16384,EKB 0 | ||
41 | 15,16384,EKB 1 | ||
42 | 36,1024,EMPR 0 | ||
43 | 37,1024,EMPR 1 | ||
44 | 38,1024,EMPR 2 | ||
45 | 39,1024,EMPR 3 | ||
46 | 40,1024,EMPR 4 | ||
47 | 41,1024,EMPR 5 | ||
48 | 42,1024,EMPR 6 | ||
49 | 43,1024,EMPR 7 | ||
50 | 44,1024,EMPR 8 | ||
51 | 45,1024,EMPR 9 | ||
52 | 46,1024,EMPR 10 | ||
53 | 47,1024,EMPR 11 | ||
54 | 48,1024,EMPR 12 | ||
55 | 49,1024,EMPR 13 | ||
56 | 50,1024,EMPR 14 | ||
57 | 51,1024,EMPR 15 | ||
58 | 52,1024,EMPR 16 | ||
59 | 53,1024,EMPR 17 | ||
60 | 54,1024,EMPR 18 | ||
61 | 55,1024,EMPR 19 | ||
62 | 56,1024,EMPR 20 | ||
63 | 57,1024,EMPR 21 | ||
64 | 58,1024,EMPR 22 | ||
65 | 59,1024,EMPR 23 | ||
66 | 60,1024,EMPR 24 | ||
67 | 61,1024,EMPR 25 | ||
68 | 62,1024,EMPR 26 | ||
69 | 63,1024,EMPR 27 | ||
70 | 64,1024,EMPR 28 | ||
71 | 65,1024,EMPR 29 | ||
72 | 66,1024,EMPR 30 | ||
73 | 67,1024,EMPR 31 | ||
74 | 1,262144,boot image | ||
75 | 2,262144,hold image | ||
76 | 20,262144,low battery image | ||
77 | 19,262144,update image | ||
78 | 6,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 @@ | |||
1 | 24,4,system information | ||
2 | 23,32,u-boot password | ||
3 | 9,4,firmware update flag | ||
4 | 10,4,beep ok flag | ||
5 | 34,16,rtc alarm | ||
6 | 80,4,hold mode | ||
7 | 16,64,model id | ||
8 | 4,16,serial number | ||
9 | 11,32,ship information | ||
10 | 68,4,color variation | ||
11 | 26,5,product code | ||
12 | 29,8,update file name | ||
13 | 32,64,key and signature | ||
14 | 17,4,test mode flag | ||
15 | 18,4,getty mode flag | ||
16 | 70,4,disable iptable flag | ||
17 | 30,64,sound driver parameter | ||
18 | 31,64,noise cancel driver parameter | ||
19 | 77,6,wifi mac address | ||
20 | 75,4,wifi protected setup | ||
21 | 82,16,fm parameter | ||
22 | 83,4,speaker ship info | ||
23 | 84,4,mass storage class mode | ||
24 | 25,4,exception monitor mode | ||
25 | 27,4,battery calibration | ||
26 | 86,512,bluetooth pskey | ||
27 | 5,4096,application parameter | ||
28 | 7,20,secure clock | ||
29 | 12,160,aad icv | ||
30 | 13,520,empr key | ||
31 | 76,16,slacker time | ||
32 | 21,4,key mode (debug/release) | ||
33 | 71,64,marlin time | ||
34 | 72,16384,marlin crl | ||
35 | 89,512,btmw factory pair info | ||
36 | 88,512,btmw factory scdb | ||
37 | 87,4,btmw log mode flag | ||
38 | 85,4,europe vol regulation flag | ||
39 | 8,8,middleware parameter | ||
40 | 22,4,quick shutdown flag | ||
41 | 69,4,time out to sleep | ||
42 | 78,4,application debug mode flag | ||
43 | 79,4,browser log mode flag | ||
44 | 3,704,aad key | ||
45 | 28,64,wmt key | ||
46 | 81,8224,slacker id file | ||
47 | 73,33024,marlin device key | ||
48 | 33,64,starfish id | ||
49 | 35,2048,bluetooth address | ||
50 | 14,16384,EKB 0 | ||
51 | 15,16384,EKB 1 | ||
52 | 74,24576,marlin user key | ||
53 | 36,1024,EMPR 0 | ||
54 | 37,1024,EMPR 1 | ||
55 | 38,1024,EMPR 2 | ||
56 | 39,1024,EMPR 3 | ||
57 | 40,1024,EMPR 4 | ||
58 | 41,1024,EMPR 5 | ||
59 | 42,1024,EMPR 6 | ||
60 | 43,1024,EMPR 7 | ||
61 | 44,1024,EMPR 8 | ||
62 | 45,1024,EMPR 9 | ||
63 | 46,1024,EMPR 10 | ||
64 | 47,1024,EMPR 11 | ||
65 | 48,1024,EMPR 12 | ||
66 | 49,1024,EMPR 13 | ||
67 | 50,1024,EMPR 14 | ||
68 | 51,1024,EMPR 15 | ||
69 | 52,1024,EMPR 16 | ||
70 | 53,1024,EMPR 17 | ||
71 | 54,1024,EMPR 18 | ||
72 | 55,1024,EMPR 19 | ||
73 | 56,1024,EMPR 20 | ||
74 | 57,1024,EMPR 21 | ||
75 | 58,1024,EMPR 22 | ||
76 | 59,1024,EMPR 23 | ||
77 | 60,1024,EMPR 24 | ||
78 | 61,1024,EMPR 25 | ||
79 | 62,1024,EMPR 26 | ||
80 | 63,1024,EMPR 27 | ||
81 | 64,1024,EMPR 28 | ||
82 | 65,1024,EMPR 29 | ||
83 | 66,1024,EMPR 30 | ||
84 | 67,1024,EMPR 31 | ||
85 | 1,262144,boot image | ||
86 | 2,262144,hold image | ||
87 | 20,262144,low battery image | ||
88 | 19,262144,update image | ||
89 | 6,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 @@ | |||
1 | 1,4,system information | ||
2 | 2,32,u-boot password | ||
3 | 3,4,firmware update flag | ||
4 | 4,4,beep ok flag | ||
5 | 5,4,hold mode | ||
6 | 6,16,rtc alarm | ||
7 | 7,64,model id | ||
8 | 8,5,product code | ||
9 | 9,16,serial number | ||
10 | 10,8,update file name | ||
11 | 11,64,key and signature | ||
12 | 12,32,ship information | ||
13 | 13,4,test mode flag | ||
14 | 14,4,getty mode flag | ||
15 | 15,16,fm parameter | ||
16 | 16,64,sound driver parameter | ||
17 | 17,64,noise cancel driver parameter | ||
18 | 18,512,bluetooth pskey | ||
19 | 77,4,wifi protected setup | ||
20 | 85,4,battery calibration | ||
21 | 19,2048,bluetooth parameter | ||
22 | 20,512,btmw factory pair info | ||
23 | 21,512,btmw factory scdb | ||
24 | 22,4,btmw log mode flag | ||
25 | 78,4,application debug mode flag | ||
26 | 79,4,browser log mode flag | ||
27 | 80,4,time out to sleep | ||
28 | 81,4,europe vol regulation flag | ||
29 | 82,4,function information | ||
30 | 83,4,service id | ||
31 | 84,4,marlin key | ||
32 | 86,4,MSC only mode flag | ||
33 | 23,704,aad/empr key | ||
34 | 24,160,aad icv | ||
35 | 25,520,empr icv | ||
36 | 26,4,key mode (debug/release) | ||
37 | 27,64,random data | ||
38 | 28,8224,slacker id file | ||
39 | 29,64,starfish id | ||
40 | 30,33024,marlin device key | ||
41 | 31,20,secure clock | ||
42 | 32,16,slacker time | ||
43 | 33,64,marlin time | ||
44 | 34,16384,EKB 0 | ||
45 | 35,16384,EKB 1 | ||
46 | 36,1024,EMPR 0 | ||
47 | 37,1024,EMPR 1 | ||
48 | 38,1024,EMPR 2 | ||
49 | 39,1024,EMPR 3 | ||
50 | 40,1024,EMPR 4 | ||
51 | 41,1024,EMPR 5 | ||
52 | 42,1024,EMPR 6 | ||
53 | 43,1024,EMPR 7 | ||
54 | 44,1024,EMPR 8 | ||
55 | 45,1024,EMPR 9 | ||
56 | 46,1024,EMPR 10 | ||
57 | 47,1024,EMPR 11 | ||
58 | 48,1024,EMPR 12 | ||
59 | 49,1024,EMPR 13 | ||
60 | 50,1024,EMPR 14 | ||
61 | 51,1024,EMPR 15 | ||
62 | 52,1024,EMPR 16 | ||
63 | 53,1024,EMPR 17 | ||
64 | 54,1024,EMPR 18 | ||
65 | 55,1024,EMPR 19 | ||
66 | 56,1024,EMPR 20 | ||
67 | 57,1024,EMPR 21 | ||
68 | 58,1024,EMPR 22 | ||
69 | 59,1024,EMPR 23 | ||
70 | 60,1024,EMPR 24 | ||
71 | 61,1024,EMPR 25 | ||
72 | 62,1024,EMPR 26 | ||
73 | 63,1024,EMPR 27 | ||
74 | 64,1024,EMPR 28 | ||
75 | 65,1024,EMPR 29 | ||
76 | 66,1024,EMPR 30 | ||
77 | 67,1024,EMPR 31 | ||
78 | 68,4,color variation | ||
79 | 69,4,speaker ship info | ||
80 | 70,8,middleware parameter | ||
81 | 71,4,quick shutdown flag | ||
82 | 72,262144,boot image | ||
83 | 73,262144,hold image | ||
84 | 74,262144,low battery image | ||
85 | 75,262144,update image | ||
86 | 76,262144,update error image | ||
87 | 87,262144,precharge image | ||
88 | 88,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 @@ | |||
1 | 1,4,system information | ||
2 | 2,32,u-boot password | ||
3 | 3,4,firmware update flag | ||
4 | 4,4,beep ok flag | ||
5 | 5,4,hold mode | ||
6 | 6,16,rtc alarm | ||
7 | 7,64,model id | ||
8 | 8,5,product code | ||
9 | 9,16,serial number | ||
10 | 10,8,update file name | ||
11 | 11,64,key and signature | ||
12 | 12,32,ship information | ||
13 | 13,4,test mode flag | ||
14 | 14,4,getty mode flag | ||
15 | 15,16,fm parameter | ||
16 | 16,64,sound driver parameter | ||
17 | 17,64,noise cancel driver parameter | ||
18 | 18,512,bluetooth pskey | ||
19 | 77,4,wifi protected setup | ||
20 | 85,4,battery calibration | ||
21 | 19,2048,bluetooth parameter | ||
22 | 20,512,btmw factory pair info | ||
23 | 21,512,btmw factory scdb | ||
24 | 22,4,btmw log mode flag | ||
25 | 78,4,application debug mode flag | ||
26 | 79,4,browser log mode flag | ||
27 | 80,4,time out to sleep | ||
28 | 81,4,europe vol regulation flag | ||
29 | 82,4,function information | ||
30 | 83,4,service id | ||
31 | 84,4,marlin key | ||
32 | 86,4,MSC only mode flag | ||
33 | 89,4,SD Card export flag | ||
34 | 23,704,aad/empr key | ||
35 | 24,160,aad icv | ||
36 | 25,520,empr icv | ||
37 | 26,4,key mode (debug/release) | ||
38 | 27,64,random data | ||
39 | 28,8224,slacker id file | ||
40 | 29,64,starfish id | ||
41 | 30,33024,marlin device key | ||
42 | 31,20,secure clock | ||
43 | 32,16,slacker time | ||
44 | 33,64,marlin time | ||
45 | 34,16384,EKB 0 | ||
46 | 35,16384,EKB 1 | ||
47 | 36,1024,EMPR 0 | ||
48 | 37,1024,EMPR 1 | ||
49 | 38,1024,EMPR 2 | ||
50 | 39,1024,EMPR 3 | ||
51 | 40,1024,EMPR 4 | ||
52 | 41,1024,EMPR 5 | ||
53 | 42,1024,EMPR 6 | ||
54 | 43,1024,EMPR 7 | ||
55 | 44,1024,EMPR 8 | ||
56 | 45,1024,EMPR 9 | ||
57 | 46,1024,EMPR 10 | ||
58 | 47,1024,EMPR 11 | ||
59 | 48,1024,EMPR 12 | ||
60 | 49,1024,EMPR 13 | ||
61 | 50,1024,EMPR 14 | ||
62 | 51,1024,EMPR 15 | ||
63 | 52,1024,EMPR 16 | ||
64 | 53,1024,EMPR 17 | ||
65 | 54,1024,EMPR 18 | ||
66 | 55,1024,EMPR 19 | ||
67 | 56,1024,EMPR 20 | ||
68 | 57,1024,EMPR 21 | ||
69 | 58,1024,EMPR 22 | ||
70 | 59,1024,EMPR 23 | ||
71 | 60,1024,EMPR 24 | ||
72 | 61,1024,EMPR 25 | ||
73 | 62,1024,EMPR 26 | ||
74 | 63,1024,EMPR 27 | ||
75 | 64,1024,EMPR 28 | ||
76 | 65,1024,EMPR 29 | ||
77 | 66,1024,EMPR 30 | ||
78 | 67,1024,EMPR 31 | ||
79 | 68,4,color variation | ||
80 | 69,4,speaker ship info | ||
81 | 70,8,middleware parameter | ||
82 | 71,4,quick shutdown flag | ||
83 | 72,262144,boot image | ||
84 | 73,262144,hold image | ||
85 | 74,262144,low battery image | ||
86 | 75,262144,update image | ||
87 | 76,262144,update error image | ||
88 | 87,262144,precharge image | ||
89 | 88,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 | |||
32 | bool g_verbose = false; | ||
33 | bool g_unsafe = false; | ||
34 | |||
35 | uint8_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 | |||
51 | bool 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 */ | ||
65 | uint8_t *g_elf_buf; | ||
66 | size_t g_elf_size; | ||
67 | Elf32_Shdr *g_elf_symtab; | ||
68 | Elf32_Shdr *g_elf_symtab_strtab; | ||
69 | Elf32_Shdr *g_elf_shstrtab; | ||
70 | |||
71 | Elf32_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 | |||
79 | Elf32_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 | |||
89 | size_t elf_shnum() | ||
90 | { | ||
91 | return elf_ehdr()->e_shnum; | ||
92 | } | ||
93 | |||
94 | const 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 | |||
121 | const 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 | |||
127 | const 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 | |||
135 | Elf32_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 | |||
148 | Elf32_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 | |||
160 | Elf32_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 | |||
169 | void *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 */ | ||
183 | const 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 | |||
204 | size_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 | |||
219 | void *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 */ | ||
227 | void *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 | |||
292 | size_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 | |||
312 | size_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 */ | ||
319 | void *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 | |||
332 | Elf32_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 */ | ||
340 | bool 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 | |||
351 | bool 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 | |||
362 | bool 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 | |||
446 | void 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 | |||
458 | struct 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 | |||
468 | struct 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 | |||
478 | struct 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 | |||
487 | struct 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 | |||
496 | int 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 | |||
507 | int 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 | |||
703 | int 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 @@ | |||
1 | dbg,000 | ||
2 | syi,001 | ||
3 | ubp,002 | ||
4 | fup,003 | ||
5 | prk,004 | ||
6 | hld,005 | ||
7 | rtc,006 | ||
8 | mid,007 | ||
9 | pcd,008 | ||
10 | ser,009 | ||
11 | ufn,010 | ||
12 | kas,011 | ||
13 | shp,012 | ||
14 | tst,013 | ||
15 | gty,014 | ||
16 | fmp,015 | ||
17 | sdp,016 | ||
18 | ncp,017 | ||
19 | psk,018 | ||
20 | nvr,077 | ||
21 | she,084 | ||
22 | btc,085 | ||
23 | ins,089 | ||
24 | ctr,090 | ||
25 | sku,091 | ||
26 | bpr,019 | ||
27 | bfp,020 | ||
28 | bfd,021 | ||
29 | bml,022 | ||
30 | apd,078 | ||
31 | blf,079 | ||
32 | slp,080 | ||
33 | vrt,081 | ||
34 | fni,082 | ||
35 | sid,083 | ||
36 | mso,086 | ||
37 | cng,023 | ||
38 | lyr,024 | ||
39 | dbv,025 | ||
40 | fur,026 | ||
41 | ums,027 | ||
42 | skd,028 | ||
43 | ups,029 | ||
44 | mdk,030 | ||
45 | fvi,031 | ||
46 | mac,032 | ||
47 | fpi,033 | ||
48 | tr0,034 | ||
49 | tr1,035 | ||
50 | e00,036 | ||
51 | e01,037 | ||
52 | e02,038 | ||
53 | e03,039 | ||
54 | e04,040 | ||
55 | e05,041 | ||
56 | e06,042 | ||
57 | e07,043 | ||
58 | e08,044 | ||
59 | e09,045 | ||
60 | e10,046 | ||
61 | e11,047 | ||
62 | e12,048 | ||
63 | e13,049 | ||
64 | e14,050 | ||
65 | e15,051 | ||
66 | e16,052 | ||
67 | e17,053 | ||
68 | e18,054 | ||
69 | e19,055 | ||
70 | e20,056 | ||
71 | e21,057 | ||
72 | e22,058 | ||
73 | e23,059 | ||
74 | e24,060 | ||
75 | e25,061 | ||
76 | e26,062 | ||
77 | e27,063 | ||
78 | e28,064 | ||
79 | e29,065 | ||
80 | e30,066 | ||
81 | e31,067 | ||
82 | clv,068 | ||
83 | sps,069 | ||
84 | rbt,070 | ||
85 | edw,071 | ||
86 | bti,072 | ||
87 | hdi,073 | ||
88 | lbi,074 | ||
89 | fui,075 | ||
90 | eri,076 | ||
91 | pci,087 | ||
92 | dbi,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 @@ | |||
1 | dbg,000 | ||
2 | bti,001 | ||
3 | hdi,002 | ||
4 | cng,003 | ||
5 | ser,004 | ||
6 | app,005 | ||
7 | eri,006 | ||
8 | dcc,007 | ||
9 | mdl,008 | ||
10 | fup,009 | ||
11 | bok,010 | ||
12 | shp,011 | ||
13 | dba,012 | ||
14 | dbv,013 | ||
15 | tr0,014 | ||
16 | tr1,015 | ||
17 | mid,016 | ||
18 | tst,017 | ||
19 | gty,018 | ||
20 | fui,019 | ||
21 | lbi,020 | ||
22 | dor,021 | ||
23 | edw,022 | ||
24 | ubp,023 | ||
25 | syi,024 | ||
26 | exm,025 | ||
27 | pcd,026 | ||
28 | btc,027 | ||
29 | rnd,028 | ||
30 | ufn,029 | ||
31 | sdp,030 | ||
32 | ncp,031 | ||
33 | kas,032 | ||
34 | sfi,033 | ||
35 | rtc,034 | ||
36 | bpr,035 | ||
37 | e00,036 | ||
38 | e01,037 | ||
39 | e02,038 | ||
40 | e03,039 | ||
41 | e04,040 | ||
42 | e05,041 | ||
43 | e06,042 | ||
44 | e07,043 | ||
45 | e08,044 | ||
46 | e09,045 | ||
47 | e10,046 | ||
48 | e11,047 | ||
49 | e12,048 | ||
50 | e13,049 | ||
51 | e14,050 | ||
52 | e15,051 | ||
53 | e16,052 | ||
54 | e17,053 | ||
55 | e18,054 | ||
56 | e19,055 | ||
57 | e20,056 | ||
58 | e21,057 | ||
59 | e22,058 | ||
60 | e23,059 | ||
61 | e24,060 | ||
62 | e25,061 | ||
63 | e26,062 | ||
64 | e27,063 | ||
65 | e28,064 | ||
66 | e29,065 | ||
67 | e30,066 | ||
68 | e31,067 | ||
69 | clv,068 | ||
70 | slp,069 | ||
71 | ipt,070 | ||
72 | mtm,071 | ||
73 | mcr,072 | ||
74 | mdk,073 | ||
75 | muk,074 | ||
76 | pts,075 | ||
77 | skt,076 | ||
78 | mac,077 | ||
79 | apd,078 | ||
80 | blf,079 | ||
81 | hld,080 | ||
82 | skd,081 | ||
83 | fmp,082 | ||
84 | sps,083 | ||
85 | msc,084 | ||
86 | vrt,085 | ||
87 | psk,086 | ||
88 | bml,087 | ||
89 | bfd,088 | ||
90 | bfp,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 @@ | |||
1 | dbg,000 | ||
2 | syi,001 | ||
3 | ubp,002 | ||
4 | fup,003 | ||
5 | bok,004 | ||
6 | hld,005 | ||
7 | rtc,006 | ||
8 | mid,007 | ||
9 | pcd,008 | ||
10 | ser,009 | ||
11 | ufn,010 | ||
12 | kas,011 | ||
13 | shp,012 | ||
14 | tst,013 | ||
15 | gty,014 | ||
16 | fmp,015 | ||
17 | sdp,016 | ||
18 | ncp,017 | ||
19 | psk,018 | ||
20 | pts,077 | ||
21 | bpr,019 | ||
22 | bfp,020 | ||
23 | bfd,021 | ||
24 | bml,022 | ||
25 | apd,078 | ||
26 | blf,079 | ||
27 | slp,080 | ||
28 | vrt,081 | ||
29 | fni,082 | ||
30 | sid,083 | ||
31 | mlk,084 | ||
32 | mso,086 | ||
33 | cng,023 | ||
34 | dba,024 | ||
35 | dbv,025 | ||
36 | dor,026 | ||
37 | rnd,027 | ||
38 | skd,028 | ||
39 | sfi,029 | ||
40 | mdk,030 | ||
41 | dcc,031 | ||
42 | skt,032 | ||
43 | mtm,033 | ||
44 | tr0,034 | ||
45 | tr1,035 | ||
46 | e00,036 | ||
47 | e01,037 | ||
48 | e02,038 | ||
49 | e03,039 | ||
50 | e04,040 | ||
51 | e05,041 | ||
52 | e06,042 | ||
53 | e07,043 | ||
54 | e08,044 | ||
55 | e09,045 | ||
56 | e10,046 | ||
57 | e11,047 | ||
58 | e12,048 | ||
59 | e13,049 | ||
60 | e14,050 | ||
61 | e15,051 | ||
62 | e16,052 | ||
63 | e17,053 | ||
64 | e18,054 | ||
65 | e19,055 | ||
66 | e20,056 | ||
67 | e21,057 | ||
68 | e22,058 | ||
69 | e23,059 | ||
70 | e24,060 | ||
71 | e25,061 | ||
72 | e26,062 | ||
73 | e27,063 | ||
74 | e28,064 | ||
75 | e29,065 | ||
76 | e30,066 | ||
77 | e31,067 | ||
78 | clv,068 | ||
79 | sps,069 | ||
80 | mdl,070 | ||
81 | edw,071 | ||
82 | bti,072 | ||
83 | hdi,073 | ||
84 | lbi,074 | ||
85 | fui,075 | ||
86 | eri,076 | ||
87 | btc,085 | ||
88 | pci,087 | ||
89 | dbi,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 @@ | |||
1 | dbg,000 | ||
2 | syi,001 | ||
3 | ubp,002 | ||
4 | fup,003 | ||
5 | bok,004 | ||
6 | hld,005 | ||
7 | rtc,006 | ||
8 | mid,007 | ||
9 | pcd,008 | ||
10 | ser,009 | ||
11 | ufn,010 | ||
12 | kas,011 | ||
13 | shp,012 | ||
14 | tst,013 | ||
15 | gty,014 | ||
16 | fmp,015 | ||
17 | sdp,016 | ||
18 | ncp,017 | ||
19 | psk,018 | ||
20 | pts,077 | ||
21 | bpr,019 | ||
22 | bfp,020 | ||
23 | bfd,021 | ||
24 | bml,022 | ||
25 | apd,078 | ||
26 | blf,079 | ||
27 | slp,080 | ||
28 | vrt,081 | ||
29 | fni,082 | ||
30 | sid,083 | ||
31 | mlk,084 | ||
32 | mso,086 | ||
33 | cng,023 | ||
34 | dba,024 | ||
35 | dbv,025 | ||
36 | dor,026 | ||
37 | rnd,027 | ||
38 | skd,028 | ||
39 | sfi,029 | ||
40 | mdk,030 | ||
41 | dcc,031 | ||
42 | skt,032 | ||
43 | mtm,033 | ||
44 | tr0,034 | ||
45 | tr1,035 | ||
46 | e00,036 | ||
47 | e01,037 | ||
48 | e02,038 | ||
49 | e03,039 | ||
50 | e04,040 | ||
51 | e05,041 | ||
52 | e06,042 | ||
53 | e07,043 | ||
54 | e08,044 | ||
55 | e09,045 | ||
56 | e10,046 | ||
57 | e11,047 | ||
58 | e12,048 | ||
59 | e13,049 | ||
60 | e14,050 | ||
61 | e15,051 | ||
62 | e16,052 | ||
63 | e17,053 | ||
64 | e18,054 | ||
65 | e19,055 | ||
66 | e20,056 | ||
67 | e21,057 | ||
68 | e22,058 | ||
69 | e23,059 | ||
70 | e24,060 | ||
71 | e25,061 | ||
72 | e26,062 | ||
73 | e27,063 | ||
74 | e28,064 | ||
75 | e29,065 | ||
76 | e30,066 | ||
77 | e31,067 | ||
78 | clv,068 | ||
79 | sps,069 | ||
80 | mdl,070 | ||
81 | edw,071 | ||
82 | bti,072 | ||
83 | hdi,073 | ||
84 | lbi,074 | ||
85 | fui,075 | ||
86 | eri,076 | ||
87 | btc,085 | ||
88 | pci,087 | ||
89 | dbi,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 @@ | |||
1 | dbg,000 | ||
2 | syi,001 | ||
3 | ubp,002 | ||
4 | fup,003 | ||
5 | bok,004 | ||
6 | hld,005 | ||
7 | rtc,006 | ||
8 | mid,007 | ||
9 | pcd,008 | ||
10 | ser,009 | ||
11 | ufn,010 | ||
12 | kas,011 | ||
13 | shp,012 | ||
14 | tst,013 | ||
15 | gty,014 | ||
16 | fmp,015 | ||
17 | sdp,016 | ||
18 | ncp,017 | ||
19 | psk,018 | ||
20 | pts,077 | ||
21 | btc,085 | ||
22 | bpr,019 | ||
23 | bfp,020 | ||
24 | bfd,021 | ||
25 | bml,022 | ||
26 | apd,078 | ||
27 | blf,079 | ||
28 | slp,080 | ||
29 | vrt,081 | ||
30 | fni,082 | ||
31 | sid,083 | ||
32 | mlk,084 | ||
33 | mso,086 | ||
34 | sdc,089 | ||
35 | cng,023 | ||
36 | dba,024 | ||
37 | dbv,025 | ||
38 | dor,026 | ||
39 | rnd,027 | ||
40 | skd,028 | ||
41 | sfi,029 | ||
42 | mdk,030 | ||
43 | dcc,031 | ||
44 | skt,032 | ||
45 | mtm,033 | ||
46 | tr0,034 | ||
47 | tr1,035 | ||
48 | e00,036 | ||
49 | e01,037 | ||
50 | e02,038 | ||
51 | e03,039 | ||
52 | e04,040 | ||
53 | e05,041 | ||
54 | e06,042 | ||
55 | e07,043 | ||
56 | e08,044 | ||
57 | e09,045 | ||
58 | e10,046 | ||
59 | e11,047 | ||
60 | e12,048 | ||
61 | e13,049 | ||
62 | e14,050 | ||
63 | e15,051 | ||
64 | e16,052 | ||
65 | e17,053 | ||
66 | e18,054 | ||
67 | e19,055 | ||
68 | e20,056 | ||
69 | e21,057 | ||
70 | e22,058 | ||
71 | e23,059 | ||
72 | e24,060 | ||
73 | e25,061 | ||
74 | e26,062 | ||
75 | e27,063 | ||
76 | e28,064 | ||
77 | e29,065 | ||
78 | e30,066 | ||
79 | e31,067 | ||
80 | clv,068 | ||
81 | sps,069 | ||
82 | mdl,070 | ||
83 | edw,071 | ||
84 | bti,072 | ||
85 | hdi,073 | ||
86 | lbi,074 | ||
87 | fui,075 | ||
88 | eri,076 | ||
89 | pci,087 | ||
90 | dbi,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 @@ | |||
1 | dbg,000 | ||
2 | syi,001 | ||
3 | ubp,002 | ||
4 | fup,003 | ||
5 | bok,004 | ||
6 | hld,005 | ||
7 | rtc,006 | ||
8 | mid,007 | ||
9 | pcd,008 | ||
10 | ser,009 | ||
11 | ufn,010 | ||
12 | kas,011 | ||
13 | shp,012 | ||
14 | tst,013 | ||
15 | gty,014 | ||
16 | fmp,015 | ||
17 | sdp,016 | ||
18 | ncp,017 | ||
19 | psk,018 | ||
20 | pts,077 | ||
21 | btc,085 | ||
22 | bpr,019 | ||
23 | bfp,020 | ||
24 | bfd,021 | ||
25 | bml,022 | ||
26 | apd,078 | ||
27 | blf,079 | ||
28 | slp,080 | ||
29 | vrt,081 | ||
30 | fni,082 | ||
31 | sid,083 | ||
32 | mlk,084 | ||
33 | mso,086 | ||
34 | sdc,089 | ||
35 | cng,023 | ||
36 | dba,024 | ||
37 | dbv,025 | ||
38 | dor,026 | ||
39 | rnd,027 | ||
40 | skd,028 | ||
41 | sfi,029 | ||
42 | mdk,030 | ||
43 | dcc,031 | ||
44 | skt,032 | ||
45 | mtm,033 | ||
46 | tr0,034 | ||
47 | tr1,035 | ||
48 | e00,036 | ||
49 | e01,037 | ||
50 | e02,038 | ||
51 | e03,039 | ||
52 | e04,040 | ||
53 | e05,041 | ||
54 | e06,042 | ||
55 | e07,043 | ||
56 | e08,044 | ||
57 | e09,045 | ||
58 | e10,046 | ||
59 | e11,047 | ||
60 | e12,048 | ||
61 | e13,049 | ||
62 | e14,050 | ||
63 | e15,051 | ||
64 | e16,052 | ||
65 | e17,053 | ||
66 | e18,054 | ||
67 | e19,055 | ||
68 | e20,056 | ||
69 | e21,057 | ||
70 | e22,058 | ||
71 | e23,059 | ||
72 | e24,060 | ||
73 | e25,061 | ||
74 | e26,062 | ||
75 | e27,063 | ||
76 | e28,064 | ||
77 | e29,065 | ||
78 | e30,066 | ||
79 | e31,067 | ||
80 | clv,068 | ||
81 | sps,069 | ||
82 | mdl,070 | ||
83 | edw,071 | ||
84 | bti,072 | ||
85 | hdi,073 | ||
86 | lbi,074 | ||
87 | fui,075 | ||
88 | eri,076 | ||
89 | pci,087 | ||
90 | dbi,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 @@ | |||
1 | dbg,000 | ||
2 | bti,001 | ||
3 | hdi,002 | ||
4 | cng,003 | ||
5 | ser,004 | ||
6 | app,005 | ||
7 | eri,006 | ||
8 | dcc,007 | ||
9 | mdl,008 | ||
10 | fup,009 | ||
11 | bok,010 | ||
12 | shp,011 | ||
13 | dba,012 | ||
14 | dbv,013 | ||
15 | tr0,014 | ||
16 | tr1,015 | ||
17 | mid,016 | ||
18 | tst,017 | ||
19 | gty,018 | ||
20 | fui,019 | ||
21 | lbi,020 | ||
22 | dor,021 | ||
23 | edw,022 | ||
24 | ubp,023 | ||
25 | syi,024 | ||
26 | exm,025 | ||
27 | pcd,026 | ||
28 | rnd,028 | ||
29 | ufn,029 | ||
30 | sdp,030 | ||
31 | ncp,031 | ||
32 | kas,032 | ||
33 | rtc,034 | ||
34 | bpr,035 | ||
35 | e00,036 | ||
36 | e01,037 | ||
37 | e02,038 | ||
38 | e03,039 | ||
39 | e04,040 | ||
40 | e05,041 | ||
41 | e06,042 | ||
42 | e07,043 | ||
43 | e08,044 | ||
44 | e09,045 | ||
45 | e10,046 | ||
46 | e11,047 | ||
47 | e12,048 | ||
48 | e13,049 | ||
49 | e14,050 | ||
50 | e15,051 | ||
51 | e16,052 | ||
52 | e17,053 | ||
53 | e18,054 | ||
54 | e19,055 | ||
55 | e20,056 | ||
56 | e21,057 | ||
57 | e22,058 | ||
58 | e23,059 | ||
59 | e24,060 | ||
60 | e25,061 | ||
61 | e26,062 | ||
62 | e27,063 | ||
63 | e28,064 | ||
64 | e29,065 | ||
65 | e30,066 | ||
66 | e31,067 | ||
67 | clv,068 | ||
68 | slp,069 | ||
69 | ipt,070 | ||
70 | pts,075 | ||
71 | skt,076 | ||
72 | mac,077 | ||
73 | apd,078 | ||
74 | blf,079 | ||
75 | hld,080 | ||
76 | skd,081 | ||
77 | fmp,082 | ||
78 | sps,083 | ||
79 | msc,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 @@ | |||
1 | dbg,000 | ||
2 | bti,001 | ||
3 | hdi,002 | ||
4 | cng,003 | ||
5 | ser,004 | ||
6 | app,005 | ||
7 | eri,006 | ||
8 | dcc,007 | ||
9 | mdl,008 | ||
10 | fup,009 | ||
11 | bok,010 | ||
12 | shp,011 | ||
13 | dba,012 | ||
14 | dbv,013 | ||
15 | tr0,014 | ||
16 | tr1,015 | ||
17 | mid,016 | ||
18 | tst,017 | ||
19 | gty,018 | ||
20 | fui,019 | ||
21 | lbi,020 | ||
22 | dor,021 | ||
23 | edw,022 | ||
24 | ubp,023 | ||
25 | syi,024 | ||
26 | exm,025 | ||
27 | pcd,026 | ||
28 | btc,027 | ||
29 | rnd,028 | ||
30 | ufn,029 | ||
31 | sdp,030 | ||
32 | ncp,031 | ||
33 | kas,032 | ||
34 | sfi,033 | ||
35 | rtc,034 | ||
36 | bpr,035 | ||
37 | e00,036 | ||
38 | e01,037 | ||
39 | e02,038 | ||
40 | e03,039 | ||
41 | e04,040 | ||
42 | e05,041 | ||
43 | e06,042 | ||
44 | e07,043 | ||
45 | e08,044 | ||
46 | e09,045 | ||
47 | e10,046 | ||
48 | e11,047 | ||
49 | e12,048 | ||
50 | e13,049 | ||
51 | e14,050 | ||
52 | e15,051 | ||
53 | e16,052 | ||
54 | e17,053 | ||
55 | e18,054 | ||
56 | e19,055 | ||
57 | e20,056 | ||
58 | e21,057 | ||
59 | e22,058 | ||
60 | e23,059 | ||
61 | e24,060 | ||
62 | e25,061 | ||
63 | e26,062 | ||
64 | e27,063 | ||
65 | e28,064 | ||
66 | e29,065 | ||
67 | e30,066 | ||
68 | e31,067 | ||
69 | clv,068 | ||
70 | slp,069 | ||
71 | ipt,070 | ||
72 | mtm,071 | ||
73 | mcr,072 | ||
74 | mdk,073 | ||
75 | muk,074 | ||
76 | pts,075 | ||
77 | skt,076 | ||
78 | mac,077 | ||
79 | apd,078 | ||
80 | blf,079 | ||
81 | hld,080 | ||
82 | skd,081 | ||
83 | fmp,082 | ||
84 | sps,083 | ||
85 | msc,084 | ||
86 | vrt,085 | ||
87 | psk,086 | ||
88 | bml,087 | ||
89 | bfd,088 | ||
90 | bfp,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 @@ | |||
1 | dbg,000 | ||
2 | bti,001 | ||
3 | hdi,002 | ||
4 | cng,003 | ||
5 | ser,004 | ||
6 | app,005 | ||
7 | eri,006 | ||
8 | dcc,007 | ||
9 | mdl,008 | ||
10 | fup,009 | ||
11 | bok,010 | ||
12 | shp,011 | ||
13 | dba,012 | ||
14 | dbv,013 | ||
15 | tr0,014 | ||
16 | tr1,015 | ||
17 | mid,016 | ||
18 | tst,017 | ||
19 | gty,018 | ||
20 | fui,019 | ||
21 | lbi,020 | ||
22 | dor,021 | ||
23 | edw,022 | ||
24 | ubp,023 | ||
25 | syi,024 | ||
26 | exm,025 | ||
27 | pcd,026 | ||
28 | rnd,028 | ||
29 | ufn,029 | ||
30 | sdp,030 | ||
31 | ncp,031 | ||
32 | kas,032 | ||
33 | rtc,034 | ||
34 | bpr,035 | ||
35 | e00,036 | ||
36 | e01,037 | ||
37 | e02,038 | ||
38 | e03,039 | ||
39 | e04,040 | ||
40 | e05,041 | ||
41 | e06,042 | ||
42 | e07,043 | ||
43 | e08,044 | ||
44 | e09,045 | ||
45 | e10,046 | ||
46 | e11,047 | ||
47 | e12,048 | ||
48 | e13,049 | ||
49 | e14,050 | ||
50 | e15,051 | ||
51 | e16,052 | ||
52 | e17,053 | ||
53 | e18,054 | ||
54 | e19,055 | ||
55 | e20,056 | ||
56 | e21,057 | ||
57 | e22,058 | ||
58 | e23,059 | ||
59 | e24,060 | ||
60 | e25,061 | ||
61 | e26,062 | ||
62 | e27,063 | ||
63 | e28,064 | ||
64 | e29,065 | ||
65 | e30,066 | ||
66 | e31,067 | ||
67 | clv,068 | ||
68 | slp,069 | ||
69 | ipt,070 | ||
70 | pts,075 | ||
71 | skt,076 | ||
72 | mac,077 | ||
73 | apd,078 | ||
74 | blf,079 | ||
75 | hld,080 | ||
76 | skd,081 | ||
77 | fmp,082 | ||
78 | sps,083 | ||
79 | msc,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 @@ | |||
1 | dbg,000 | ||
2 | bti,001 | ||
3 | hdi,002 | ||
4 | cng,003 | ||
5 | ser,004 | ||
6 | app,005 | ||
7 | eri,006 | ||
8 | dcc,007 | ||
9 | mdl,008 | ||
10 | fup,009 | ||
11 | bok,010 | ||
12 | shp,011 | ||
13 | dba,012 | ||
14 | dbv,013 | ||
15 | tr0,014 | ||
16 | tr1,015 | ||
17 | mid,016 | ||
18 | tst,017 | ||
19 | gty,018 | ||
20 | fui,019 | ||
21 | lbi,020 | ||
22 | dor,021 | ||
23 | edw,022 | ||
24 | ubp,023 | ||
25 | syi,024 | ||
26 | exm,025 | ||
27 | pcd,026 | ||
28 | rnd,028 | ||
29 | ufn,029 | ||
30 | sdp,030 | ||
31 | ncp,031 | ||
32 | kas,032 | ||
33 | rtc,034 | ||
34 | bpr,035 | ||
35 | e00,036 | ||
36 | e01,037 | ||
37 | e02,038 | ||
38 | e03,039 | ||
39 | e04,040 | ||
40 | e05,041 | ||
41 | e06,042 | ||
42 | e07,043 | ||
43 | e08,044 | ||
44 | e09,045 | ||
45 | e10,046 | ||
46 | e11,047 | ||
47 | e12,048 | ||
48 | e13,049 | ||
49 | e14,050 | ||
50 | e15,051 | ||
51 | e16,052 | ||
52 | e17,053 | ||
53 | e18,054 | ||
54 | e19,055 | ||
55 | e20,056 | ||
56 | e21,057 | ||
57 | e22,058 | ||
58 | e23,059 | ||
59 | e24,060 | ||
60 | e25,061 | ||
61 | e26,062 | ||
62 | e27,063 | ||
63 | e28,064 | ||
64 | e29,065 | ||
65 | e30,066 | ||
66 | e31,067 | ||
67 | clv,068 | ||
68 | slp,069 | ||
69 | ipt,070 | ||
70 | pts,075 | ||
71 | skt,076 | ||
72 | mac,077 | ||
73 | apd,078 | ||
74 | blf,079 | ||
75 | hld,080 | ||
76 | skd,081 | ||
77 | fmp,082 | ||
78 | sps,083 | ||
79 | msc,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 @@ | |||
1 | dbg,000 | ||
2 | bti,001 | ||
3 | hdi,002 | ||
4 | cng,003 | ||
5 | ser,004 | ||
6 | app,005 | ||
7 | eri,006 | ||
8 | dcc,007 | ||
9 | mdl,008 | ||
10 | fup,009 | ||
11 | bok,010 | ||
12 | shp,011 | ||
13 | dba,012 | ||
14 | dbv,013 | ||
15 | tr0,014 | ||
16 | tr1,015 | ||
17 | mid,016 | ||
18 | tst,017 | ||
19 | gty,018 | ||
20 | fui,019 | ||
21 | lbi,020 | ||
22 | dor,021 | ||
23 | edw,022 | ||
24 | ubp,023 | ||
25 | syi,024 | ||
26 | exm,025 | ||
27 | pcd,026 | ||
28 | btc,027 | ||
29 | rnd,028 | ||
30 | ufn,029 | ||
31 | sdp,030 | ||
32 | ncp,031 | ||
33 | kas,032 | ||
34 | sfi,033 | ||
35 | rtc,034 | ||
36 | bpr,035 | ||
37 | e00,036 | ||
38 | e01,037 | ||
39 | e02,038 | ||
40 | e03,039 | ||
41 | e04,040 | ||
42 | e05,041 | ||
43 | e06,042 | ||
44 | e07,043 | ||
45 | e08,044 | ||
46 | e09,045 | ||
47 | e10,046 | ||
48 | e11,047 | ||
49 | e12,048 | ||
50 | e13,049 | ||
51 | e14,050 | ||
52 | e15,051 | ||
53 | e16,052 | ||
54 | e17,053 | ||
55 | e18,054 | ||
56 | e19,055 | ||
57 | e20,056 | ||
58 | e21,057 | ||
59 | e22,058 | ||
60 | e23,059 | ||
61 | e24,060 | ||
62 | e25,061 | ||
63 | e26,062 | ||
64 | e27,063 | ||
65 | e28,064 | ||
66 | e29,065 | ||
67 | e30,066 | ||
68 | e31,067 | ||
69 | clv,068 | ||
70 | slp,069 | ||
71 | ipt,070 | ||
72 | mtm,071 | ||
73 | mcr,072 | ||
74 | mdk,073 | ||
75 | muk,074 | ||
76 | pts,075 | ||
77 | skt,076 | ||
78 | mac,077 | ||
79 | apd,078 | ||
80 | blf,079 | ||
81 | hld,080 | ||
82 | skd,081 | ||
83 | fmp,082 | ||
84 | sps,083 | ||
85 | msc,084 | ||
86 | vrt,085 | ||
87 | psk,086 | ||
88 | bml,087 | ||
89 | bfd,088 | ||
90 | bfp,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 @@ | |||
1 | dbg,000 | ||
2 | syi,001 | ||
3 | ubp,002 | ||
4 | fup,003 | ||
5 | bok,004 | ||
6 | hld,005 | ||
7 | rtc,006 | ||
8 | mid,007 | ||
9 | pcd,008 | ||
10 | ser,009 | ||
11 | ufn,010 | ||
12 | kas,011 | ||
13 | shp,012 | ||
14 | tst,013 | ||
15 | gty,014 | ||
16 | fmp,015 | ||
17 | sdp,016 | ||
18 | ncp,017 | ||
19 | psk,018 | ||
20 | pts,077 | ||
21 | bpr,019 | ||
22 | bfp,020 | ||
23 | bfd,021 | ||
24 | bml,022 | ||
25 | apd,078 | ||
26 | blf,079 | ||
27 | slp,080 | ||
28 | vrt,081 | ||
29 | fni,082 | ||
30 | sid,083 | ||
31 | mlk,084 | ||
32 | mso,086 | ||
33 | cng,023 | ||
34 | dba,024 | ||
35 | dbv,025 | ||
36 | dor,026 | ||
37 | rnd,027 | ||
38 | skd,028 | ||
39 | sfi,029 | ||
40 | mdk,030 | ||
41 | dcc,031 | ||
42 | skt,032 | ||
43 | mtm,033 | ||
44 | tr0,034 | ||
45 | tr1,035 | ||
46 | e00,036 | ||
47 | e01,037 | ||
48 | e02,038 | ||
49 | e03,039 | ||
50 | e04,040 | ||
51 | e05,041 | ||
52 | e06,042 | ||
53 | e07,043 | ||
54 | e08,044 | ||
55 | e09,045 | ||
56 | e10,046 | ||
57 | e11,047 | ||
58 | e12,048 | ||
59 | e13,049 | ||
60 | e14,050 | ||
61 | e15,051 | ||
62 | e16,052 | ||
63 | e17,053 | ||
64 | e18,054 | ||
65 | e19,055 | ||
66 | e20,056 | ||
67 | e21,057 | ||
68 | e22,058 | ||
69 | e23,059 | ||
70 | e24,060 | ||
71 | e25,061 | ||
72 | e26,062 | ||
73 | e27,063 | ||
74 | e28,064 | ||
75 | e29,065 | ||
76 | e30,066 | ||
77 | e31,067 | ||
78 | clv,068 | ||
79 | sps,069 | ||
80 | mdl,070 | ||
81 | edw,071 | ||
82 | bti,072 | ||
83 | hdi,073 | ||
84 | lbi,074 | ||
85 | fui,075 | ||
86 | eri,076 | ||
87 | btc,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 @@ | |||
1 | dbg,000 | ||
2 | syi,001 | ||
3 | ubp,002 | ||
4 | fup,003 | ||
5 | bok,004 | ||
6 | hld,005 | ||
7 | rtc,006 | ||
8 | mid,007 | ||
9 | pcd,008 | ||
10 | ser,009 | ||
11 | ufn,010 | ||
12 | kas,011 | ||
13 | shp,012 | ||
14 | tst,013 | ||
15 | gty,014 | ||
16 | fmp,015 | ||
17 | sdp,016 | ||
18 | ncp,017 | ||
19 | psk,018 | ||
20 | pts,077 | ||
21 | bpr,019 | ||
22 | bfp,020 | ||
23 | bfd,021 | ||
24 | bml,022 | ||
25 | apd,078 | ||
26 | blf,079 | ||
27 | slp,080 | ||
28 | vrt,081 | ||
29 | fni,082 | ||
30 | sid,083 | ||
31 | mlk,084 | ||
32 | mso,086 | ||
33 | cng,023 | ||
34 | dba,024 | ||
35 | dbv,025 | ||
36 | dor,026 | ||
37 | rnd,027 | ||
38 | skd,028 | ||
39 | sfi,029 | ||
40 | mdk,030 | ||
41 | dcc,031 | ||
42 | skt,032 | ||
43 | mtm,033 | ||
44 | tr0,034 | ||
45 | tr1,035 | ||
46 | e00,036 | ||
47 | e01,037 | ||
48 | e02,038 | ||
49 | e03,039 | ||
50 | e04,040 | ||
51 | e05,041 | ||
52 | e06,042 | ||
53 | e07,043 | ||
54 | e08,044 | ||
55 | e09,045 | ||
56 | e10,046 | ||
57 | e11,047 | ||
58 | e12,048 | ||
59 | e13,049 | ||
60 | e14,050 | ||
61 | e15,051 | ||
62 | e16,052 | ||
63 | e17,053 | ||
64 | e18,054 | ||
65 | e19,055 | ||
66 | e20,056 | ||
67 | e21,057 | ||
68 | e22,058 | ||
69 | e23,059 | ||
70 | e24,060 | ||
71 | e25,061 | ||
72 | e26,062 | ||
73 | e27,063 | ||
74 | e28,064 | ||
75 | e29,065 | ||
76 | e30,066 | ||
77 | e31,067 | ||
78 | clv,068 | ||
79 | sps,069 | ||
80 | mdl,070 | ||
81 | edw,071 | ||
82 | bti,072 | ||
83 | hdi,073 | ||
84 | lbi,074 | ||
85 | fui,075 | ||
86 | eri,076 | ||
87 | btc,085 | ||
88 | pci,087 | ||
89 | dbi,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 @@ | |||
1 | dbg,000 | ||
2 | bti,001 | ||
3 | hdi,002 | ||
4 | cng,003 | ||
5 | ser,004 | ||
6 | app,005 | ||
7 | eri,006 | ||
8 | dcc,007 | ||
9 | mdl,008 | ||
10 | fup,009 | ||
11 | bok,010 | ||
12 | shp,011 | ||
13 | dba,012 | ||
14 | dbv,013 | ||
15 | tr0,014 | ||
16 | tr1,015 | ||
17 | mid,016 | ||
18 | tst,017 | ||
19 | gty,018 | ||
20 | fui,019 | ||
21 | lbi,020 | ||
22 | dor,021 | ||
23 | edw,022 | ||
24 | ubp,023 | ||
25 | syi,024 | ||
26 | exm,025 | ||
27 | pcd,026 | ||
28 | btc,027 | ||
29 | rnd,028 | ||
30 | ufn,029 | ||
31 | sdp,030 | ||
32 | ncp,031 | ||
33 | kas,032 | ||
34 | sfi,033 | ||
35 | rtc,034 | ||
36 | bpr,035 | ||
37 | e00,036 | ||
38 | e01,037 | ||
39 | e02,038 | ||
40 | e03,039 | ||
41 | e04,040 | ||
42 | e05,041 | ||
43 | e06,042 | ||
44 | e07,043 | ||
45 | e08,044 | ||
46 | e09,045 | ||
47 | e10,046 | ||
48 | e11,047 | ||
49 | e12,048 | ||
50 | e13,049 | ||
51 | e14,050 | ||
52 | e15,051 | ||
53 | e16,052 | ||
54 | e17,053 | ||
55 | e18,054 | ||
56 | e19,055 | ||
57 | e20,056 | ||
58 | e21,057 | ||
59 | e22,058 | ||
60 | e23,059 | ||
61 | e24,060 | ||
62 | e25,061 | ||
63 | e26,062 | ||
64 | e27,063 | ||
65 | e28,064 | ||
66 | e29,065 | ||
67 | e30,066 | ||
68 | e31,067 | ||
69 | clv,068 | ||
70 | slp,069 | ||
71 | ipt,070 | ||
72 | mtm,071 | ||
73 | mcr,072 | ||
74 | mdk,073 | ||
75 | muk,074 | ||
76 | pts,075 | ||
77 | skt,076 | ||
78 | mac,077 | ||
79 | apd,078 | ||
80 | blf,079 | ||
81 | hld,080 | ||
82 | skd,081 | ||
83 | fmp,082 | ||
84 | sps,083 | ||
85 | msc,084 | ||
86 | vrt,085 | ||
87 | psk,086 | ||
88 | bml,087 | ||
89 | bfd,088 | ||
90 | bfp,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 @@ | |||
1 | dbg,000 | ||
2 | syi,001 | ||
3 | ubp,002 | ||
4 | fup,003 | ||
5 | bok,004 | ||
6 | hld,005 | ||
7 | rtc,006 | ||
8 | mid,007 | ||
9 | pcd,008 | ||
10 | ser,009 | ||
11 | ufn,010 | ||
12 | kas,011 | ||
13 | shp,012 | ||
14 | tst,013 | ||
15 | gty,014 | ||
16 | fmp,015 | ||
17 | sdp,016 | ||
18 | ncp,017 | ||
19 | psk,018 | ||
20 | pts,077 | ||
21 | btc,085 | ||
22 | bpr,019 | ||
23 | bfp,020 | ||
24 | bfd,021 | ||
25 | bml,022 | ||
26 | apd,078 | ||
27 | blf,079 | ||
28 | slp,080 | ||
29 | vrt,081 | ||
30 | fni,082 | ||
31 | sid,083 | ||
32 | mlk,084 | ||
33 | mso,086 | ||
34 | sdc,089 | ||
35 | cng,023 | ||
36 | dba,024 | ||
37 | dbv,025 | ||
38 | dor,026 | ||
39 | rnd,027 | ||
40 | skd,028 | ||
41 | sfi,029 | ||
42 | mdk,030 | ||
43 | dcc,031 | ||
44 | skt,032 | ||
45 | mtm,033 | ||
46 | tr0,034 | ||
47 | tr1,035 | ||
48 | e00,036 | ||
49 | e01,037 | ||
50 | e02,038 | ||
51 | e03,039 | ||
52 | e04,040 | ||
53 | e05,041 | ||
54 | e06,042 | ||
55 | e07,043 | ||
56 | e08,044 | ||
57 | e09,045 | ||
58 | e10,046 | ||
59 | e11,047 | ||
60 | e12,048 | ||
61 | e13,049 | ||
62 | e14,050 | ||
63 | e15,051 | ||
64 | e16,052 | ||
65 | e17,053 | ||
66 | e18,054 | ||
67 | e19,055 | ||
68 | e20,056 | ||
69 | e21,057 | ||
70 | e22,058 | ||
71 | e23,059 | ||
72 | e24,060 | ||
73 | e25,061 | ||
74 | e26,062 | ||
75 | e27,063 | ||
76 | e28,064 | ||
77 | e29,065 | ||
78 | e30,066 | ||
79 | e31,067 | ||
80 | clv,068 | ||
81 | sps,069 | ||
82 | mdl,070 | ||
83 | edw,071 | ||
84 | bti,072 | ||
85 | hdi,073 | ||
86 | lbi,074 | ||
87 | fui,075 | ||
88 | eri,076 | ||
89 | pci,087 | ||
90 | dbi,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 @@ | |||
1 | dbg,000 | ||
2 | bti,001 | ||
3 | hdi,002 | ||
4 | cng,003 | ||
5 | ser,004 | ||
6 | app,005 | ||
7 | eri,006 | ||
8 | dcc,007 | ||
9 | mdl,008 | ||
10 | fup,009 | ||
11 | bok,010 | ||
12 | shp,011 | ||
13 | dba,012 | ||
14 | dbv,013 | ||
15 | tr0,014 | ||
16 | tr1,015 | ||
17 | mid,016 | ||
18 | tst,017 | ||
19 | gty,018 | ||
20 | fui,019 | ||
21 | lbi,020 | ||
22 | dor,021 | ||
23 | edw,022 | ||
24 | ubp,023 | ||
25 | syi,024 | ||
26 | exm,025 | ||
27 | pcd,026 | ||
28 | cgp,027 | ||
29 | rnd,028 | ||
30 | ufn,029 | ||
31 | sdp,030 | ||
32 | ncp,031 | ||
33 | kas,032 | ||
34 | sfi,033 | ||
35 | rtc,034 | ||
36 | bpr,035 | ||
37 | e00,036 | ||
38 | e01,037 | ||
39 | e02,038 | ||
40 | e03,039 | ||
41 | e04,040 | ||
42 | e05,041 | ||
43 | e06,042 | ||
44 | e07,043 | ||
45 | e08,044 | ||
46 | e09,045 | ||
47 | e10,046 | ||
48 | e11,047 | ||
49 | e12,048 | ||
50 | e13,049 | ||
51 | e14,050 | ||
52 | e15,051 | ||
53 | e16,052 | ||
54 | e17,053 | ||
55 | e18,054 | ||
56 | e19,055 | ||
57 | e20,056 | ||
58 | e21,057 | ||
59 | e22,058 | ||
60 | e23,059 | ||
61 | e24,060 | ||
62 | e25,061 | ||
63 | e26,062 | ||
64 | e27,063 | ||
65 | e28,064 | ||
66 | e29,065 | ||
67 | e30,066 | ||
68 | e31,067 | ||
69 | clv,068 | ||
70 | slp,069 | ||
71 | ipt,070 | ||
72 | mtm,071 | ||
73 | mcr,072 | ||
74 | mdk,073 | ||
75 | muk,074 | ||
76 | pts,075 | ||
77 | skt,076 | ||
78 | mac,077 | ||
79 | apd,078 | ||
80 | blf,079 | ||
81 | hld,080 | ||
82 | skd,081 | ||
83 | fmp,082 | ||
84 | sps,083 | ||
85 | msc,084 | ||
86 | vrt,085 | ||
87 | psk,086 | ||
88 | bml,087 | ||
89 | bfd,088 | ||
90 | bfp,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 | # | ||
10 | if [ "$#" -lt 1 ]; then | ||
11 | >&2 echo "usage: parse_all_nvp_header.sh /path/to/directory" | ||
12 | exit 1 | ||
13 | fi | ||
14 | |||
15 | # list interesting directories | ||
16 | for dir in `find "$1" -maxdepth 1 -name "nw-*" -or -name "nwz-*"` | ||
17 | do | ||
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" | ||
33 | done | ||
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 | # | ||
8 | if [ "$#" -lt 1 ]; then | ||
9 | >&2 echo "usage: parse_all_nvp_header.sh /path/to/directory" | ||
10 | exit 1 | ||
11 | fi | ||
12 | |||
13 | # list interesting directories | ||
14 | for dir in `find "$1" -maxdepth 1 -name "nw-*" -or -name "nwz-*"` | ||
15 | do | ||
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" | ||
31 | done | ||
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 | # | ||
8 | if [ "$#" -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 | ||
11 | fi | ||
12 | |||
13 | FILE="$1" | ||
14 | IN_TGZ="0" | ||
15 | FILTER="$2" | ||
16 | |||
17 | # for directories, list all files | ||
18 | if [ -d "$FILE" ]; then | ||
19 | LIST=`find "$FILE"` | ||
20 | else | ||
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 | ||
30 | fi | ||
31 | |||
32 | # apply user filter | ||
33 | if [ "$FILTER" != "" ]; then | ||
34 | LIST=`echo "$LIST" | grep "$FILTER"` | ||
35 | fi | ||
36 | # if file contains icx_nvp_emmc.h, we want that | ||
37 | if [ "`echo "$LIST" | grep "icx_nvp_emmc.h" | wc -l`" = "1" ]; then | ||
38 | LIST=`echo "$LIST" | grep "icx_nvp_emmc.h"` | ||
39 | else | ||
40 | LIST=`echo "$LIST" | grep 'icx[[:digit:]]*_nvp[[:alpha:]_]*.h'` | ||
41 | fi | ||
42 | LIST_CNT=`echo "$LIST" | wc -l` | ||
43 | if [ "$LIST_CNT" = "0" ]; then | ||
44 | >&2 echo "No icx nvp file found" | ||
45 | exit 1 | ||
46 | elif [ "$LIST_CNT" != "1" ]; then | ||
47 | >&2 echo "Several matches for icx nvp:" | ||
48 | >&2 echo "$LIST" | ||
49 | exit 1 | ||
50 | else | ||
51 | FILE="$LIST" | ||
52 | fi | ||
53 | |||
54 | # if file is in archive, we need to extract it | ||
55 | if [ "$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" | ||
64 | else | ||
65 | >&2 echo "Analyzing $FILE" | ||
66 | fi | ||
67 | |||
68 | cat "$FILE" | awk ' \ | ||
69 | BEGIN { \ | ||
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 | # | ||
6 | if [ "$#" -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 | ||
9 | fi | ||
10 | |||
11 | FILE="$1" | ||
12 | IN_TGZ="0" | ||
13 | OUTPUT="$2" | ||
14 | |||
15 | # for directories, list all files | ||
16 | if [ -d "$FILE" ]; then | ||
17 | LIST=`find "$FILE"` | ||
18 | else | ||
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 | ||
28 | fi | ||
29 | |||
30 | # look for icx_nvp_emmc.ko | ||
31 | LIST=`echo "$LIST" | grep "icx[[:digit:]]*_nvp[[:alpha:]_]*.ko"` | ||
32 | LIST_CNT=`echo "$LIST" | wc -l` | ||
33 | if [ "$LIST" == "" ]; then | ||
34 | >&2 echo "No icx nvp file found" | ||
35 | exit 1 | ||
36 | elif [ "$LIST_CNT" != "1" ]; then | ||
37 | >&2 echo "Several matches for icx nvp:" | ||
38 | >&2 echo "$LIST" | ||
39 | exit 1 | ||
40 | else | ||
41 | FILE="$LIST" | ||
42 | fi | ||
43 | |||
44 | # if file is in archive, we need to extract it | ||
45 | if [ "$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" | ||
54 | else | ||
55 | >&2 echo "Analyzing $FILE" | ||
56 | fi | ||
57 | |||
58 | ./nvptool -x "$FILE" -o "$OUTPUT" >/dev/null | ||