Commit graph

1101 commits

Author SHA1 Message Date
Franklin Wei
3083abeb95 deploy-rbutil.py: allow zipball building to proceed if no DLLs are found
This helps with MXE static builds, which were failing because no DLLs were
found.

Change-Id: Id3fcdf9a7682a9ecb6a5892415077bf16e8b24cb
2019-11-14 19:42:06 -05:00
Franklin Wei
b2fb095ab5 rbutil: include nwztools source in release tarball
Change-Id: Ic6d998441fb532a914eea2838fdc0d196f930bb2
2019-11-10 19:56:50 -05:00
Franklin Wei
a5f228eee2 rbutil: fix windows cross compile (via M cross environment)
This fixes a couple of issues when cross-compiling for windows:
 - lib builds (i.e. mks5lboot) were overriding the cross CC/CXX with the
   native CC, producing incompatible binaries.
 - Qt made the accessibility plugin part of the core library, so we no
   longer need to import it.

Change-Id: I9d884aee62dfa51d3624a3fa9b99c23b3b375f20
2019-11-09 20:54:57 -05:00
Amaury Pouly
4ed5727654 nwztools: fix Makefile
Seems like newer versions of mingw will sponteanously add a .exe suffix to
the output path if it doesn't have one, for example mingw-gcc -o scsitool bla
will actually create scsitool.exe and of course this breaks my release script.
Fix this by explicitely adding the .exe to avoid any problem

Change-Id: Ic8019b968b532b2ca612ba0c03977a96c22cee01
2019-04-22 23:45:33 +02:00
Amaury Pouly
063ff294a2 nwztools: add DMP-Z1 to the database
This is one of those fancy gold-plated devices. Of course it breaks my scripts
that were nicely expecting every device to start with NW.

Change-Id: I161320f620f65f4f92c2650d192b26a9831eeb9d
2019-04-22 23:45:33 +02:00
Solomon Peachy
07084f62c4 Fix host build of mkimxboot, mknwzboot, nwztools, and rbutil with crypto++
Necessary to get working builds on my Fedora 29 system.

Change-Id: Ia6232427c959629ade9a85fc412738f688facedb
2019-01-25 12:58:18 +01:00
Amaury Pouly
c1194aedb0 sonynwz: add NW-ZX300G nvp info
There is something weird going on: the Sony website has two different entries:
- NW-ZX300/NW-ZX300A/NW-A45/NW-A47/NW-A45HN/NW-A46HN
- NW-ZX300,NW-ZX300A update(20181004)/NW-ZX300G
with slightly different nvp entries, but it is impossible to tell whether
an NW-ZX300(A) belong to one or the other. Since the diff is very small,
I am adding this as nw-zx300g but treat all devices as nz-zx300 since the
destination node is the same and that is the main usage of the tool anyway.

Change-Id: I3dc2fdec52650f938d568bed578184f6bc43d130
2018-11-30 15:37:10 +01:00
Amaury Pouly
110e3b43a0 sonynwz: add NW-A57 and NW-ZX300G to the database
Change-Id: I9bbfa56c5b2d79568de5443f1098d724c4beda6a
2018-11-30 15:37:10 +01:00
Amaury Pouly
4c318057f6 nwzstools/scsitool: try to guess series if possible
If the model is not known (ie model ID in the database) but another device from
the same series is known, then the database information probably applies and
one can use the "force" option -s to tell the tool to ignore the model ID.
Automatically print such advice when the series can be guessed.

Change-Id: I6bcc7aa29693df8c3d7d8e709ece7cea650be717
2018-11-30 15:37:10 +01:00
Amaury Pouly
da752d0084 nwztools/scsitool: add experimental command to list Sony devices
Change-Id: Ic4f382667c5c84514be661d36032c47fb8f92e75
2018-11-30 15:37:10 +01:00
Amaury Pouly
e01248efcd rbscsi: add experimental API to list connected SCSI devices
For now it is only implemented on linux using /sys scanning

Change-Id: Ifdfe7564e6e8d0307ae6ddc53e49bb9aaf5a8268
2018-11-30 15:37:10 +01:00
Amaury Pouly
4365437159 Indentation fix
Change-Id: Ia0f96dd27c520cf2bfec4765619f53eaffee3e20
2018-11-30 15:37:10 +01:00
Amaury Pouly
110fd2cae6 Add the NWZ-A844 to the database
For some reason even Sony didn't have it in its list...

Change-Id: I26de6071e5887cc7c6ebb695ea333c7b3d1b50db
2018-11-30 15:37:10 +01:00
Amaury Pouly
0120ecd651 sonynwz: add nvp map for NW-A50 series
Change-Id: I49f3399552721e515cc01021c2e0aa28c781ec28
2018-10-29 15:10:24 +01:00
Amaury Pouly
8a4cb5e619 sonynwz: add NW-A55 to database
Change-Id: I59861119c59490f586b3c6ed32a1c41df8b3d365
2018-10-29 13:29:39 +01:00
Marcin Bukat
734be0d6aa MIPS: fix memset()
swr/swl instructions used for word aligning were wrong. This
made memset() terribly broken. I can't imagine how it went
uncaught for soooo long. Spotted by Solomon Peachy.

I run unit tests for alignments 0,1,2,3
size 1, 2, 3, 4, 5, 63, 64, 65, 127, 128, 129;
and fill pattern 0x00 and other (since 0 is special case in this
implementation).

Change-Id: I513a10734335fe97734c10ab5a6c3e3fb3f4687a
2018-09-07 09:43:05 +02:00
Amaury Pouly
11437662c4 nwztools/scsitool: fix completely stupid code
Change-Id: I3771388d24fe5fa249dcb40b231d7a4e06d3c3c8
2018-01-13 19:12:43 +01:00
Amaury Pouly
4d988d43d8 nwztools/scsitool: print clearer message when nvp info is incomplete
Change-Id: I13b20b88b35e825da929a31e71ff42d68a79f131
2018-01-13 12:18:01 +01:00
Amaury Pouly
6c856c412a Add information for NWZ-S630 and NWZ-S730
Change-Id: I4c48c9a8d862eaf67ec27c1c13b9b7f1fb204fc0
2018-01-13 12:07:21 +01:00
Amaury Pouly
0d794c0c06 sonynwz: Add NVP information for NWZ-A810
Change-Id: I37671ddf15ee1a4b469f97fe06ec86249ff9ce60
2018-01-07 23:24:58 +01:00
Amaury Pouly
ec4fa0333c hwstub: add code to dump STMP rom
Change-Id: I083024662f3c085f7bcd2f85b0a68de85725b0f3
2017-11-12 14:14:30 +01:00
Amaury Pouly
dd6b8427f9 hwstub: expose read/write functions
Previously only atomic read/write 8/16/32 were exposed. But it is useful to
be able to read a whole buffer at once, this is more efficient than N times
read8.

Change-Id: I06e331641e1ab1f74c0e16e8c432eafb398e8e6d
2017-11-12 14:13:21 +01:00
Amaury Pouly
df0edba18e hwstub: fix horrible bug
It's a wonder it worked, basically any big transfer returned garbage

Change-Id: Ic2b2fc1805423c70db8eac40692ba842c72462ab
2017-11-12 14:12:44 +01:00
Amaury Pouly
07d3b3c1fb nwztools/scsitools: print device list when listing series
Change-Id: Ic46c724c5d89a775dc20853410c8fe6f0ff9a4c8
2017-11-01 12:43:33 +01:00
Amaury Pouly
62f0ba1c30 nwztools: add NW-A46 to the database
Change-Id: I85dc2080e0be07ff689384c0445f4f1595baf4ac
2017-11-01 12:43:33 +01:00
Amaury Pouly
7807934a27 atjboottool: document more header fields and crypto code
The encryption definitely uses some standard elliptic curve encryption over
binary fields (163 and 233 bits, standard polynomials). It is still unclear
how this is used in the actual encryption, the key authentification and
derivation do not look standard.

Change-Id: I6b9180ff7e6115e1dceca8489e986a02a9ea6fc9
2017-10-26 18:17:59 +01:00
Amaury Pouly
819d3ee02e nwztools: add NW-A45
Change-Id: I75a7723498564ee73c3682391582e354ad672fd7
2017-10-24 17:47:28 +01:00
Amaury Pouly
2ae792c2f5 nwztools: add NW-ZX300A
Change-Id: I8b311ed6b48b92b9ecf4fb25c19119cfb2d5beb1
2017-10-24 11:46:19 +01:00
Amaury Pouly
e441c2696d nwztools/upgtools: make the tool print the whole kas, not just 16 bytes
Change-Id: I9daca9148b7aaea905a765dfeb95faf6fb7198b1
2017-10-22 15:35:10 +02:00
Amaury Pouly
7e42e90294 atjboottool: add support for FwuTail
Change-Id: Ib01a2ff92294dd0bb59439c23f26bc31eafa4a39
2017-10-20 23:57:58 +02:00
Amaury Pouly
6e79c4cb7c nwztools: add KAS for NW-A40 series
Change-Id: I6e22ba0a58eb62dcc9f2025ee7233f5afae1bbec
2017-10-20 19:46:35 +02:00
Amaury Pouly
1eab18c9e4 nwztools/scsitools: don't try to get nodes when we don't know about the device
Change-Id: Id35671f1e039a94e2b319262e4faa51d73f12afd
2017-10-17 13:34:54 +02:00
Amaury Pouly
9a8a52cb07 nwztools/scsitool: slightly rework of help_us and help
Now print list of devices immediately even if the rest of the command line
is empty (ie 'scsitool -s ?' works, whereas before one would need an actual
device to even get a list). Add more information in the help_us command:
print kas, lyr and fpi.

Change-Id: Icfeeaeebe28c774a74ca54661357fafa25c3d114
2017-10-17 13:05:58 +02:00
Amaury Pouly
6922323466 sonynwz: add NW-A47 to the database and regenerate nwz_db.{c,h}
Change-Id: I6331a48a4d336348e90a32cf151427b29eeedb2b
2017-10-17 13:05:11 +02:00
Amaury Pouly
5af813c5b7 nwztools: add NW-ZX300 KAS, extracted from a device
Now this is very weird, is it yet another format/encryption?

Change-Id: I119dec1e6d636a99508fb1394de27237ca3ab814
2017-10-07 22:01:00 +02:00
Amaury Pouly
0fbd93b7e6 nwztools/scsitools: fix database
I forgot to add the NW-ZX300 to its series

Change-Id: I78fd9440492e1868b887f6a2e137d4d0c2ff199a
2017-10-07 18:44:30 +02:00
Amaury Pouly
7eb240a288 Add Sony NW-ZX300 model id to database
Change-Id: I8e7a14b86408c52cbd4a059e2db6a9c9d0966fc6
2017-10-07 12:45:48 +02:00
Amaury Pouly
2f3801be34 fix typo
Change-Id: Ic357f82d61cc0004ac6193fa9dbbc90976042574
2017-10-06 18:31:11 +02:00
Amaury Pouly
d9da4833a7 nwztools/scsitool: various improvements
The tool now provides more useful information for developers when the device
is not supported. Is also has a new verb "help_us" that also prints all this
information (notably the device info and model ID).

Change-Id: I04baec8fff23eb83a0408add6296b5d42e9aa8e7
2017-10-06 12:10:40 +02:00
Amaury Pouly
698779e3e8 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
2017-10-06 12:10:33 +02:00
Amaury Pouly
ea679de837 atjboottool: put afi and fw code in its own files
Change-Id: I16347ebee0f82d5fdf32f5aa8f955c07fe148eba
2017-09-29 18:22:30 +02:00
Amaury Pouly
95c32a505a atjboottool: split fwu code into its own file
Slightly cleanup the code by removing the old and dangerous --force option.

Change-Id: I776633a9924797fcd509b8b80623bcd64b391672
2017-09-29 17:56:04 +02:00
Amaury Pouly
5f4de5bf48 nwztools/scsitools: make do_fw_upgrade output less confusing
Change-Id: If616e646aeddf20aa3cee79a821a420d9102c708
2017-09-19 21:53:52 +02:00
Amaury Pouly
99cc8f8802 upgtools: fix bug in brute force search
DES ignores the parity bit of each byte (making the 64-bit key really 56-bit),
but the current code skipped the parity bit of each half-byte, thus missing
some keys.

Change-Id: Ia523ebb944e458905b7de1742df151df22166150
2017-09-19 15:30:37 +02:00
Amaury Pouly
127e6bbfdd Add support for the NWZ-E350
Strangely it has the SAME encryption key as the E450. Either they didn't bother
changing it or more likely they have exactly the same internals and a slightly
different case.

Change-Id: I39ab88845b3e40db34160c2e61dde421f391df44
2017-09-17 23:47:49 +02:00
Marcin Bukat
8b744571c0 ATJ hwstub: Add cache coherency
All the hard work was done by pamaury. I simply added proper
defines.

Change-Id: Ib374eea7cd20f35518ad8a68d771c57c54ae01ca
2017-09-15 21:44:59 +02:00
Amaury Pouly
e6de6c107e qeditor: add workaround for c++11 in qt4, suggest to use qt5
Change-Id: Iad7b8fd171d57228796a68cb3406914213b91926
2017-09-06 20:45:34 +02:00
Amaury Pouly
1d121e8c08 Initial commit for the Sony NWZ linux port
SUPPORTED SERIES:
- NWZ-E450
- NWZ-E460
- NWZ-E470
- NWZ-E580
- NWZ-A10

NOTES:
- bootloader makefile convert an extra font to be installed alongside the bootloader
  since sysfont is way too small
- the toolsicon bitmap comes from the Oxygen iconset
- touchscreen driver is untested

TODO:
- implement audio routing driver (pcm is handled by pcm-alsa)
- fix playback: it crashes on illegal instruction in DEBUG builds
- find out why the browser starts at / instead of /contents
- implement radio support
- implement return to OF for usb handling
- calibrate battery curve (NB: of can report a battery level on a 0-5 scale but
  probabl don't want to use that ?)
- implement simulator build (we need a nice image of the player)
- figure out if we can detect jack removal

POTENTIAL TODOS:
- try to build a usb serial gadget and gdbserver

Change-Id: Ic77d71e0651355d47cc4e423a40fb64a60c69a80
2017-09-05 21:42:12 +02:00
Amaury Pouly
e2271ed75e qeditor: fix compile error and some comments
Change-Id: I157c83fea8173adc53254f15aa49e41ee1ba7549
2017-08-28 22:52:29 +02:00
Amaury Pouly
d1ca2e45e9 atjboottool: cleanup and add support for atj2127
Several people asked me recently how to decrypt atj2127 firmware. Someone
posted on github (https://github.com/nfd/atj2127decrypt) a decrypt utility
clearly reverse engineered from some unknown source. The code is an absolute
horror but I concluded that ATJ changed very little between ATJ213x and ATJ2127
so I added support for the ATJ2127, credit to this github code that I stole
and rewrite (code was under MIT licence). At the same time do some small code
cleanups.
Note that there is not 100% sure way that I know to distinguish between the
two firmware types, so the code tries to do an educated guess to detect
ATJ2127. If this does not work, use --atj21217 option. Also note that contrary
to the github tool that decrypts and unpack in one go, this tool only does one
step at once. So first decrypt: HEX -> AFI, then unpack AFI -> files.
I also added for a different version of AFI. Based on AFI files I have, there
are, I think, two versions: the "old" ones (pre-ATJ213x) and "new" ones. The
tool only supported the new one but for some reason the ATJ2127 uses the old
ones without a mostly empty header. Strangely, even this mostly empty header
does not seem to follow the old layout as reverse engineered by the s1mp3
project (https://sourceforge.net/p/s1mp3/code/HEAD/tree/trunk/s1fwx/heads.h),
so in fact there might be three versions. In any case, only the header is
different, the rest of the file is identical so at the moment I just don't
print any header info for "old" files.

Change-Id: I1de61e64f433f6cacd239cd3c1ba469b9bb12442
2017-07-30 14:32:12 +02:00