summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-10-06 11:28:30 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2017-10-06 12:10:33 +0200
commit698779e3e898610800088b1ce6c6a2a25803b91c (patch)
treea2808f31ff1f655b5e055ae061814d70bcf87439
parent3f1e4a0b1aa3c77d27a85fefb00c9c575eab715b (diff)
downloadrockbox-698779e3e898610800088b1ce6c6a2a25803b91c.tar.gz
rockbox-698779e3e898610800088b1ce6c6a2a25803b91c.zip
sonynwz: add nvp nodes for NW-A40/ZX300, various fixes for tools
We still miss the model IDS for those device so scsitool won't be able to recognize them automatically. Change-Id: I17ae0f0d95c011cea8e289def63c7673b6c4b667
-rw-r--r--firmware/target/hosted/sonynwz/nwz-db.c147
-rw-r--r--firmware/target/hosted/sonynwz/nwz-db.h4
-rwxr-xr-xutils/nwztools/database/gen_db.py15
-rw-r--r--utils/nwztools/database/nvp/nw-a40.txt92
-rw-r--r--utils/nwztools/database/nvp/nw-zx300.txt92
-rwxr-xr-xutils/nwztools/database/nvp/parse_nvp_header.sh3
-rw-r--r--utils/nwztools/database/series.txt2
7 files changed, 351 insertions, 4 deletions
diff --git a/firmware/target/hosted/sonynwz/nwz-db.c b/firmware/target/hosted/sonynwz/nwz-db.c
index 2aef1e3a49..96c9c6e84f 100644
--- a/firmware/target/hosted/sonynwz/nwz-db.c
+++ b/firmware/target/hosted/sonynwz/nwz-db.c
@@ -224,6 +224,7 @@ static int nvp_index_0ac81d[NWZ_NVP_COUNT] =
224 [NWZ_NVP_BPR] = 35, 224 [NWZ_NVP_BPR] = 35,
225 [NWZ_NVP_BTC] = NWZ_NVP_INVALID, 225 [NWZ_NVP_BTC] = NWZ_NVP_INVALID,
226 [NWZ_NVP_BTI] = 1, 226 [NWZ_NVP_BTI] = 1,
227 [NWZ_NVP_CLG] = NWZ_NVP_INVALID,
227 [NWZ_NVP_CLV] = 68, 228 [NWZ_NVP_CLV] = 68,
228 [NWZ_NVP_CNG] = 3, 229 [NWZ_NVP_CNG] = 3,
229 [NWZ_NVP_CTR] = NWZ_NVP_INVALID, 230 [NWZ_NVP_CTR] = NWZ_NVP_INVALID,
@@ -308,6 +309,7 @@ static int nvp_index_0ac81d[NWZ_NVP_COUNT] =
308 [NWZ_NVP_PRK] = NWZ_NVP_INVALID, 309 [NWZ_NVP_PRK] = NWZ_NVP_INVALID,
309 [NWZ_NVP_PSK] = NWZ_NVP_INVALID, 310 [NWZ_NVP_PSK] = NWZ_NVP_INVALID,
310 [NWZ_NVP_PTS] = 75, 311 [NWZ_NVP_PTS] = 75,
312 [NWZ_NVP_PWD] = NWZ_NVP_INVALID,
311 [NWZ_NVP_RBT] = NWZ_NVP_INVALID, 313 [NWZ_NVP_RBT] = NWZ_NVP_INVALID,
312 [NWZ_NVP_RND] = 28, 314 [NWZ_NVP_RND] = 28,
313 [NWZ_NVP_RTC] = 34, 315 [NWZ_NVP_RTC] = 34,
@@ -335,6 +337,131 @@ static int nvp_index_0ac81d[NWZ_NVP_COUNT] =
335 [NWZ_NVP_VRT] = NWZ_NVP_INVALID, 337 [NWZ_NVP_VRT] = NWZ_NVP_INVALID,
336}; 338};
337 339
340static int nvp_index_139d65[NWZ_NVP_COUNT] =
341{
342 [NWZ_NVP_APD] = 78,
343 [NWZ_NVP_APP] = NWZ_NVP_INVALID,
344 [NWZ_NVP_BFD] = 21,
345 [NWZ_NVP_BFP] = 20,
346 [NWZ_NVP_BLF] = 79,
347 [NWZ_NVP_BML] = 22,
348 [NWZ_NVP_BOK] = NWZ_NVP_INVALID,
349 [NWZ_NVP_BPR] = 19,
350 [NWZ_NVP_BTC] = 85,
351 [NWZ_NVP_BTI] = 72,
352 [NWZ_NVP_CLG] = 15,
353 [NWZ_NVP_CLV] = 68,
354 [NWZ_NVP_CNG] = 23,
355 [NWZ_NVP_CTR] = 90,
356 [NWZ_NVP_DBA] = NWZ_NVP_INVALID,
357 [NWZ_NVP_DBG] = 0,
358 [NWZ_NVP_DBI] = 88,
359 [NWZ_NVP_DBS] = NWZ_NVP_INVALID,
360 [NWZ_NVP_DBV] = 25,
361 [NWZ_NVP_DCC] = NWZ_NVP_INVALID,
362 [NWZ_NVP_DG0] = NWZ_NVP_INVALID,
363 [NWZ_NVP_DG1] = NWZ_NVP_INVALID,
364 [NWZ_NVP_DOR] = NWZ_NVP_INVALID,
365 [NWZ_NVP_E00] = 36,
366 [NWZ_NVP_E01] = 37,
367 [NWZ_NVP_E02] = 38,
368 [NWZ_NVP_E03] = 39,
369 [NWZ_NVP_E04] = 40,
370 [NWZ_NVP_E05] = 41,
371 [NWZ_NVP_E06] = 42,
372 [NWZ_NVP_E07] = 43,
373 [NWZ_NVP_E08] = 44,
374 [NWZ_NVP_E09] = 45,
375 [NWZ_NVP_E10] = 46,
376 [NWZ_NVP_E11] = 47,
377 [NWZ_NVP_E12] = 48,
378 [NWZ_NVP_E13] = 49,
379 [NWZ_NVP_E14] = 50,
380 [NWZ_NVP_E15] = 51,
381 [NWZ_NVP_E16] = 52,
382 [NWZ_NVP_E17] = 53,
383 [NWZ_NVP_E18] = 54,
384 [NWZ_NVP_E19] = 55,
385 [NWZ_NVP_E20] = 56,
386 [NWZ_NVP_E21] = 57,
387 [NWZ_NVP_E22] = 58,
388 [NWZ_NVP_E23] = 59,
389 [NWZ_NVP_E24] = 60,
390 [NWZ_NVP_E25] = 61,
391 [NWZ_NVP_E26] = 62,
392 [NWZ_NVP_E27] = 63,
393 [NWZ_NVP_E28] = 64,
394 [NWZ_NVP_E29] = 65,
395 [NWZ_NVP_E30] = 66,
396 [NWZ_NVP_E31] = 67,
397 [NWZ_NVP_EDW] = 71,
398 [NWZ_NVP_EP0] = NWZ_NVP_INVALID,
399 [NWZ_NVP_EP1] = NWZ_NVP_INVALID,
400 [NWZ_NVP_EP2] = NWZ_NVP_INVALID,
401 [NWZ_NVP_EP3] = NWZ_NVP_INVALID,
402 [NWZ_NVP_ERI] = 76,
403 [NWZ_NVP_EXM] = NWZ_NVP_INVALID,
404 [NWZ_NVP_FMP] = NWZ_NVP_INVALID,
405 [NWZ_NVP_FNI] = 82,
406 [NWZ_NVP_FPI] = 33,
407 [NWZ_NVP_FUI] = 75,
408 [NWZ_NVP_FUP] = 3,
409 [NWZ_NVP_FUR] = 26,
410 [NWZ_NVP_FVI] = 31,
411 [NWZ_NVP_GTY] = 14,
412 [NWZ_NVP_HDI] = 73,
413 [NWZ_NVP_HLD] = 5,
414 [NWZ_NVP_INS] = 89,
415 [NWZ_NVP_IPT] = NWZ_NVP_INVALID,
416 [NWZ_NVP_KAS] = 11,
417 [NWZ_NVP_LBI] = 74,
418 [NWZ_NVP_LYR] = 24,
419 [NWZ_NVP_MAC] = 32,
420 [NWZ_NVP_MCR] = NWZ_NVP_INVALID,
421 [NWZ_NVP_MDK] = 30,
422 [NWZ_NVP_MDL] = NWZ_NVP_INVALID,
423 [NWZ_NVP_MID] = 7,
424 [NWZ_NVP_MLK] = NWZ_NVP_INVALID,
425 [NWZ_NVP_MSC] = NWZ_NVP_INVALID,
426 [NWZ_NVP_MSO] = 86,
427 [NWZ_NVP_MTM] = NWZ_NVP_INVALID,
428 [NWZ_NVP_MUK] = NWZ_NVP_INVALID,
429 [NWZ_NVP_NCP] = 17,
430 [NWZ_NVP_NVR] = 77,
431 [NWZ_NVP_PCD] = 8,
432 [NWZ_NVP_PCI] = 87,
433 [NWZ_NVP_PNC] = NWZ_NVP_INVALID,
434 [NWZ_NVP_PRK] = 4,
435 [NWZ_NVP_PSK] = 18,
436 [NWZ_NVP_PTS] = NWZ_NVP_INVALID,
437 [NWZ_NVP_PWD] = 6,
438 [NWZ_NVP_RBT] = 70,
439 [NWZ_NVP_RND] = NWZ_NVP_INVALID,
440 [NWZ_NVP_RTC] = NWZ_NVP_INVALID,
441 [NWZ_NVP_SDC] = NWZ_NVP_INVALID,
442 [NWZ_NVP_SDP] = 16,
443 [NWZ_NVP_SER] = 9,
444 [NWZ_NVP_SFI] = NWZ_NVP_INVALID,
445 [NWZ_NVP_SHE] = 84,
446 [NWZ_NVP_SHP] = 12,
447 [NWZ_NVP_SID] = 83,
448 [NWZ_NVP_SKD] = 28,
449 [NWZ_NVP_SKT] = NWZ_NVP_INVALID,
450 [NWZ_NVP_SKU] = 91,
451 [NWZ_NVP_SLP] = 80,
452 [NWZ_NVP_SPS] = 69,
453 [NWZ_NVP_SYI] = 1,
454 [NWZ_NVP_TR0] = 34,
455 [NWZ_NVP_TR1] = 35,
456 [NWZ_NVP_TST] = 13,
457 [NWZ_NVP_UBP] = 2,
458 [NWZ_NVP_UFN] = 10,
459 [NWZ_NVP_UMS] = 27,
460 [NWZ_NVP_UPS] = 29,
461 [NWZ_NVP_VAR] = NWZ_NVP_INVALID,
462 [NWZ_NVP_VRT] = 81,
463};
464
338static int nvp_index_28dc2c[NWZ_NVP_COUNT] = 465static int nvp_index_28dc2c[NWZ_NVP_COUNT] =
339{ 466{
340 [NWZ_NVP_APD] = 78, 467 [NWZ_NVP_APD] = 78,
@@ -347,6 +474,7 @@ static int nvp_index_28dc2c[NWZ_NVP_COUNT] =
347 [NWZ_NVP_BPR] = 19, 474 [NWZ_NVP_BPR] = 19,
348 [NWZ_NVP_BTC] = 85, 475 [NWZ_NVP_BTC] = 85,
349 [NWZ_NVP_BTI] = 72, 476 [NWZ_NVP_BTI] = 72,
477 [NWZ_NVP_CLG] = NWZ_NVP_INVALID,
350 [NWZ_NVP_CLV] = 68, 478 [NWZ_NVP_CLV] = 68,
351 [NWZ_NVP_CNG] = 23, 479 [NWZ_NVP_CNG] = 23,
352 [NWZ_NVP_CTR] = NWZ_NVP_INVALID, 480 [NWZ_NVP_CTR] = NWZ_NVP_INVALID,
@@ -431,6 +559,7 @@ static int nvp_index_28dc2c[NWZ_NVP_COUNT] =
431 [NWZ_NVP_PRK] = NWZ_NVP_INVALID, 559 [NWZ_NVP_PRK] = NWZ_NVP_INVALID,
432 [NWZ_NVP_PSK] = 18, 560 [NWZ_NVP_PSK] = 18,
433 [NWZ_NVP_PTS] = 77, 561 [NWZ_NVP_PTS] = 77,
562 [NWZ_NVP_PWD] = NWZ_NVP_INVALID,
434 [NWZ_NVP_RBT] = NWZ_NVP_INVALID, 563 [NWZ_NVP_RBT] = NWZ_NVP_INVALID,
435 [NWZ_NVP_RND] = 27, 564 [NWZ_NVP_RND] = 27,
436 [NWZ_NVP_RTC] = 6, 565 [NWZ_NVP_RTC] = 6,
@@ -470,6 +599,7 @@ static int nvp_index_398250[NWZ_NVP_COUNT] =
470 [NWZ_NVP_BPR] = 19, 599 [NWZ_NVP_BPR] = 19,
471 [NWZ_NVP_BTC] = 85, 600 [NWZ_NVP_BTC] = 85,
472 [NWZ_NVP_BTI] = 72, 601 [NWZ_NVP_BTI] = 72,
602 [NWZ_NVP_CLG] = NWZ_NVP_INVALID,
473 [NWZ_NVP_CLV] = 68, 603 [NWZ_NVP_CLV] = 68,
474 [NWZ_NVP_CNG] = 23, 604 [NWZ_NVP_CNG] = 23,
475 [NWZ_NVP_CTR] = 90, 605 [NWZ_NVP_CTR] = 90,
@@ -554,6 +684,7 @@ static int nvp_index_398250[NWZ_NVP_COUNT] =
554 [NWZ_NVP_PRK] = 4, 684 [NWZ_NVP_PRK] = 4,
555 [NWZ_NVP_PSK] = 18, 685 [NWZ_NVP_PSK] = 18,
556 [NWZ_NVP_PTS] = NWZ_NVP_INVALID, 686 [NWZ_NVP_PTS] = NWZ_NVP_INVALID,
687 [NWZ_NVP_PWD] = NWZ_NVP_INVALID,
557 [NWZ_NVP_RBT] = 70, 688 [NWZ_NVP_RBT] = 70,
558 [NWZ_NVP_RND] = NWZ_NVP_INVALID, 689 [NWZ_NVP_RND] = NWZ_NVP_INVALID,
559 [NWZ_NVP_RTC] = 6, 690 [NWZ_NVP_RTC] = 6,
@@ -593,6 +724,7 @@ static int nvp_index_4edba7[NWZ_NVP_COUNT] =
593 [NWZ_NVP_BPR] = 35, 724 [NWZ_NVP_BPR] = 35,
594 [NWZ_NVP_BTC] = NWZ_NVP_INVALID, 725 [NWZ_NVP_BTC] = NWZ_NVP_INVALID,
595 [NWZ_NVP_BTI] = 1, 726 [NWZ_NVP_BTI] = 1,
727 [NWZ_NVP_CLG] = NWZ_NVP_INVALID,
596 [NWZ_NVP_CLV] = 68, 728 [NWZ_NVP_CLV] = 68,
597 [NWZ_NVP_CNG] = 3, 729 [NWZ_NVP_CNG] = 3,
598 [NWZ_NVP_CTR] = NWZ_NVP_INVALID, 730 [NWZ_NVP_CTR] = NWZ_NVP_INVALID,
@@ -677,6 +809,7 @@ static int nvp_index_4edba7[NWZ_NVP_COUNT] =
677 [NWZ_NVP_PRK] = NWZ_NVP_INVALID, 809 [NWZ_NVP_PRK] = NWZ_NVP_INVALID,
678 [NWZ_NVP_PSK] = NWZ_NVP_INVALID, 810 [NWZ_NVP_PSK] = NWZ_NVP_INVALID,
679 [NWZ_NVP_PTS] = 75, 811 [NWZ_NVP_PTS] = 75,
812 [NWZ_NVP_PWD] = NWZ_NVP_INVALID,
680 [NWZ_NVP_RBT] = NWZ_NVP_INVALID, 813 [NWZ_NVP_RBT] = NWZ_NVP_INVALID,
681 [NWZ_NVP_RND] = 28, 814 [NWZ_NVP_RND] = 28,
682 [NWZ_NVP_RTC] = 34, 815 [NWZ_NVP_RTC] = 34,
@@ -716,6 +849,7 @@ static int nvp_index_6485c8[NWZ_NVP_COUNT] =
716 [NWZ_NVP_BPR] = 19, 849 [NWZ_NVP_BPR] = 19,
717 [NWZ_NVP_BTC] = 85, 850 [NWZ_NVP_BTC] = 85,
718 [NWZ_NVP_BTI] = 72, 851 [NWZ_NVP_BTI] = 72,
852 [NWZ_NVP_CLG] = NWZ_NVP_INVALID,
719 [NWZ_NVP_CLV] = 68, 853 [NWZ_NVP_CLV] = 68,
720 [NWZ_NVP_CNG] = 23, 854 [NWZ_NVP_CNG] = 23,
721 [NWZ_NVP_CTR] = NWZ_NVP_INVALID, 855 [NWZ_NVP_CTR] = NWZ_NVP_INVALID,
@@ -800,6 +934,7 @@ static int nvp_index_6485c8[NWZ_NVP_COUNT] =
800 [NWZ_NVP_PRK] = NWZ_NVP_INVALID, 934 [NWZ_NVP_PRK] = NWZ_NVP_INVALID,
801 [NWZ_NVP_PSK] = 18, 935 [NWZ_NVP_PSK] = 18,
802 [NWZ_NVP_PTS] = 77, 936 [NWZ_NVP_PTS] = 77,
937 [NWZ_NVP_PWD] = NWZ_NVP_INVALID,
803 [NWZ_NVP_RBT] = NWZ_NVP_INVALID, 938 [NWZ_NVP_RBT] = NWZ_NVP_INVALID,
804 [NWZ_NVP_RND] = 27, 939 [NWZ_NVP_RND] = 27,
805 [NWZ_NVP_RTC] = 6, 940 [NWZ_NVP_RTC] = 6,
@@ -839,6 +974,7 @@ static int nvp_index_92faee[NWZ_NVP_COUNT] =
839 [NWZ_NVP_BPR] = 19, 974 [NWZ_NVP_BPR] = 19,
840 [NWZ_NVP_BTC] = 85, 975 [NWZ_NVP_BTC] = 85,
841 [NWZ_NVP_BTI] = 72, 976 [NWZ_NVP_BTI] = 72,
977 [NWZ_NVP_CLG] = NWZ_NVP_INVALID,
842 [NWZ_NVP_CLV] = 68, 978 [NWZ_NVP_CLV] = 68,
843 [NWZ_NVP_CNG] = 23, 979 [NWZ_NVP_CNG] = 23,
844 [NWZ_NVP_CTR] = NWZ_NVP_INVALID, 980 [NWZ_NVP_CTR] = NWZ_NVP_INVALID,
@@ -923,6 +1059,7 @@ static int nvp_index_92faee[NWZ_NVP_COUNT] =
923 [NWZ_NVP_PRK] = NWZ_NVP_INVALID, 1059 [NWZ_NVP_PRK] = NWZ_NVP_INVALID,
924 [NWZ_NVP_PSK] = 18, 1060 [NWZ_NVP_PSK] = 18,
925 [NWZ_NVP_PTS] = 77, 1061 [NWZ_NVP_PTS] = 77,
1062 [NWZ_NVP_PWD] = NWZ_NVP_INVALID,
926 [NWZ_NVP_RBT] = NWZ_NVP_INVALID, 1063 [NWZ_NVP_RBT] = NWZ_NVP_INVALID,
927 [NWZ_NVP_RND] = 27, 1064 [NWZ_NVP_RND] = 27,
928 [NWZ_NVP_RTC] = 6, 1065 [NWZ_NVP_RTC] = 6,
@@ -962,6 +1099,7 @@ static int nvp_index_f505c8[NWZ_NVP_COUNT] =
962 [NWZ_NVP_BPR] = 35, 1099 [NWZ_NVP_BPR] = 35,
963 [NWZ_NVP_BTC] = 27, 1100 [NWZ_NVP_BTC] = 27,
964 [NWZ_NVP_BTI] = 1, 1101 [NWZ_NVP_BTI] = 1,
1102 [NWZ_NVP_CLG] = NWZ_NVP_INVALID,
965 [NWZ_NVP_CLV] = 68, 1103 [NWZ_NVP_CLV] = 68,
966 [NWZ_NVP_CNG] = 3, 1104 [NWZ_NVP_CNG] = 3,
967 [NWZ_NVP_CTR] = NWZ_NVP_INVALID, 1105 [NWZ_NVP_CTR] = NWZ_NVP_INVALID,
@@ -1046,6 +1184,7 @@ static int nvp_index_f505c8[NWZ_NVP_COUNT] =
1046 [NWZ_NVP_PRK] = NWZ_NVP_INVALID, 1184 [NWZ_NVP_PRK] = NWZ_NVP_INVALID,
1047 [NWZ_NVP_PSK] = 86, 1185 [NWZ_NVP_PSK] = 86,
1048 [NWZ_NVP_PTS] = 75, 1186 [NWZ_NVP_PTS] = 75,
1187 [NWZ_NVP_PWD] = NWZ_NVP_INVALID,
1049 [NWZ_NVP_RBT] = NWZ_NVP_INVALID, 1188 [NWZ_NVP_RBT] = NWZ_NVP_INVALID,
1050 [NWZ_NVP_RND] = 28, 1189 [NWZ_NVP_RND] = 28,
1051 [NWZ_NVP_RTC] = 34, 1190 [NWZ_NVP_RTC] = 34,
@@ -1085,6 +1224,7 @@ struct nwz_nvp_info_t nwz_nvp[NWZ_NVP_COUNT] =
1085 [NWZ_NVP_BPR] = { "bpr", 2048, "bluetooth address | bluetooth parameter" }, 1224 [NWZ_NVP_BPR] = { "bpr", 2048, "bluetooth address | bluetooth parameter" },
1086 [NWZ_NVP_BTC] = { "btc", 4, "battery calibration" }, 1225 [NWZ_NVP_BTC] = { "btc", 4, "battery calibration" },
1087 [NWZ_NVP_BTI] = { "bti", 262144, "boot image" }, 1226 [NWZ_NVP_BTI] = { "bti", 262144, "boot image" },
1227 [NWZ_NVP_CLG] = { "clg", 0, "" },
1088 [NWZ_NVP_CLV] = { "clv", 4, "color variation" }, 1228 [NWZ_NVP_CLV] = { "clv", 4, "color variation" },
1089 [NWZ_NVP_CNG] = { "cng", 704, "aad key | aad/empr key" }, 1229 [NWZ_NVP_CNG] = { "cng", 704, "aad key | aad/empr key" },
1090 [NWZ_NVP_CTR] = { "ctr", 0, "" }, 1230 [NWZ_NVP_CTR] = { "ctr", 0, "" },
@@ -1169,6 +1309,7 @@ struct nwz_nvp_info_t nwz_nvp[NWZ_NVP_COUNT] =
1169 [NWZ_NVP_PRK] = { "prk", 0, "" }, 1309 [NWZ_NVP_PRK] = { "prk", 0, "" },
1170 [NWZ_NVP_PSK] = { "psk", 512, "bluetooth pskey" }, 1310 [NWZ_NVP_PSK] = { "psk", 512, "bluetooth pskey" },
1171 [NWZ_NVP_PTS] = { "pts", 4, "wifi protected setup" }, 1311 [NWZ_NVP_PTS] = { "pts", 4, "wifi protected setup" },
1312 [NWZ_NVP_PWD] = { "pwd", 0, "" },
1172 [NWZ_NVP_RBT] = { "rbt", 0, "" }, 1313 [NWZ_NVP_RBT] = { "rbt", 0, "" },
1173 [NWZ_NVP_RND] = { "rnd", 64, "random data | wmt key" }, 1314 [NWZ_NVP_RND] = { "rnd", 64, "random data | wmt key" },
1174 [NWZ_NVP_RTC] = { "rtc", 16, "rtc alarm" }, 1315 [NWZ_NVP_RTC] = { "rtc", 16, "rtc alarm" },
@@ -1205,6 +1346,8 @@ static unsigned long models_nw_a20[] = { 0x1d000001, 0x1d000002, 0x1d000004,
1205 1346
1206static unsigned long models_nw_a30[] = { 0x22000004, 0x22000005, 0x22000006 }; 1347static unsigned long models_nw_a30[] = { 0x22000004, 0x22000005, 0x22000006 };
1207 1348
1349static unsigned long models_nw_a40[] = { };
1350
1208static unsigned long models_nwz_a720[] = { 0x3030001, 0x3030002, 0x3030004, 1351static unsigned long models_nwz_a720[] = { 0x3030001, 0x3030002, 0x3030004,
1209 0x3020001, 0x3020002, 0x3020004 }; 1352 0x3020001, 0x3020002, 0x3020004 };
1210 1353
@@ -1294,6 +1437,8 @@ static unsigned long models_nwz_x1000[] = { 0x5000002, 0x5000004, 0x5000005,
1294static unsigned long models_nw_zx100[] = { 0x1c000007, 0x1c000001, 0x1c000002, 1437static unsigned long models_nw_zx100[] = { 0x1c000007, 0x1c000001, 0x1c000002,
1295 0x1c000004, 0x1c000005, 0x1c000006 }; 1438 0x1c000004, 0x1c000005, 0x1c000006 };
1296 1439
1440static unsigned long models_nw_zx300[] = { };
1441
1297static unsigned long models_nwz_noname[] = { 0x5010002, 0x5010004, 0x5010005 }; 1442static unsigned long models_nwz_noname[] = { 0x5010002, 0x5010004, 0x5010005 };
1298 1443
1299struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT] = 1444struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT] =
@@ -1301,6 +1446,7 @@ struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT] =
1301 { "nwz-a10", "NWZ-A10 Series", 10, models_nwz_a10, &nvp_index_92faee }, 1446 { "nwz-a10", "NWZ-A10 Series", 10, models_nwz_a10, &nvp_index_92faee },
1302 { "nw-a20", "NW-A20 Series", 6, models_nw_a20, &nvp_index_92faee }, 1447 { "nw-a20", "NW-A20 Series", 6, models_nw_a20, &nvp_index_92faee },
1303 { "nw-a30", "NW-A30 Series", 3, models_nw_a30, &nvp_index_398250 }, 1448 { "nw-a30", "NW-A30 Series", 3, models_nw_a30, &nvp_index_398250 },
1449 { "nw-a40", "NW-A40 Series", 0, models_nw_a40, &nvp_index_139d65 },
1304 { "nwz-a720", "NWZ-A720 Series", 6, models_nwz_a720, 0 }, 1450 { "nwz-a720", "NWZ-A720 Series", 6, models_nwz_a720, 0 },
1305 { "nwz-a810", "NWZ-A810 Series", 3, models_nwz_a810, 0 }, 1451 { "nwz-a810", "NWZ-A810 Series", 3, models_nwz_a810, 0 },
1306 { "nwz-a820", "NWZ-A820 Series", 6, models_nwz_a820, 0 }, 1452 { "nwz-a820", "NWZ-A820 Series", 6, models_nwz_a820, 0 },
@@ -1333,5 +1479,6 @@ struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT] =
1333 { "nw-wm1", "NW-WM1 Series", 2, models_nw_wm1, &nvp_index_398250 }, 1479 { "nw-wm1", "NW-WM1 Series", 2, models_nw_wm1, &nvp_index_398250 },
1334 { "nwz-x1000", "NWZ-X1000 Series", 9, models_nwz_x1000, &nvp_index_4edba7 }, 1480 { "nwz-x1000", "NWZ-X1000 Series", 9, models_nwz_x1000, &nvp_index_4edba7 },
1335 { "nw-zx100", "NW-ZX100 Series", 6, models_nw_zx100, &nvp_index_92faee }, 1481 { "nw-zx100", "NW-ZX100 Series", 6, models_nw_zx100, &nvp_index_92faee },
1482 { "nw-zx300", "NW-ZX300 Series", 0, models_nw_zx300, &nvp_index_139d65 },
1336 { "nwz-noname", "NONAME", 3, models_nwz_noname, 0 }, 1483 { "nwz-noname", "NONAME", 3, models_nwz_noname, 0 },
1337}; 1484};
diff --git a/firmware/target/hosted/sonynwz/nwz-db.h b/firmware/target/hosted/sonynwz/nwz-db.h
index cb130f96a2..d032e27d04 100644
--- a/firmware/target/hosted/sonynwz/nwz-db.h
+++ b/firmware/target/hosted/sonynwz/nwz-db.h
@@ -35,6 +35,7 @@ enum nwz_nvp_node_t
35 NWZ_NVP_BPR, /* bluetooth address | bluetooth parameter */ 35 NWZ_NVP_BPR, /* bluetooth address | bluetooth parameter */
36 NWZ_NVP_BTC, /* battery calibration */ 36 NWZ_NVP_BTC, /* battery calibration */
37 NWZ_NVP_BTI, /* boot image */ 37 NWZ_NVP_BTI, /* boot image */
38 NWZ_NVP_CLG, /* */
38 NWZ_NVP_CLV, /* color variation */ 39 NWZ_NVP_CLV, /* color variation */
39 NWZ_NVP_CNG, /* aad key | aad/empr key */ 40 NWZ_NVP_CNG, /* aad key | aad/empr key */
40 NWZ_NVP_CTR, /* */ 41 NWZ_NVP_CTR, /* */
@@ -119,6 +120,7 @@ enum nwz_nvp_node_t
119 NWZ_NVP_PRK, /* */ 120 NWZ_NVP_PRK, /* */
120 NWZ_NVP_PSK, /* bluetooth pskey */ 121 NWZ_NVP_PSK, /* bluetooth pskey */
121 NWZ_NVP_PTS, /* wifi protected setup */ 122 NWZ_NVP_PTS, /* wifi protected setup */
123 NWZ_NVP_PWD, /* */
122 NWZ_NVP_RBT, /* */ 124 NWZ_NVP_RBT, /* */
123 NWZ_NVP_RND, /* random data | wmt key */ 125 NWZ_NVP_RND, /* random data | wmt key */
124 NWZ_NVP_RTC, /* rtc alarm */ 126 NWZ_NVP_RTC, /* rtc alarm */
@@ -152,7 +154,7 @@ enum nwz_nvp_node_t
152/* Number of models */ 154/* Number of models */
153#define NWZ_MODEL_COUNT 186 155#define NWZ_MODEL_COUNT 186
154/* Number of series */ 156/* Number of series */
155#define NWZ_SERIES_COUNT 36 157#define NWZ_SERIES_COUNT 38
156 158
157/* NVP node info */ 159/* NVP node info */
158struct nwz_nvp_info_t 160struct nwz_nvp_info_t
diff --git a/utils/nwztools/database/gen_db.py b/utils/nwztools/database/gen_db.py
index be4cc34db0..23f4e3f474 100755
--- a/utils/nwztools/database/gen_db.py
+++ b/utils/nwztools/database/gen_db.py
@@ -4,6 +4,17 @@ import os
4import re 4import re
5import subprocess 5import subprocess
6import hashlib 6import hashlib
7import sys
8
9# arguments
10if len(sys.argv) != 2:
11 print("Usage: %s output_directory" % sys.argv[0])
12 exit(1)
13output_directory = sys.argv[1]
14# check path is valid
15if not os.path.isdir(output_directory):
16 print("Error: '%s' is not a valid directory" % output_directory)
17 exit(1)
7 18
8# parse models.txt 19# parse models.txt
9g_models = [] 20g_models = []
@@ -200,7 +211,7 @@ extern struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT];
200#endif /* __NWZ_DB_H__ */ 211#endif /* __NWZ_DB_H__ */
201""" 212"""
202 213
203with open("nwz-db.h", "w") as fp: 214with open(os.path.join(output_directory, "nwz-db.h"), "w") as fp:
204 fp.write(header_begin) 215 fp.write(header_begin)
205 # generate list of all nvp nodes 216 # generate list of all nvp nodes
206 for name in sorted(g_nvp_names): 217 for name in sorted(g_nvp_names):
@@ -256,7 +267,7 @@ def by_name(nvp_entry):
256def codename_to_c(codename): 267def codename_to_c(codename):
257 return re.sub('[^a-zA-Z0-9]', '_', codename, 0) 268 return re.sub('[^a-zA-Z0-9]', '_', codename, 0)
258 269
259with open("nwz-db.c", "w") as fp: 270with open(os.path.join(output_directory, "nwz-db.c"), "w") as fp:
260 fp.write(impl_begin) 271 fp.write(impl_begin)
261 # generate model list (sort by mid) 272 # generate model list (sort by mid)
262 for model in sorted(g_models, key = by_mid): 273 for model in sorted(g_models, key = by_mid):
diff --git a/utils/nwztools/database/nvp/nw-a40.txt b/utils/nwztools/database/nvp/nw-a40.txt
new file mode 100644
index 0000000000..ebe8433824
--- /dev/null
+++ b/utils/nwztools/database/nvp/nw-a40.txt
@@ -0,0 +1,92 @@
1dbg,000
2syi,001
3ubp,002
4fup,003
5prk,004
6hld,005
7pwd,006
8mid,007
9pcd,008
10ser,009
11ufn,010
12kas,011
13shp,012
14tst,013
15gty,014
16clg,015
17sdp,016
18ncp,017
19psk,018
20nvr,077
21she,084
22btc,085
23ins,089
24ctr,090
25sku,091
26bpr,019
27bfp,020
28bfd,021
29bml,022
30apd,078
31blf,079
32slp,080
33vrt,081
34fni,082
35sid,083
36mso,086
37cng,023
38lyr,024
39dbv,025
40fur,026
41ums,027
42skd,028
43ups,029
44mdk,030
45fvi,031
46mac,032
47fpi,033
48tr0,034
49tr1,035
50e00,036
51e01,037
52e02,038
53e03,039
54e04,040
55e05,041
56e06,042
57e07,043
58e08,044
59e09,045
60e10,046
61e11,047
62e12,048
63e13,049
64e14,050
65e15,051
66e16,052
67e17,053
68e18,054
69e19,055
70e20,056
71e21,057
72e22,058
73e23,059
74e24,060
75e25,061
76e26,062
77e27,063
78e28,064
79e29,065
80e30,066
81e31,067
82clv,068
83sps,069
84rbt,070
85edw,071
86bti,072
87hdi,073
88lbi,074
89fui,075
90eri,076
91pci,087
92dbi,088
diff --git a/utils/nwztools/database/nvp/nw-zx300.txt b/utils/nwztools/database/nvp/nw-zx300.txt
new file mode 100644
index 0000000000..ebe8433824
--- /dev/null
+++ b/utils/nwztools/database/nvp/nw-zx300.txt
@@ -0,0 +1,92 @@
1dbg,000
2syi,001
3ubp,002
4fup,003
5prk,004
6hld,005
7pwd,006
8mid,007
9pcd,008
10ser,009
11ufn,010
12kas,011
13shp,012
14tst,013
15gty,014
16clg,015
17sdp,016
18ncp,017
19psk,018
20nvr,077
21she,084
22btc,085
23ins,089
24ctr,090
25sku,091
26bpr,019
27bfp,020
28bfd,021
29bml,022
30apd,078
31blf,079
32slp,080
33vrt,081
34fni,082
35sid,083
36mso,086
37cng,023
38lyr,024
39dbv,025
40fur,026
41ums,027
42skd,028
43ups,029
44mdk,030
45fvi,031
46mac,032
47fpi,033
48tr0,034
49tr1,035
50e00,036
51e01,037
52e02,038
53e03,039
54e04,040
55e05,041
56e06,042
57e07,043
58e08,044
59e09,045
60e10,046
61e11,047
62e12,048
63e13,049
64e14,050
65e15,051
66e16,052
67e17,053
68e18,054
69e19,055
70e20,056
71e21,057
72e22,058
73e23,059
74e24,060
75e25,061
76e26,062
77e27,063
78e28,064
79e29,065
80e30,066
81e31,067
82clv,068
83sps,069
84rbt,070
85edw,071
86bti,072
87hdi,073
88lbi,074
89fui,075
90eri,076
91pci,087
92dbi,088
diff --git a/utils/nwztools/database/nvp/parse_nvp_header.sh b/utils/nwztools/database/nvp/parse_nvp_header.sh
index ee2be93516..88fdb1dd4b 100755
--- a/utils/nwztools/database/nvp/parse_nvp_header.sh
+++ b/utils/nwztools/database/nvp/parse_nvp_header.sh
@@ -38,7 +38,8 @@ fi
38if [ "`echo "$LIST" | grep "icx_nvp_emmc.h" | wc -l`" = "1" ]; then 38if [ "`echo "$LIST" | grep "icx_nvp_emmc.h" | wc -l`" = "1" ]; then
39 LIST=`echo "$LIST" | grep "icx_nvp_emmc.h"` 39 LIST=`echo "$LIST" | grep "icx_nvp_emmc.h"`
40else 40else
41 LIST=`echo "$LIST" | grep 'icx[[:digit:]]*_nvp[[:alpha:]_]*.h'` 41# otherwise find any file named icx_nvp*.h but filter out icx_nvp_wrapper.h
42 LIST=`echo "$LIST" | grep 'icx[[:digit:]]*_nvp[[:alpha:]_]*.h' | sed '/icx_nvp_wrapper/d'`
42fi 43fi
43LIST_CNT=`echo "$LIST" | wc -l` 44LIST_CNT=`echo "$LIST" | wc -l`
44if [ "$LIST_CNT" = "0" ]; then 45if [ "$LIST_CNT" = "0" ]; then
diff --git a/utils/nwztools/database/series.txt b/utils/nwztools/database/series.txt
index 2128ad2abb..b51897e70d 100644
--- a/utils/nwztools/database/series.txt
+++ b/utils/nwztools/database/series.txt
@@ -1,6 +1,7 @@
1nwz-a10,NWZ-A10 Series,0x1a000001,0x1a000002,0x1a000004,0x1a000005,0x1a000006,0x1a010001,0x1a010002,0x1a010004,0x1a010005,0x1a010006 1nwz-a10,NWZ-A10 Series,0x1a000001,0x1a000002,0x1a000004,0x1a000005,0x1a000006,0x1a010001,0x1a010002,0x1a010004,0x1a010005,0x1a010006
2nw-a20,NW-A20 Series,0x1d000001,0x1d000002,0x1d000004,0x1d000005,0x1d000006,0x1d000007 2nw-a20,NW-A20 Series,0x1d000001,0x1d000002,0x1d000004,0x1d000005,0x1d000006,0x1d000007
3nw-a30,NW-A30 Series,0x22000004,0x22000005,0x22000006 3nw-a30,NW-A30 Series,0x22000004,0x22000005,0x22000006
4nw-a40,NW-A40 Series,
4nwz-a720,NWZ-A720 Series,0x3030001,0x3030002,0x3030004,0x3020001,0x3020002,0x3020004 5nwz-a720,NWZ-A720 Series,0x3030001,0x3030002,0x3030004,0x3020001,0x3020002,0x3020004
5nwz-a810,NWZ-A810 Series,0x10000,0x10001,0x10002 6nwz-a810,NWZ-A810 Series,0x10000,0x10001,0x10002
6nwz-a820,NWZ-A820 Series,0x3010001,0x3010002,0x3010004,0x3000001,0x3000002,0x3000004 7nwz-a820,NWZ-A820 Series,0x3010001,0x3010002,0x3010004,0x3000001,0x3000002,0x3000004
@@ -33,4 +34,5 @@ nw-s780,NW-S780 Series,0x19000001,0x19000002,0x19000004,0x19000005
33nw-wm1,NW-WM1 Series,0x20000007,0x21000008 34nw-wm1,NW-WM1 Series,0x20000007,0x21000008
34nwz-x1000,NWZ-X1000 Series,0x5000002,0x5000004,0x5000005,0x5020002,0x5040002,0x5020004,0x5040004,0x5020005,0x5040005 35nwz-x1000,NWZ-X1000 Series,0x5000002,0x5000004,0x5000005,0x5020002,0x5040002,0x5020004,0x5040004,0x5020005,0x5040005
35nw-zx100,NW-ZX100 Series,0x1c000007,0x1c000001,0x1c000002,0x1c000004,0x1c000005,0x1c000006 36nw-zx100,NW-ZX100 Series,0x1c000007,0x1c000001,0x1c000002,0x1c000004,0x1c000005,0x1c000006
37nw-zx300,NW-ZX300 Series,
36nwz-noname,NONAME,0x5010002,0x5010004,0x5010005 38nwz-noname,NONAME,0x5010002,0x5010004,0x5010005