rockbox/utils/nwztools/database/nvp/nodes-nwz-a10.txt

90 lines
2.1 KiB
Text
Raw Normal View History

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
2016-11-11 14:40:56 +00:00
1,4,system information
2,32,u-boot password
3,4,firmware update flag
4,4,beep ok flag
5,4,hold mode
6,16,rtc alarm
7,64,model id
8,5,product code
9,16,serial number
10,8,update file name
11,64,key and signature
12,32,ship information
13,4,test mode flag
14,4,getty mode flag
15,16,fm parameter
16,64,sound driver parameter
17,64,noise cancel driver parameter
18,512,bluetooth pskey
77,4,wifi protected setup
85,4,battery calibration
19,2048,bluetooth parameter
20,512,btmw factory pair info
21,512,btmw factory scdb
22,4,btmw log mode flag
78,4,application debug mode flag
79,4,browser log mode flag
80,4,time out to sleep
81,4,europe vol regulation flag
82,4,function information
83,4,service id
84,4,marlin key
86,4,MSC only mode flag
89,4,SD Card export flag
23,704,aad/empr key
24,160,aad icv
25,520,empr icv
26,4,key mode (debug/release)
27,64,random data
28,8224,slacker id file
29,64,starfish id
30,33024,marlin device key
31,20,secure clock
32,16,slacker time
33,64,marlin time
34,16384,EKB 0
35,16384,EKB 1
36,1024,EMPR 0
37,1024,EMPR 1
38,1024,EMPR 2
39,1024,EMPR 3
40,1024,EMPR 4
41,1024,EMPR 5
42,1024,EMPR 6
43,1024,EMPR 7
44,1024,EMPR 8
45,1024,EMPR 9
46,1024,EMPR 10
47,1024,EMPR 11
48,1024,EMPR 12
49,1024,EMPR 13
50,1024,EMPR 14
51,1024,EMPR 15
52,1024,EMPR 16
53,1024,EMPR 17
54,1024,EMPR 18
55,1024,EMPR 19
56,1024,EMPR 20
57,1024,EMPR 21
58,1024,EMPR 22
59,1024,EMPR 23
60,1024,EMPR 24
61,1024,EMPR 25
62,1024,EMPR 26
63,1024,EMPR 27
64,1024,EMPR 28
65,1024,EMPR 29
66,1024,EMPR 30
67,1024,EMPR 31
68,4,color variation
69,4,speaker ship info
70,8,middleware parameter
71,4,quick shutdown flag
72,262144,boot image
73,262144,hold image
74,262144,low battery image
75,262144,update image
76,262144,update error image
87,262144,precharge image
88,262144,dead battery image