Commit graph

625 commits

Author SHA1 Message Date
Amaury Pouly
fb43a137e7 samsungtool: allow firmware creation
The new tool fwcrypt can create a firmware image with a specified
model, version, region and so on.

Change-Id: I0e90e9ab905398a3e7ae3f4fb8b8bbfb2d12d703
2012-12-06 12:17:50 +01:00
Amaury Pouly
8666e83aaa rsrctool: improve debug output
Change-Id: I3a4fc048466b9e4d7290237efc1cefb07fd0a118
2012-12-06 12:17:50 +01:00
Amaury Pouly
4dd2c5277b hwemul: fix code (out of bound access)
As noticed by bertrik some code accesses an array out of its bounds

Change-Id: I891d0305213ca7081c386b306f87fe9e1ba3b6c5
2012-12-02 11:51:50 +01:00
Amaury Pouly
9f19209c77 rsrctool: produce an actually usuable entry list of the rsrc file
Change-Id: I6c8e5f3faf04741e4a13c1e705e9e869ccf8cfec
2012-12-02 11:51:50 +01:00
Amaury Pouly
d66c16749a Introduce samsungtools to decrypt samsung firmware
Samsung provides many firmware upgrade in the format of a .dat
file, at least for nearly all YP's (checked for Q2, R0, T10, Z5).
This is a simple cyclic xor which a fixed key, a md5 sum and a
header specifying the model/version/region.

Change-Id: Ib0461a74196383189fd2d8162da444a85a229c60
2012-11-29 17:30:54 +01:00
Amaury Pouly
ee36a396cd imxtools: introduce rsrctool to manipulate rsrc sections
This tool is very preliminary but could be use for whatever
purpose since the format of the rsrc sections is now known.
By the way it appears that this format is the same as the
one use by the stmp36xx for its resources.

Change-Id: Idd7057f5cdce5af9726904169bb100c8bacb0981
2012-11-29 17:30:54 +01:00
Amaury Pouly
9d77ad364d sbtoelf: add switch to prevent elf simplification
While elf simplification is a powerful tool it can be useful to
prevent it from happening for debug purposes. Also add a missing
switch description in usage() and missing static.

Change-Id: I80a1904dc4340c412bd3de1c124a2e38d6ac11a2
2012-11-28 00:17:15 +01:00
Amaury Pouly
f988f5c951 sbtoelf: also simplify elf files for sb2
This is less useful is most cases because sb2 doesn't have the
size restritions but some elf are produced with one section per
file and still yield dozens or hundreds of sections. And this free
anyway so we can do it.

Change-Id: Ia5ca83a8375063ecc7052d1ea73b2b21c00be730
2012-11-28 00:12:17 +01:00
Amaury Pouly
1c14041041 sbtoelf: implement elf simplification
Change-Id: Icfac5a2aa6a7b3582054321df003c6bb217b59d0
2012-11-28 00:06:31 +01:00
Amaury Pouly
8189732e52 sbtoelf: implement sb extraction for sb1
Load, fill and call/jump instructions are extracted as elf files
like for sb2. Because of the size limitations of the sb1
instructions, the resulting elf files can easily have hundreds of
sections. The (currently) implemented elf simplification method
will hopefully reduce this to a few sections only

Change-Id: I8fd6ed935ac3128f244bbd71c782e2a0a1c6d44a
2012-11-27 22:38:48 +01:00
Amaury Pouly
7dc3e939d2 sbtoelf: implement sb1 loading and dumping
Implement actual loading of a sb1 file to a structure in full
generality. Also implement dumping for debug purpose

Change-Id: I320035ea628719480a79aaccb05dce9a83256927
2012-11-27 22:16:56 +01:00
Amaury Pouly
9716d1f1f9 sbtools: add forgotten file
Change-Id: I701a301efa369c9e1247e10d226ba69e6064d1b2
2012-11-27 00:01:35 +01:00
Amaury Pouly
4e95b72ecb sbtools: add support for the stmp36xx format
The STMP36xx series also uses .sb files but with a different
format. The main differences are the encryption and the lack of
sections, making it basically a list of commands: fill, load,
call, jump, switch mode, set sdram settings. Currently only the
sbtoelf has support for the sb1 and can only dump the list of
commands. Actual support for elf creation will come later.

Change-Id: I1f2e0230c91ac64efd0e8430e0c5212098c599fd
2012-11-26 23:58:30 +01:00
Amaury Pouly
f44d95630c imxtools: introduce hwemul
The hwemul tool is a small binary blob running on the device
that can received commands over USB. It is mainly intended to be
loaded using the recory mode and allows to read/write registers,
memory, use the OTP device, ... The tool is split into three
parts: dev/ contains the actual blob (which handles both imx233
and stmp3700), lib/ contains the communication library and can
also use the register description produced by the regtools/
to ease register by name, tools/ contains an interactive tool
to send commands to the device when running the blob.

Change-Id: Ie8cb32e987f825d8ed750d48071e43415b4dacb3
2012-11-14 12:51:51 +01:00
Amaury Pouly
ec2153f2dd regtools: add the imx233/stmp3780 and the stmp3700 reg map
These files were produced by parsing some linux and/or sigmatel
provided headers and later tweaked by hand or by programs.
Each file describes one or more soc. A soc has a list of devices.
Each device can either be unique or have several copies at
different addresses. Each device has a list of registers which
can either be unique or indexed. Each register can further have
a list of fields. Registers with a SCT variant are also handled.

Change-Id: Ib50bb3fda268b6d5713f81bd8961de7978a5815e
2012-11-14 12:37:32 +01:00
Amaury Pouly
0c6b63479d imxtools: add regtools to work with register descriptions
These tools allow one to read a register description in a XML
file and to produce something useful out of it. Three example
programs are written:
- tester which simply prints the register tree
- headergen which produces a set of headers with the #define
- hwemulgen which produces something for the hwemul tool (to come)

Change-Id: I52573688b29d5faeaf64ce7c5ffe08ee8db3d33c
2012-11-14 12:35:21 +01:00
Amaury Pouly
214f226ca6 upgtools: allow creation of a UPG archive + improvements
Change-Id: I9c3e2eb95f7eb6d41591b006328fd720dfcf93a5
2012-11-13 18:25:00 +01:00
Amaury Pouly
02f67224f9 scsitools: add nwz firmware upgrade scsi command
Change-Id: Iaebb442611c64fe4d47a07ce3b3d12c3230cafe5
2012-11-13 18:25:00 +01:00
Amaury Pouly
12862df624 emmctools: add debug statements
Change-Id: I9a15c347cfaab821b0cfc01744c5b6b8267c40ea
2012-11-13 18:25:00 +01:00
Amaury Pouly
99f20b85f6 nwztools: various fix and enhancements
Change-Id: Iaa89df27b7a0c4eb9fc6603c431de3d1fe791fa1
2012-11-03 14:04:27 +01:00
Amaury Pouly
6d04ed343c scsi_tools: add support for nvp reading
There is a vendor specific command to read the NVP of the device,
including the KAS. The trick is that the data is randomly
scrambled using a so-called para_noise array of random values.
There seems to be a problem when retrieving large entries (>1000
bytes typically) which causes sg_pt do behave strangely.

Change-Id: Iefa6140df78ab9c7dcf7ac34cb1170979123ecd7
2012-11-03 04:25:25 +01:00
Amaury Pouly
3e1c492680 Introduce scsitool for sony nwz players
This tool can send vendor specific scsi commands to sony nwz
players such as getting serial number, model id, device info,
and others. It can potentially be used to get some private keys
stored on the device but probably not the KAS used to encrypt
firmware upgrades images(UPG).

Change-Id: Ia49c1edf8d421b20c4e9afeb1192e00e06eb6047
2012-11-03 02:29:00 +01:00
Amaury Pouly
cb09e369fb Introduce upgtools for sony nwz players
This tool can unpack UPG archives for firmware updates.

Change-Id: I32f5f1a84759198c7af4a4ecfd7aa65eaeda567a
2012-11-03 02:16:01 +01:00
Amaury Pouly
8c1a9f5082 Introduce emmctools for the sony nwz players.
This tool is specific to the em1/mp200 sony based players. In
deals with raw emmc images (which is possible but hard to get).
This tool is also useful as a documentation of the underlying
emmc format used for a future port.

Change-Id: I66c9b0e47351e5d89f6a404aa62038e00fdc1093
2012-11-03 02:14:04 +01:00
Amaury Pouly
08ca0b59c8 atjboottool: add missing copyright headers
Change-Id: Idb2f5e4b0bd6a84bc3eaff088fb4706f46ed1535
2012-10-30 13:14:52 +01:00
Amaury Pouly
89254cb612 rknanoutils: add raw encode mode, add header fields
The raw encode mode allows to use the raw encode_page routine on
any file which proved to be useful. The guessed fields of the
headers are based on some rk2918 headers which leaked. They are
mainly informative though (date, version, chip).

Change-Id: I139ea0c40f76b6dde041c448bbf3e7ecf9cab24a
2012-10-18 10:41:14 +02:00
Amaury Pouly
283277e5ab atj: provide default output prefix/filenames on unpacking
If no output prefix is specified, a default is picked:
- filename with extension replaced by .afi for FWU files
- filename with extension replaced by .fw/ for AFI files
- filename without extension and with / for FW files

Change-Id: I6497b8f4a49f1238e5db738429f687cad3ae8a5a
2012-10-04 12:27:17 +02:00
Amaury Pouly
821efc46ec Introduce atjboottool for ATJ213x firmwares
Change-Id: Ie857b82e25de235c8549defab7e75995efefb3f6
2012-10-03 14:27:19 +02:00
Amaury Pouly
2f1da04cc3 zenutils/update_extract: make sure the archive is valid
The update_extract tool works by finding the compressed size and
the compressed data in the updater. This is problematic since
without the uncompressed size, inflate can produce extra bytes
at end. This is not a problem for our tools but the device will
plain reject it if sent by MTP/sendfirm for example.
Workaround this issue by reading and rewriting the archive
after decompression so that only the meaningfull data is written.

Change-Id: I117f434b92a56d93d269af49c3e426cd8cc0c7e4
2012-06-27 14:56:20 +02:00
Amaury Pouly
7c9e7ec707 sbtools: add option to force sb dump
In the case of encrypted SB files without any key match, it is
still possible to dump the section headers. The force option
allows one to do so. It also allows to dump unencrypted sections
of encrypted files if there are some.

Change-Id: I36280230679ac5903f9c451c68c276f5c6959536
2012-06-27 14:55:58 +02:00
Amaury Pouly
f62009303a rknanoutils: fix crash with no prefix, remove debug code
Change-Id: I73e277a8dc2fbd5790b1d7173e449d883710f27a
2012-06-19 23:01:00 +02:00
Amaury Pouly
906963ae76 rknanoutils: much more sensible format guess
I finally found a sensible format for the executable files.
The tool now can output the loading entry to elf files. Some
disassembly and analysis suggest the phys/virt addresses are
correct. However the entries are somehow linked and it is
still unclear how (are there "calls" to the code ? when ?).

Change-Id: Ied38b5bb297176c5755b5ecb3309f4a259c18cd4
2012-06-19 22:54:41 +02:00
Amaury Pouly
d6bbe39dc6 rknanoutils: more reverse engineering of the BOOT format.
I found out that the file has a number of "entries", in
3 categories. The third category seem to contain bootable files.
In the RKnano firmware file I have, these entries are named
"NandBoot1" and "NandBoot2". They seem to use the same format as
the stage3 of the RKnanoFW format but we do not understand this
format precisely for now anyway.

Change-Id: I72d77e609cdeeb802af793c010d6788bf36cd7e2
2012-06-19 15:42:16 +02:00
Amaury Pouly
cbd44f4bc4 Update the rknano utils.
This is mostly based on reverse engineer of the _RKUpgrade.dll
from the SAM3xx upgrader.

Change-Id: I37f4503899c7198ce463130b2ff994da9ca7dc4b
2012-06-10 21:56:37 +02:00
Amaury Pouly
c4911de1a0 Initial commit from rknano utils. This is very preliminary work.
Change-Id: Iddc4b39a4611f12b9eefc3a96d7eeb7229777ebb
2012-06-07 14:49:14 +02:00
Amaury Pouly
cc59ea453d Fix findaddr.pl tool for codecs
Change-Id: I19dff8c9f3e8195d1e8d652e6365375a87debddf
2012-05-31 15:56:34 +02:00
Amaury Pouly
a87a9ef373 imxtools: move tools to a new sbtools/ subdirectory
Change-Id: I0d8d6831b35037725486f61fc363de87bc8ba92e
2012-05-31 13:57:25 +02:00
Thomas Martitz
9c33f93c1c ypr0: Add kernel module to required support fm radio.
To support fm radio a kernel module was written. This module is added to
the patched firmware that loads Rockbox. It's pre-compiled but its source
archive provided.

The kernel module provides raw-access to the built-in si4709 radio chip.
Our existing si 47xx drivers can be re-used this way.

The module itself was written Lorenzo Miori, I only integrated it
into the tree.

Change-Id: I6205d28a505d57791eaeb627e6856b9a1eaeaeaa
2012-05-28 19:38:09 +02:00
Amaury Pouly
391f3ea2ae Cosmetics
Change-Id: I6ad5b6c2e4f8f57db2068fe372ab4ecadf4d03a9
2012-05-20 01:35:24 +02:00
Amaury Pouly
9f89ffa71c mkimxboot: fix warnings
Change-Id: If88b61566d8c81eda7cfc482fa82213657ae41b2
2012-05-19 16:48:15 +02:00
Amaury Pouly
b62ec2ba80 imxtools: make sb api work with in-memory files
Change-Id: I517244802efb118be214437bbaea2ef811e87aea
2012-05-19 16:10:52 +02:00
Dominik Riebeling
972b8945b8 Fix a typo.
Change-Id: I358add5df8971bc3eab4c4cf71d2e792e51979d1
2012-05-14 23:02:21 +02:00
Marcin Bukat
36d7f64555 Fix rkusbtool compilation (FS#12664) by Teemu Nätkinniemi
Change-Id: Id18eca4ade80cce2ab68317af6b7b9751d04b1cd
2012-05-13 17:53:55 +02:00
Dominik Riebeling
91cf4a7768 gitscraper: Provide way to get timestamps for files.
When scraping files from the repository allow passing an additional list of
files for which the timestamp of the last change is retrieved. Since this is
slow (the log needs to be traversed, since a blob doesn't know about commits
its referenced by) only specified files get this retrieved.

Change-Id: I61a2ef812ac18ffb5898c01ce070046d4ca00a15
2012-04-29 11:48:07 +02:00
Sean Bartell
f40bfc9267 Add codecs to librbcodec.
Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97
Reviewed-on: http://gerrit.rockbox.org/137
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
2012-04-25 22:13:20 +02:00
Amaury Pouly
a0009907de imxtools: fix missing '\n'
Change-Id: I93630f5c303064deb5880421202425046aa3074f
2012-04-25 13:36:38 +02:00
Amaury Pouly
b9f9d0da51 imxtools: fix missing '\n'
Change-Id: I8d6a70e644225211b35e7b160bdf06e12c611198
2012-04-25 13:36:38 +02:00
Dominik Riebeling
885db72b8b gitscraper: support Python3.
Make gitscraper and tarball script work with both Python 2 and Python 3. Tested
with 2.7 and 3.2.

Change-Id: I31b2580660d764d013bca6fe59d5663ae9f7f5aa
2012-04-22 21:34:01 +02:00
Dominik Riebeling
2aae745458 Add new tarball generation script.
The old script depended on svn. An earlier version of this script has already
been used in the 3.11. branch.

Change-Id: Id03abb8f7bd005ede343243194c4453f0b2e8943
2012-04-12 21:15:49 +02:00
Dominik Riebeling
e9d5f6cb61 gitscraper: support compressing the sources as 7z.
The Rockbox source code uses 7z for its archive for size reasons. Add support
for compressing as 7z (by calling the 7z command line utility) so it can be
used for generating Rockbox source archives.

Change-Id: I26097ff61ff183e5ddc07b2c4473f90dc0700178
2012-04-12 21:08:38 +02:00