Amaury Pouly | 44bb285 | 2016-11-11 15:40:56 +0100 | [diff] [blame] | 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 |
Igor Skochinsky | 03dd4b9 | 2017-04-03 15:13:46 +0200 | [diff] [blame^] | 4 | downloading all of them. A bit of background on the NVP: it is non-volatile |
| 5 | partition of the flash that is divided in regions and then "zones". |
| 6 | Each "zone" stores the data of a "node". The ABI |
Amaury Pouly | 44bb285 | 2016-11-11 15:40:56 +0100 | [diff] [blame] | 7 | between the NVP driver and the userspace is an index: the userspace gives the |
Igor Skochinsky | 03dd4b9 | 2017-04-03 15:13:46 +0200 | [diff] [blame^] | 8 | index of a node, and then drives looks up its table to see where it is and what |
Amaury Pouly | 44bb285 | 2016-11-11 15:40:56 +0100 | [diff] [blame] | 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") |
Igor Skochinsky | 03dd4b9 | 2017-04-03 15:13:46 +0200 | [diff] [blame^] | 11 | that have a corresponding index. Sometimes the driver also contains a |
| 12 | description of the nodes, in English (e.g. "bti" stands for "boot image"). |
Amaury Pouly | 44bb285 | 2016-11-11 15:40:56 +0100 | [diff] [blame] | 13 | |
| 14 | parse_nvp_header.sh |
| 15 | =================== |
| 16 | |
Igor Skochinsky | 03dd4b9 | 2017-04-03 15:13:46 +0200 | [diff] [blame^] | 17 | This script takes a header filename, a kernel directory or a kernel tgz and will |
Amaury Pouly | 44bb285 | 2016-11-11 15:40:56 +0100 | [diff] [blame] | 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 |
Igor Skochinsky | 03dd4b9 | 2017-04-03 15:13:46 +0200 | [diff] [blame^] | 21 | a running device) and <name> is the standard name of the node. The output should |
| 22 | be written to <series name>.txt |
| 23 | Note that <name> is an acronym (like 'fup') and the description needs to be generated |
| 24 | separately (see nvprool section). |
Amaury Pouly | 44bb285 | 2016-11-11 15:40:56 +0100 | [diff] [blame] | 25 | |
| 26 | parse_all_nvp_headers.sh |
| 27 | ======================== |
| 28 | |
Igor Skochinsky | 03dd4b9 | 2017-04-03 15:13:46 +0200 | [diff] [blame^] | 29 | This script expects a directory to have the following structure: |
Amaury Pouly | 44bb285 | 2016-11-11 15:40:56 +0100 | [diff] [blame] | 30 | dir/ |
| 31 | nwz-a10/ |
| 32 | linux-kernel-*.tgz |
| 33 | nwz-e460/ |
Igor Skochinsky | 03dd4b9 | 2017-04-03 15:13:46 +0200 | [diff] [blame^] | 34 | linux-kernel-*.tgz |
Amaury Pouly | 44bb285 | 2016-11-11 15:40:56 +0100 | [diff] [blame] | 35 | ... |
Igor Skochinsky | 03dd4b9 | 2017-04-03 15:13:46 +0200 | [diff] [blame^] | 36 | Each sudirectory must be the series name (as used in ../series.txt) and the kernel |
Amaury Pouly | 44bb285 | 2016-11-11 15:40:56 +0100 | [diff] [blame] | 37 | must be a tgz (end in .tgz and not .tar.gz) of the form linux-kernel-*.tgz. Usually |
| 38 | the variable bit will be the version but some kernels have unknown versions. It |
| 39 | will then run parse_nvp_header.sh on each of them and store the result in a |
| 40 | file called <series name>.txt |
| 41 | |
| 42 | NOTE: the kernel can be symlinks to other files |
| 43 | |
| 44 | nvptool |
| 45 | ======= |
| 46 | |
Igor Skochinsky | 03dd4b9 | 2017-04-03 15:13:46 +0200 | [diff] [blame^] | 47 | The kernel headers do not contain descriptions of the nvp node names. |
| 48 | They can be extracted from the icx_nvp[_emmc].ko driver on target using complicated |
| 49 | elf parsing done by nvptool. Technically nvptool can discover much more information |
| 50 | like the node -> human name mapping as well and the actual zone in the flash but |
Amaury Pouly | 44bb285 | 2016-11-11 15:40:56 +0100 | [diff] [blame] | 51 | since we can already extract it easily from the headers, we only extract description |
| 52 | names from it. |
| 53 | |
| 54 | parse_all_nvp_nodes.sh |
| 55 | ====================== |
| 56 | |
Igor Skochinsky | 03dd4b9 | 2017-04-03 15:13:46 +0200 | [diff] [blame^] | 57 | This script expects a directory to have the following structure: |
Amaury Pouly | 44bb285 | 2016-11-11 15:40:56 +0100 | [diff] [blame] | 58 | dir/ |
| 59 | nwz-a10/ |
| 60 | rootfs.tgz |
| 61 | nwz-e460/ |
| 62 | rootfs.tgz |
| 63 | ... |
Igor Skochinsky | 03dd4b9 | 2017-04-03 15:13:46 +0200 | [diff] [blame^] | 64 | Each sudirectory must be the series name (as used in ../series.txt) and the rootfs |
Amaury Pouly | 44bb285 | 2016-11-11 15:40:56 +0100 | [diff] [blame] | 65 | must be a tar. It will then extract the relevant icx_nvp driver from it and run |
| 66 | nvptool on it to produce a file called nodes-<series name>.txt |
| 67 | |
| 68 | NOTE: the rootfs can be symlinks to other files |