summaryrefslogtreecommitdiffstats
path: root/utils/nwztools/database/nvp/README
blob: 5ff18513d7728d4cd6913e5a35d993775b194b10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
The NVP map varies a lot from players to players, it is inconceivable to build
it by hand. The approach taken is to extract it from the kernel of each player.
Since Sony provides the kernel of all players, it is 'only' a matter of
downloading all of them. A bit of background on the NVP: it is non-volatile 
partition of the flash that is divided in regions and then "zones". 
Each "zone" stores the data of a "node". The ABI
between the NVP driver and the userspace is an index: the userspace gives the
index of a node, and then drives looks up its table to see where it is and what
is its size. The index map changes over time so Sony introduces standard "names"
for its entries, those are 3-letters acronym (for example "fup" or "bti" or "shp")
that have a corresponding index. Sometimes the driver also contains a
description of the nodes, in English (e.g. "bti" stands for "boot image").

parse_nvp_header.sh
===================

This script takes a header filename, a kernel directory or a kernel tgz and will
try to extract the mapping automatically. It produces a list of pairs
  <node>,<name>
where <node> is the index of the node (that's the only thing that is usable on
a running device) and <name> is the standard name of the node. The output should
be written to <series name>.txt
Note that <name> is an acronym (like 'fup') and the description needs to be generated
separately (see nvprool section).

parse_all_nvp_headers.sh
========================

This script expects a directory to have the following structure:
  dir/
    nwz-a10/
      linux-kernel-*.tgz
    nwz-e460/
      linux-kernel-*.tgz
    ...
Each sudirectory must be the series name (as used in ../series.txt) and the kernel
must be a tgz (end in .tgz and not .tar.gz) of the form linux-kernel-*.tgz. Usually
the variable bit will be the version but some kernels have unknown versions. It
will then run parse_nvp_header.sh on each of them and store the result in a
file called <series name>.txt

NOTE: the kernel can be symlinks to other files

nvptool
=======

The kernel headers do not contain descriptions of the nvp node names.
They can be extracted from the icx_nvp[_emmc].ko driver on target using complicated
elf parsing done by nvptool. Technically nvptool can discover much more information
like the node -> human name mapping as well and the actual zone in the flash but
since we can already extract it easily from the headers, we only extract description
names from it.

parse_all_nvp_nodes.sh
======================

This script expects a directory to have the following structure:
  dir/
    nwz-a10/
      rootfs.tgz
    nwz-e460/
      rootfs.tgz
    ...
Each sudirectory must be the series name (as used in ../series.txt) and the rootfs
must be a tar. It will then extract the relevant icx_nvp driver from it and run
nvptool on it to produce a file called nodes-<series name>.txt

NOTE: the rootfs can be symlinks to other files