Commit graph

119 commits

Author SHA1 Message Date
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
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
a87a9ef373 imxtools: move tools to a new sbtools/ subdirectory
Change-Id: I0d8d6831b35037725486f61fc363de87bc8ba92e
2012-05-31 13:57:25 +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
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
Amaury Pouly
c483905b92 imxtools: remove most calls to bug/bugp from core library.
It should not exit() anymore on error except on malloc failure.
Resource leaks on errors (especially I/O) are quite likely though.

Change-Id: I6fcf72fb08fc683468b390d0b8745d31ca982b48
2012-02-19 18:36:57 +01:00
Dominik Riebeling
d23d164b85 imxtools: use rand() instead of /dev/random.
On Windows /dev/random does not exist, so trying to open it will fail. Replace
it with rand() which is available on all supported platforms and sufficient.

Fixes mkimxboot not working, as well as Rockbox Utility "crashing" (which is in
fact its error handler calling exit(), thus terminating Rockbox Utility) on
Windows.

Change-Id: Ia164f937f329877e8f80f473f27be8c5df2a0a68
2012-02-08 21:28:20 +01:00
Amaury Pouly
28a10ec490 sbloader: always send packets of size xfer_size (even the first). Also maintain a table of known transfer sizes. In particular stmp3770 uses 48 instead of 1024.
Change-Id: I08dddc76c251aeeaaa3b46c9466f9be54c3d4a45
2012-01-27 20:08:33 +01:00
Amaury Pouly
1b7455e910 imxtools: fix compilation when cross compiling for windows (tm doesn't have timezone fields)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31342 a1c6a512-1295-4272-9138-f99709370657
2011-12-17 10:22:36 +00:00
Amaury Pouly
cd832bd0f5 imxtools: add function to free instruction
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30919 a1c6a512-1295-4272-9138-f99709370657
2011-11-06 19:41:29 +00:00
Amaury Pouly
ad9e280281 imxtools: add const and set pointer to NULL on free to avoid double free
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30918 a1c6a512-1295-4272-9138-f99709370657
2011-11-06 19:41:25 +00:00
Amaury Pouly
e5db19de48 elftosb: add static
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30915 a1c6a512-1295-4272-9138-f99709370657
2011-11-06 13:30:13 +00:00
Amaury Pouly
5827937270 sbtools: rename to imxtools, move imx_hid_recovery to imxtools/sbloader, fix tools to correctly handle/free memory, properly return error codes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30907 a1c6a512-1295-4272-9138-f99709370657
2011-11-06 01:49:13 +00:00