summaryrefslogtreecommitdiff
path: root/utils/nwztools/database/nvp/nodes-nwz-zx100.txt
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-11-11 15:40:56 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2016-11-11 16:07:14 +0100
commit44bb2856a59be53ef5ede154a39c54a59b1cc6d0 (patch)
treece343ecff309d6d0172ea56946a9ce679329b250 /utils/nwztools/database/nvp/nodes-nwz-zx100.txt
parent19de536ce2f3c8066ca5be9b570f72e5c1e88342 (diff)
downloadrockbox-44bb2856a59be53ef5ede154a39c54a59b1cc6d0.tar.gz
rockbox-44bb2856a59be53ef5ede154a39c54a59b1cc6d0.zip
nwztools/database: add database of information on Sony NWZ linux players
There must be an evil genius in Sony's Walkman division. Someone who made sure that each model is close enough to the previous one so that little code is needed but different enough so that an educated guess is not enough. Each linux-based Sony player has a model ID (mid) which is a 32-bit integer. I was able to extract a list of all model IDs and the correspoding name of the player (see README). This gives us 1) a nice list of all players (because NWZ-A729 vs NWZ-A729B, really Sony?) 2) an easy way to find the name of player programatically. It seems that the lower 8-bit of the model ID gives the storage size but don't bet your life on it. The remaining bytes seem to follow some kind of pattern but there are exceptions. From this list, I was able to build a list of all Sony's series (up to quite recent one). The only safe way to build that is by hand, with a list of series, each series having a list of model IDs. The notion of series is very important because all models in a series share the same firmware. A very important concept on Sony's players is the NVP, an area of the flash that stores data associated with keys. The README contains more information but basically this is where is record the model ID, the destination, the boot flags, the firmware upgrade flags, the boot image, the DRM keys, and a lot of other stuff. Of course Sony decided to slightly tweak the index of the keys regularly over time which means that each series has a potentially different map, and we need this map to talk to the NVP driver. Fortunately, Sony distributes the kernel for all its players and they contain a kernel header with this information. I wrote a script to unpack kernel sources and parse this header, producing a bunch of nw-*.txt files, included in this commit. This map is very specific though: it maps Sony's 3-letter names (bti) to indexes (1). This is not very useful without the decription (bti = boot image) and its size (262144). This information is harder to come by, and is only stored in one place: if icx_nvp_emmc.ko drivers, found on the device. Fortunately, Sony distributes a number of firmware upgrade, that contain the rootfs, than once extracted contain this driver. The driver is a standard ELF files with symbols. I wrote a parsing tool (nvptool) that is able to extract this information from the drivers. Using that, I produced a bunch of nodes-nw*.txt files. A reasonable assumption is that nodes meaning and size do not change over time (bti is always the boot image and is always 262144 bytes), so by merging a few of those file, we can get a complete picture (note that some nodes that existed in older player do not exists anymore so we really need to merge several ones from different generations). The advantage of storing all this information in plain text files, is that it now makes it easy to parse it and produce whatever format we want to use it. I wrote a python script that parses all this mess and produces a C file and header with all this information (nwz_db.{c,h}). Change-Id: Id790581ddd527d64418fe9e4e4df8e0546117b80
Diffstat (limited to 'utils/nwztools/database/nvp/nodes-nwz-zx100.txt')
-rw-r--r--utils/nwztools/database/nvp/nodes-nwz-zx100.txt89
1 files changed, 89 insertions, 0 deletions
diff --git a/utils/nwztools/database/nvp/nodes-nwz-zx100.txt b/utils/nwztools/database/nvp/nodes-nwz-zx100.txt
new file mode 100644
index 0000000000..2beb185b6c
--- /dev/null
+++ b/utils/nwztools/database/nvp/nodes-nwz-zx100.txt
@@ -0,0 +1,89 @@
11,4,system information
22,32,u-boot password
33,4,firmware update flag
44,4,beep ok flag
55,4,hold mode
66,16,rtc alarm
77,64,model id
88,5,product code
99,16,serial number
1010,8,update file name
1111,64,key and signature
1212,32,ship information
1313,4,test mode flag
1414,4,getty mode flag
1515,16,fm parameter
1616,64,sound driver parameter
1717,64,noise cancel driver parameter
1818,512,bluetooth pskey
1977,4,wifi protected setup
2085,4,battery calibration
2119,2048,bluetooth parameter
2220,512,btmw factory pair info
2321,512,btmw factory scdb
2422,4,btmw log mode flag
2578,4,application debug mode flag
2679,4,browser log mode flag
2780,4,time out to sleep
2881,4,europe vol regulation flag
2982,4,function information
3083,4,service id
3184,4,marlin key
3286,4,MSC only mode flag
3389,4,SD Card export flag
3423,704,aad/empr key
3524,160,aad icv
3625,520,empr icv
3726,4,key mode (debug/release)
3827,64,random data
3928,8224,slacker id file
4029,64,starfish id
4130,33024,marlin device key
4231,20,secure clock
4332,16,slacker time
4433,64,marlin time
4534,16384,EKB 0
4635,16384,EKB 1
4736,1024,EMPR 0
4837,1024,EMPR 1
4938,1024,EMPR 2
5039,1024,EMPR 3
5140,1024,EMPR 4
5241,1024,EMPR 5
5342,1024,EMPR 6
5443,1024,EMPR 7
5544,1024,EMPR 8
5645,1024,EMPR 9
5746,1024,EMPR 10
5847,1024,EMPR 11
5948,1024,EMPR 12
6049,1024,EMPR 13
6150,1024,EMPR 14
6251,1024,EMPR 15
6352,1024,EMPR 16
6453,1024,EMPR 17
6554,1024,EMPR 18
6655,1024,EMPR 19
6756,1024,EMPR 20
6857,1024,EMPR 21
6958,1024,EMPR 22
7059,1024,EMPR 23
7160,1024,EMPR 24
7261,1024,EMPR 25
7362,1024,EMPR 26
7463,1024,EMPR 27
7564,1024,EMPR 28
7665,1024,EMPR 29
7766,1024,EMPR 30
7867,1024,EMPR 31
7968,4,color variation
8069,4,speaker ship info
8170,8,middleware parameter
8271,4,quick shutdown flag
8372,262144,boot image
8473,262144,hold image
8574,262144,low battery image
8675,262144,update image
8776,262144,update error image
8887,262144,precharge image
8988,262144,dead battery image