diff options
Diffstat (limited to 'utils/nwztools/database/nvp')
-rw-r--r-- | utils/nwztools/database/nvp/README | 39 | ||||
-rw-r--r-- | utils/nwztools/database/nvp/nwz-x1000.txt | 82 | ||||
-rwxr-xr-x | utils/nwztools/database/nvp/parse_nvp_header.sh | 7 | ||||
-rwxr-xr-x | utils/nwztools/database/nvp/parse_nvp_nodes.sh | 5 |
4 files changed, 111 insertions, 22 deletions
diff --git a/utils/nwztools/database/nvp/README b/utils/nwztools/database/nvp/README index cb403291c8..5ff18513d7 100644 --- a/utils/nwztools/database/nvp/README +++ b/utils/nwztools/database/nvp/README | |||
@@ -1,38 +1,39 @@ | |||
1 | The NVP map varies a lot from players to players, it is inconceivable to build | 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. | 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 | 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 | 4 | downloading all of them. A bit of background on the NVP: it is non-volatile |
5 | area of the flash that is divided in regions and then "sectors" (unrelated to | 5 | partition of the flash that is divided in regions and then "zones". |
6 | hard drive sectors). Each "sector" stores the data of a "node". The ABI | 6 | Each "zone" stores the data of a "node". The ABI |
7 | between the NVP driver and the userspace is an index: the userspace gives the | 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 | 8 | index of a node, and then drives looks up its table to see where it is and what |
9 | is its size. The index map changes over time so Sony introduces standard "names" | 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") | 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 | 11 | that have a corresponding index. Sometimes the driver also contains a |
12 | description of the nodes, in english (so "bti" stands for "boot image"). | 12 | description of the nodes, in English (e.g. "bti" stands for "boot image"). |
13 | 13 | ||
14 | parse_nvp_header.sh | 14 | parse_nvp_header.sh |
15 | =================== | 15 | =================== |
16 | 16 | ||
17 | This script is given a file name, a kernel directory or a kernel tgz and it will | 17 | This script takes a header filename, a kernel directory or a kernel tgz and will |
18 | try to extract the mapping automatically. It produces a list of pairs | 18 | try to extract the mapping automatically. It produces a list of pairs |
19 | <node>,<name> | 19 | <node>,<name> |
20 | where <node> is the index of the node (that's the only thing that is usable on | 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 | 21 | a running device) and <name> is the standard name of the node. The output should |
22 | some kind of acronym (like 'fup') and the description needs to be generated | 22 | be written to <series name>.txt |
23 | separatly (see other section). | 23 | Note that <name> is an acronym (like 'fup') and the description needs to be generated |
24 | separately (see nvprool section). | ||
24 | 25 | ||
25 | parse_all_nvp_headers.sh | 26 | parse_all_nvp_headers.sh |
26 | ======================== | 27 | ======================== |
27 | 28 | ||
28 | This scripts expects a directory to have the following structure: | 29 | This script expects a directory to have the following structure: |
29 | dir/ | 30 | dir/ |
30 | nwz-a10/ | 31 | nwz-a10/ |
31 | linux-kernel-*.tgz | 32 | linux-kernel-*.tgz |
32 | nwz-e460/ | 33 | nwz-e460/ |
33 | linxu-kernel-*.tgz | 34 | linux-kernel-*.tgz |
34 | ... | 35 | ... |
35 | Each sudirectory must the series name (as used in ../series.txt) and the kernel | 36 | Each sudirectory must be 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 | 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 | 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 | will then run parse_nvp_header.sh on each of them and store the result in a |
@@ -43,24 +44,24 @@ NOTE: the kernel can be symlinks to other files | |||
43 | nvptool | 44 | nvptool |
44 | ======= | 45 | ======= |
45 | 46 | ||
46 | The kernel headers do no contain the description of the nvp node names. | 47 | The kernel headers do not contain descriptions of the nvp node names. |
47 | This one can be extract from the icx_nvp[_emmc].ko driver on target using complicated | 48 | They can be extracted 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 | elf parsing done by nvptool. Technically nvptool can discover much more information |
49 | like the node -> humanname mapping as well and the actual sector on the disk but | 50 | like the node -> human name mapping as well and the actual zone in the flash but |
50 | since we can already extract it easily from the headers, we only extract description | 51 | since we can already extract it easily from the headers, we only extract description |
51 | names from it. | 52 | names from it. |
52 | 53 | ||
53 | parse_all_nvp_nodes.sh | 54 | parse_all_nvp_nodes.sh |
54 | ====================== | 55 | ====================== |
55 | 56 | ||
56 | This scripts expects a directory to have the following structure: | 57 | This script expects a directory to have the following structure: |
57 | dir/ | 58 | dir/ |
58 | nwz-a10/ | 59 | nwz-a10/ |
59 | rootfs.tgz | 60 | rootfs.tgz |
60 | nwz-e460/ | 61 | nwz-e460/ |
61 | rootfs.tgz | 62 | rootfs.tgz |
62 | ... | 63 | ... |
63 | Each sudirectory must the series name (as used in ../series.txt) and the rootfs | 64 | Each sudirectory must be 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 | 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 | nvptool on it to produce a file called nodes-<series name>.txt |
66 | 67 | ||
diff --git a/utils/nwztools/database/nvp/nwz-x1000.txt b/utils/nwztools/database/nvp/nwz-x1000.txt new file mode 100644 index 0000000000..ab0f7fb872 --- /dev/null +++ b/utils/nwztools/database/nvp/nwz-x1000.txt | |||
@@ -0,0 +1,82 @@ | |||
1 | app,0 | ||
2 | bti,1 | ||
3 | hdi,2 | ||
4 | cng,3 | ||
5 | ser,4 | ||
6 | dg0,5 | ||
7 | dg1,6 | ||
8 | dcc,7 | ||
9 | mdl,8 | ||
10 | fup,9 | ||
11 | bok,10 | ||
12 | shp,11 | ||
13 | dba,12 | ||
14 | dbv,13 | ||
15 | tr0,14 | ||
16 | tr1,15 | ||
17 | mid,16 | ||
18 | tst,17 | ||
19 | gty,18 | ||
20 | fui,19 | ||
21 | lbi,20 | ||
22 | dor,21 | ||
23 | edw,22 | ||
24 | ubp,23 | ||
25 | syi,24 | ||
26 | var,25 | ||
27 | pcd,26 | ||
28 | dbs,27 | ||
29 | rnd,28 | ||
30 | ufn,29 | ||
31 | sdp,30 | ||
32 | ncp,31 | ||
33 | kas,32 | ||
34 | pnc,33 | ||
35 | rtc,34 | ||
36 | bpr,35 | ||
37 | e00,36 | ||
38 | e01,37 | ||
39 | e02,38 | ||
40 | e03,39 | ||
41 | e04,40 | ||
42 | e05,41 | ||
43 | e06,42 | ||
44 | e07,43 | ||
45 | e08,44 | ||
46 | e09,45 | ||
47 | e10,46 | ||
48 | e11,47 | ||
49 | e12,48 | ||
50 | e13,49 | ||
51 | e14,50 | ||
52 | e15,51 | ||
53 | e16,52 | ||
54 | e17,53 | ||
55 | e18,54 | ||
56 | e19,55 | ||
57 | e20,56 | ||
58 | e21,57 | ||
59 | e22,58 | ||
60 | e23,59 | ||
61 | e24,60 | ||
62 | e25,61 | ||
63 | e26,62 | ||
64 | e27,63 | ||
65 | e28,64 | ||
66 | e29,65 | ||
67 | e30,66 | ||
68 | e31,67 | ||
69 | clv,68 | ||
70 | slp,69 | ||
71 | ipt,70 | ||
72 | ep0,71 | ||
73 | ep1,72 | ||
74 | ep2,73 | ||
75 | ep3,74 | ||
76 | pts,75 | ||
77 | skt,76 | ||
78 | mac,77 | ||
79 | apd,78 | ||
80 | blf,79 | ||
81 | hld,80 | ||
82 | skd,81 | ||
diff --git a/utils/nwztools/database/nvp/parse_nvp_header.sh b/utils/nwztools/database/nvp/parse_nvp_header.sh index 8baab3c9eb..ee2be93516 100755 --- a/utils/nwztools/database/nvp/parse_nvp_header.sh +++ b/utils/nwztools/database/nvp/parse_nvp_header.sh | |||
@@ -66,13 +66,16 @@ else | |||
66 | >&2 echo "Analyzing $FILE" | 66 | >&2 echo "Analyzing $FILE" |
67 | fi | 67 | fi |
68 | 68 | ||
69 | # old format: #define ICX1087_NVP_NODE_APP "/dev/icx1087_nvp/0" | ||
70 | # new format: #define ICX_NVP_NODE_APP ICX_NVP_NODE_BASE "0" | ||
71 | |||
69 | cat "$FILE" | awk ' \ | 72 | cat "$FILE" | awk ' \ |
70 | BEGIN { \ | 73 | BEGIN { \ |
71 | expr = "#define[[:space:]]+ICX_NVP_NODE_([[:alnum:]]+)[[:space:]]+ICX_NVP_NODE_BASE[[:space:]]*\"([[:digit:]]+)\""; \ | 74 | expr = "#define[[:space:]]+ICX[[:digit:]]*_NVP_NODE_([[:alnum:]]+)[[:space:]]+(ICX_NVP_NODE_BASE[[:space:]]*\"|\"/dev.*_nvp/)([[:digit:]]+)\""; |
72 | } \ | 75 | } \ |
73 | { \ | 76 | { \ |
74 | if($0 ~ expr) \ | 77 | if($0 ~ expr) \ |
75 | { \ | 78 | { \ |
76 | print(tolower(gensub(expr, "\\1,\\2", "g", $0))); | 79 | print(tolower(gensub(expr, "\\1,\\3", "g", $0))); |
77 | } \ | 80 | } \ |
78 | }' | 81 | }' |
diff --git a/utils/nwztools/database/nvp/parse_nvp_nodes.sh b/utils/nwztools/database/nvp/parse_nvp_nodes.sh index 456a707e5d..8fc4367a8f 100755 --- a/utils/nwztools/database/nvp/parse_nvp_nodes.sh +++ b/utils/nwztools/database/nvp/parse_nvp_nodes.sh | |||
@@ -4,6 +4,9 @@ | |||
4 | # parse_nodes.sh /path/to/rootfs/dir output_file | 4 | # parse_nodes.sh /path/to/rootfs/dir output_file |
5 | # parse_nodes.sh /path/to/rootfs.tgz output_file | 5 | # parse_nodes.sh /path/to/rootfs.tgz output_file |
6 | # | 6 | # |
7 | if [ -z "$NVP_LOG" ]; then | ||
8 | NVP_LOG=/dev/null | ||
9 | fi | ||
7 | if [ "$#" -lt 2 ]; then | 10 | if [ "$#" -lt 2 ]; then |
8 | >&2 echo "usage: parse_header.sh /path/to/icx_nvp.ko|/path/to/rootfs/dir|/path/to/rootfs.tgz output_file" | 11 | >&2 echo "usage: parse_header.sh /path/to/icx_nvp.ko|/path/to/rootfs/dir|/path/to/rootfs.tgz output_file" |
9 | exit 1 | 12 | exit 1 |
@@ -56,4 +59,4 @@ else | |||
56 | >&2 echo "Analyzing $FILE" | 59 | >&2 echo "Analyzing $FILE" |
57 | fi | 60 | fi |
58 | 61 | ||
59 | ./nvptool -x "$FILE" -o "$OUTPUT" >/dev/null | 62 | ./nvptool -x "$FILE" -o "$OUTPUT" >"$NVP_LOG" |