Commit graph

1059 commits

Author SHA1 Message Date
Marcin Bukat
df2ac7428f adfuload: Improve arguments parsing
Change-Id: If18975f13d20bb7f7232cafdb4ea87fa516b5750
2014-11-06 07:56:02 +01:00
Marcin Bukat
d11704fed5 hwstub: Add atj213x support
Change-Id: Ic32200f9ab2c6977e503307a9cbe43a1328d0341
2014-11-05 08:18:59 +01:00
Amaury Pouly
791be56cff atjbootool: fix date printing
Change-Id: If5cd0d79e4afb12224932b24c63b016636c7a56e
2014-10-31 18:02:41 +01:00
Marcin Bukat
c626fe7004 atj213x: e100/150 lcd test binary
Change-Id: I3f9fa21dcb33d1cd3081d0c995adfb44e085dd7a
2014-10-18 20:18:01 +02:00
Amaury Pouly
40a2ac4b5f regtools/socdesc: fix red
Change-Id: If40c52168eb5cd2d194c90c3f65263d2b9da0451
2014-10-08 16:28:14 +02:00
Marcin Bukat
f9be1ef021 regtools: reg-rk27xx.xml description file rework and cleanup
Change-Id: I0a2e45eb1b4aa03122382cc93bbc0c292b3249be
2014-09-19 12:38:19 +02:00
Marcin Bukat
b888743cac qeditor: Implement clock analyzer for rk27xx
Change-Id: Ib8f53d32120893b6c1054299ed434a6650a0d7c2
Reviewed-on: http://gerrit.rockbox.org/971
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2014-09-19 11:00:31 +02:00
Amaury Pouly
970c2482dd qeditor: rework modified indicator, register tab names depend on content
Because Qt doesn't support QObject multiple inherance, it is a bit tricky
to have a base class which interact with the UI. The register tab name
now display:
- file dump name (for dumps)
- hwstub device path (for hwstub)
And the register editor display the filename
Change-Id: If2579992098c02627c67d560c824f1668e73bc45
Reviewed-on: http://gerrit.rockbox.org/979
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-19 10:58:33 +02:00
Amaury Pouly
dbb59291e7 qeditor: implement usb device list refresh (if supported)
Change-Id: Iaf05cad0e057f767dcde963d194027b2e290dbea
Reviewed-on: http://gerrit.rockbox.org/978
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-19 10:58:23 +02:00
Amaury Pouly
57d6db6ff5 qeditor: fix UI to update register/analyser view on each tree/list click
Change-Id: Idaceb7ffaf33c2184a43353dd9d7dee20ac807a9
Reviewed-on: http://gerrit.rockbox.org/972
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-19 10:58:16 +02:00
Amaury Pouly
79c5a07b4d qeditor: fix horrible out of bound bug
Change-Id: I1b34b1cd7be83d90e38559e386d0c6c64797b707
Reviewed-on: http://gerrit.rockbox.org/977
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-19 10:58:07 +02:00
Amaury Pouly
0c633db980 qeditor: when switching type tab, automagically switch view, implement reload
Change-Id: I7360af3b5dd7380151732687d6d8de3dbd503f20
Reviewed-on: http://gerrit.rockbox.org/976
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-19 10:57:59 +02:00
Amaury Pouly
e1f1f22b66 qeditor: avoid memory leak in RegTab
Change-Id: Ib7cd87b66c0ceb3d3ff93714709a43e2a97ce79a
Reviewed-on: http://gerrit.rockbox.org/975
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-19 10:57:47 +02:00
Amaury Pouly
a01bf8d93c qeditor: move backend selector to its own class, that's cleaner
Change-Id: I7f3fa66a8f67639b4b64cf9f6acc5fb10e227653
Reviewed-on: http://gerrit.rockbox.org/974
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-19 10:57:32 +02:00
Amaury Pouly
b2ef4a806b qeditor: initialise libusb once in a static ctor
Change-Id: Ic93def2b3633c498c9863b0dada3281853be8c6c
Reviewed-on: http://gerrit.rockbox.org/973
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-19 10:56:53 +02:00
Marcin Bukat
1f0fa05466 regtoools: Enhance rk27xx description file
Change-Id: If37551757188d98bcb27f7f469c11cf89bf64f62
2014-09-18 10:04:41 +02:00
Amaury Pouly
8855ce5a79 regtools/soc_desc: fix libxml2 misinit
The code did not call xmlInitParser() and would call xmlCleanupParser() each
time which is doubly wrong because 1) it's not init 2) all init/cleanup
must be done from the main thread. To ensure 2), call it from a static ctor.

Change-Id: I3d191bf3b8c0cfc51da78157e88c786636fd3ebf
Reviewed-on: http://gerrit.rockbox.org/966
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-16 12:16:55 +02:00
Marcin Bukat
77bfff58ec rk27xx: Fill UDC block description in regs-rk27xx.xml
Change-Id: Ia44169bda8f1558c1cbd4c8c0d2d3aaee262c991
2014-09-15 14:10:12 +02:00
Marcin Bukat
b7e3515a62 hwstub: small fixup in rk27xx usb driver
Change-Id: Ibf3b91af11041834ce650f663b213bac0113f721
2014-09-11 12:31:52 +02:00
Amaury Pouly
847106cdb2 hwstub: add support for jump/call in library
Change-Id: Ia57ca613609a5e89e41ff927d7fc137c6841046a
2014-09-08 11:12:54 +02:00
Amaury Pouly
d815c26e8f hwstub: implement jump/call in stub
Change-Id: I876fa012c5ae1509e57f5816a8ed31dc69d62ca0
2014-09-08 11:07:42 +02:00
Amaury Pouly
6cc057f180 hwstub: trivial changes
Change-Id: Iacb1721db1ae59d5f359d244fd68234915e611cf
2014-09-08 10:50:48 +02:00
Amaury Pouly
3c558127b8 sbtools: add option to ignore sha1 errors
Change-Id: I6bf9e4671e57f8ff3f436660e8ecb561027a036c
2014-09-07 17:47:00 +02:00
Amaury Pouly
6957966c86 hwstub: fix compile issue
Change-Id: I939c05d3c1319b122fe64bff0f0ea300ecbd1180
2014-09-07 17:46:53 +02:00
Amaury Pouly
ef0299c62e qeditor: add soc panel, to display soc information
Change-Id: Ie442b82d96fb150c7466f1a274240f9b111fd91e
2014-09-07 17:46:42 +02:00
Amaury Pouly
3daa6d64f6 qeditor: use hwstub library function to identify devices
The new protocol is interface based, so matching PID:VID is not sufficient

Change-Id: I27983a9c3b7db01b8e63b41e885f86d09c362f60
2014-09-07 17:46:36 +02:00
Amaury Pouly
ac5ba893d7 hwstub: library now check version on open
Change-Id: I672a882ad06780da93c1d811af2b28ff60d07469
2014-09-07 17:46:27 +02:00
Amaury Pouly
29de342134 hwstub: add string version
Change-Id: I919c27eb7ea69fdac7b3a65785a5a6eb3723a80e
2014-09-07 17:46:13 +02:00
Amaury Pouly
0c7c54e185 hwstub_shell: add support for set/clr/tog without SCT using read and write
Change-Id: Ib0a5123e5cc51ee193ef761c36af63467740c670
2014-09-07 17:45:56 +02:00
Amaury Pouly
6d13d9b718 hwstub: fix missing \n
Change-Id: I077a38d8a8905b7ad686d0d00b2a8a48bd206ade
2014-09-07 17:45:43 +02:00
Amaury Pouly
d3df564486 hwstub: fix horrible bug
Change-Id: I8042f692045a23dbb545d840e5169ce4b99fe5d2
2014-09-07 17:45:35 +02:00
Amaury Pouly
dd05dc76a4 hwstub: don't put revision in the protocol, it's specific to the implementation
Change-Id: I1311a22da41fe977f1613f1e313a864baa03027c
2014-09-07 17:45:28 +02:00
Amaury Pouly
43ca127ebf hwstub: fix library to actually work and compile, still miss some functions
Change-Id: I968dafb4dca7d674165a43e3a435762fe38ed37f
2014-09-07 17:45:21 +02:00
Amaury Pouly
12ce7fc2cc hwstub: remove protocol to make it use its own interface
This way, hwstub can be implemented along with other usb features/interfaces.

Change-Id: I7148cab845049cc0a8b8e740fa0d52d3a385eaed
2014-09-07 17:45:10 +02:00
Amaury Pouly
1dc1a9310e sbtools: use default transfer size if it cannot be probed
A older commit removed this ability but it tends to be a problem since the HID
driver can prevent probing of transfer size which then needs to be entered
by hand on the command line.

Change-Id: Ie5a556ffdcc2adec0e1c984810983e19136b6473
2014-09-07 17:44:53 +02:00
Marcin Bukat
21373e9043 hwpatcher: add generic RKW file patching script
This script is handy hacking tool to patch RKW file with
arbitrary binary and put jump into implanted code.
It also shows how to use hwstub crc routine.

Change-Id: I89b5086dc1ddaca3dbc03df26a85472d8a20d51e
2014-09-02 22:35:26 +02:00
Amaury Pouly
69df56504e hwpatcher: add framework for CRC computation
Change-Id: Ib78f0fe58db5cec86f043d3e9e1ca14e69297ba0
Reviewed-on: http://gerrit.rockbox.org/911
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2014-08-26 07:21:19 +02:00
Amaury Pouly
278e8664a7 hwpatcher: fix horrible typo in the makefile
Change-Id: I6e8d8ae3a5f6e1111a6b7d910a1a6b94e2733ca6
2014-08-13 12:44:26 +02:00
Marcin Bukat
53d9f2e6a7 rkwtool: The tool to inspect and extract update RKW files
Change-Id: Ie32d0a597b93d23a7d5946a3d9409572b41b45bc
2014-08-07 19:09:35 +02:00
Marcin Bukat
345841aa56 rk27load: stage1 dram config fix #2
Change-Id: I5c4cf3dedab26e4cae05496bcae3a2d235d12e2f
2014-07-23 22:11:10 +02:00
Marcin Bukat
dcd8172f4f rk27load: fix stage1 dram config bug
Change-Id: I03d44dbd05fcd5dfc0e508020fae7006d8a97505
2014-07-23 12:32:16 +02:00
Amaury Pouly
8bf1f044a0 Remove empty files
Change-Id: I44a4a90cddba7d0aed4d5f06934848690d0d32f4
2014-06-25 09:56:50 +02:00
Amaury Pouly
c9a028cc18 Introduce hwpatcher, a tool to patch binaries
This tool is a scriptable (lua) tool to patch binaries, it supports:
- raw binary
- ELF
- SB(v1/v2)
It also contains some basic routines to parse and generate useful arm/thumb code
like jump or register load/store. This is very useful to take a firmware and
patch an interrupt vector or some code to jump to an extra payload added to
the binary. Examples are provided for several STMP based target which the payload
is expected to be hwstub, and also for the Sansa View. A typical patcher usually
requires three elements:
- the lua patcher itself
- the payload (hwstub for example)
- (optional) a small stub either to jump properly to the payload or determine
  under which circumstance to do the jump (hold a key for example)

Change-Id: I6d36020a3bc9e636615ac8221b7591ade5f251e3
2014-06-24 18:07:56 +02:00
Marcin Bukat
f8785c8f6d hwstub: load rk27xx specific bits
Change-Id: Ie0c68925f933aebeb9b3497800a29de2d69fead2
2014-06-15 12:53:57 +02:00
Marcin Bukat
4f950e0af9 hwstub: Add support for rk27xx lradc block
Change-Id: I8fe15ad8207ac7098944bb85d6b66b91b9858e8f
2014-06-15 12:53:28 +02:00
Marcin Bukat
6c106a79c6 Rework reg description file for rk27xx
Change-Id: I3fc1c6c70c828dca285479eaa168328a2a8fdf2c
2014-06-15 12:49:56 +02:00
Marcin Bukat
e20256d6ae Add RKW build target in rk27xx hwstub
Change-Id: I5ad44916bc1ac5e8a9384db2369f07b137a1a715
2014-06-15 12:49:56 +02:00
Marcin Bukat
72d1d19ae7 hwstub: fix usb driver for rk27xx
Change-Id: I299e76837715c320987177eaea8459f8f199cb96
2014-06-15 12:49:56 +02:00
Amaury Pouly
eb7e70950e regtools: add new reg dumps from various targets
Change-Id: I289f03a8404c6aa8ec2ff94a8a0a3118fd3c7456
2014-05-25 16:38:09 +02:00
Dmitry Gamza
440ff9500b qeditor: on Windows it’s not impossible to create a file with AUX
Change-Id: Ic7ef01328eccbed4afddb0a09d2afbb6c1f6a28f
Reviewed-on: http://gerrit.rockbox.org/811
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-05-12 19:05:19 +02:00
Amaury Pouly
7b590a9536 qeditor: many enhancement
Qeditor has been improved in many ways:
- it can now dump all registers, just like the lua DUMPER.dump_all() command
- several crash were fixed
- when connected to a hwstub command, one can correctly edit individual fields
- the code was simplified in several places

Change-Id: I092b99ce3a12ff6417552de61d62c65f706bcff0
2014-05-11 19:56:56 +02:00
Amaury Pouly
4c1eafc208 regtools: headergen can now output the description in the headers
This is useful to provide some documentation in the code.

Change-Id: Ib440363d82c47c36fffb9567a2e7f374eaaa5cbc
2014-05-11 19:56:50 +02:00
Amaury Pouly
4fef1834e2 regtools: make qeditor aware of PP
Change-Id: I3b4fa625499aa66bb5617971445fa3c1c209134e
2014-05-11 19:56:21 +02:00
Amaury Pouly
d8071221c5 hwstub: add some PP and Sansa View code
Change-Id: If188a01adee2a0e1c7a46c424a0a9cde9f666831
2014-05-11 19:56:15 +02:00
Amaury Pouly
5b89e6618f hwstub: hwstub_shell can now run files/cmd provides on command line
Change-Id: Id5cb3bee52b39e2ddec95c646ca9b4a3334bdf92
2014-05-11 19:55:57 +02:00
Amaury Pouly
dc869e70ac qeditor: add support for deletion of items
Change-Id: I886e15585bd3bfed3303e4b845cd8960a9461277
2014-05-11 19:54:48 +02:00
Amaury Pouly
8d0d3cb6f5 qeditor: fix include
Change-Id: Ie6013be29729267294c13fd4e86edad3904aa114
2014-05-11 19:54:47 +02:00
Amaury Pouly
17affb8085 hwstub: fix hwstub_shell
Change-Id: I008a55675054c86fd206cc5248f2bd9475e80b49
2014-05-11 19:54:47 +02:00
Amaury Pouly
fcb835f61a regtools: normalise description files, and remove obsolete file. No logical change.
Files were generated using utils/regtools/tester in "write" mode.

Change-Id: Ib391b8dbb5ec84eb821e0d0a3699d306414f2aa1
2014-05-01 19:35:05 +02:00
Amaury Pouly
cf93b33613 regtools: fix makefiles
Change-Id: Ib69aac4e7510c99398130467b7fe0f10fc4897f7
2014-05-01 19:34:58 +02:00
Amaury Pouly
4356666101 regtools: completely rework qeditor, improve soc desc library and tools
The graphical editor can now display and editor description files.
The library has been improved to provide more useful function.
The XML format has been slightly changed: only one soc is allowed per file
(this is was already de facto the case since <soc> was the root tag).
Also introduce a DTD to validate the files.

Change-Id: If70ba35b6dc0242bdb87411cf4baee9597798aac
2014-05-01 19:34:18 +02:00
Amaury Pouly
3754624edc regtools: update soc desc parser/header to include desc fields
Change-Id: I32374784d17f4352905f15e404df23b01338235b
2014-05-01 19:32:01 +02:00
Amaury Pouly
238be18d03 hwstub: add proper PP support
- drop support for PP500x: it's very different from other PP and although
  it would be possible to support them, I don't have one to test the code
- make sure only the CPU is started
- add PP descriptor to report chip ID and revision
- add code in shell and lua to support pp (no register description yet)
- compile for ARMv4 because PP502x is an ARM7TDMI

Change-Id: I36c4e465dfc2cfdfe7433b2f65cc8f6f0720fe62
2014-04-12 00:11:13 +02:00
Amaury Pouly
910235b49a hwstub: fix error in config descriptor, cleanup some code
Change-Id: I853340ed2c187a044726ca03ec52aed655707e27
2014-04-12 00:11:13 +02:00
Amaury Pouly
ccfa51835e Add hwstub support for portal player (manufacturer mode)
It is very similar to how e200tool from MrH works but uses the framework
of hwstub which is makes it completely trivial since we already have the
USB driver written.

Change-Id: I61cdc245d3f828c2682bcd6ecfed5a1cc0094139
2014-04-07 22:26:50 +02:00
Amaury Pouly
399acc0387 Add new tool to upload code on e200/c200/view in manufacturer mode
This is actually the trivial part of e200tool from MrH: it simply writes the
code on the bulk endpoint. Code was mostly copied from imxtools/sbloader.

Change-Id: I6c208840d23553aaf3bd8b9374e6b0337e54f3b0
2014-04-07 22:25:06 +02:00
Thomas Martitz
dda54b85da ypr1: Add some commands to rockbox.sh which are needed for playback
Change-Id: I2772e218174b5d1fbc7c066fee41d6fb06c01900
2014-03-09 23:25:50 +01:00
Marcin Bukat
c64b59fc5e atj213x: various fixes in sample code snippets
Change-Id: I78781e1a56cb6705d011ee2296f1789b497a566a
2014-03-04 11:07:07 +01:00
Amaury Pouly
c02bc1afd2 imxtools/scsitools: increase SCSI delay to 10 seconds
On some OSes like Windows or if running in a virtual machine, the one second
timeout might be too short.

Change-Id: I717f7a2aaed1cb3d40e8fbe6f9b1081b43ceea95
2014-02-22 20:27:32 +01:00
Amaury Pouly
9517bd86b0 imxtools/scsitool: add progress indicator
Change-Id: I061ddac4f882156139e38fa6d495fee86271a6aa
2014-02-22 18:12:00 +01:00
Amaury Pouly
4e1a043cf0 imxtools/scsitool: improve output formatting
Change-Id: Ifc5b5252e1342f381356f7bd5c2fed5ad8beddfe
2014-02-22 18:11:30 +01:00
Amaury Pouly
49db199a36 regtools: fix headergen variadic macro generation
Change-Id: I5e2439e5dcbeaaafda75c6ea457e53ee1ba26463
2014-02-18 18:14:08 +01:00
Marcin Bukat
101d10ff6c atj213x: rework crt0.S in test code
Rework init code so relocation is safe for binaries linked
into cached unmapped KSEG0 region.

Change-Id: I705ee3f0334f8998237f249a2c3059d6dbe78a43
2014-02-14 08:37:01 +01:00
Marcin Bukat
44afbd3ac2 regtools: Add rk27xx register description file
Change-Id: I27101876d031cbcbb00e741ea742a6f64a7baad7
2014-02-13 21:55:43 +01:00
Amaury Pouly
1210de217e regtools/qeditor: fix crash when hwstub device fails to open
Change-Id: Ica2fd201f2ae8ee63b1ae81f27433c841d2f22cd
2014-02-13 11:51:48 +01:00
Amaury Pouly
c35e4a4b7d Fix red
Change-Id: Ib64eb3539e33d4336c298612b4508c4611b80c9e
2014-02-12 13:14:02 +01:00
Amaury Pouly
04fc97b362 regtools/qeditor: implement UI code to write registers
The UI now has a "read-only" check box to prevent accidently changes: once
unchecked, the UI can do write to register (only full register writes are
supported for now). If the register supports it, the UI provides SCT writes
as well. The display register panel was moved to its own class to cleanup
things a bit.

Change-Id: I0fc6aab3b351f9080076102ee6fad0037ab5353b
2014-02-10 23:14:27 +01:00
Amaury Pouly
6e132b48d5 regtools/qeditor: enhance backend write with write mode (SCT)
Change-Id: I723bce7a60fb08c1d1d5f894a225c36bc1ba4394
2014-02-10 23:14:27 +01:00
Amaury Pouly
b8bad8412f regtools/qeditor: clean-up
Free the backend when closing a tab to release some memory. Implement about
dialogs.

Change-Id: Ic8c500a23d38e6c3dd4de6a4ba862012925968be
2014-02-10 23:14:26 +01:00
Amaury Pouly
a66a5af4db regtools/qeditor: prepare support for register writing
Change-Id: Ifef36a3ddb1604db63ec974da2d6a77a5540ff42
2014-02-10 23:14:26 +01:00
Amaury Pouly
3d07706c05 regtools/qeditor: rewrite soc handling
The code was a mess with respect to soc handling: some code just plain copied
the SoC descriptor which are big objects, some was using indexes. The new soc
factor out everything in a few classes which hide these ugly details so that
descriptors are never copied.

Change-Id: I17af8b47f997a528b58221621389d42d24fded93
2014-02-10 23:14:26 +01:00
Amaury Pouly
8358707d82 hwstub/regtools/qeditor: put soc descriptors in a list instead of a vector
A SoC descriptor is not a small object: it can be as large as ~100KiB so
it's better to avoid copying things over.

Change-Id: I1ef862e1260299cdaa0c4d2822ac45968713498a
2014-02-10 23:14:26 +01:00
Amaury Pouly
f982ea6398 utils/regtools: slight rework of tab management in qeditor
Change-Id: Iaf41defb79bb76010f3ff5269c28e4bad991ebc3
2014-02-10 23:14:26 +01:00
Amaury Pouly
0e0c610df0 utils/regtools: make qeditor able to poke directly at a hwstub device
This commit add the very handy feature of being able to read registers
directly from a device using hwstub. This is mostly trivial using the hwstub
library and the biggest change here is actually:
- being able to read registers by name and/or addresses
- being able to enumerate devives
The UI code currently doesn't handle hotplug but the backend does so it should
be trivial to add in the future. It also opens up the possibility the write
registers from hwstub or save the register values to a file.
Since it relies on both hwstub and libusb, a switch has been introduced in
qmake to disable it (use -config nohwstub).

Change-Id: I5d7d7a2a7c97ecd7407227357c8553c2773ea6cc
2014-02-10 23:14:25 +01:00
Amaury Pouly
81dfed27cf utils/hwstub: make stmp stub able to load in a MMU'ed environement
In might be useful to load hwstub in an environment with the MMU active,
in which case care must be taken on the order in which things are done.
Mostly, one should not disable the MMU before moving stuff around. The code
assumes the linking address (0 currently) is identity mapped.

Change-Id: I8d54ce9e8cadcde2e08990353ca7a46803731ca7
2014-02-10 23:14:25 +01:00
Amaury Pouly
c17d30f204 utils/hwstub: completely rework the protocol, drop unused features
The protocol has evolved a lot during the 2.x.y lifetime, bringing more
features which later got unused. This commit removes all the unused stuff
and simplifies everything:
- drop the feature mask: everything is mandatory or stalled on error
- remove the info request and put all static information in standard USB
  descriptors which are part of the configuration descriptor (and can be
  retrieved using the standard GetDescriptor request).
- remove the USB interface, we had only one anyway
- remove all endpoint descriptors
- remove the exit/atexit stuff, it never worked as intended anyway
- update the hwstub library and make it able to handle any device
- update the tools (mostly renaming and removing of code)

Change-Id: I1872bba7f4177fc3891180e8f944aab88f5bde31
2014-02-10 23:14:24 +01:00
Marcin Bukat
7552542288 atj213x: Simple test exploring irq handling
This test software setups timer T0 periodic interrupt.
In ISR it changes backlight level. The interrupt handler
does not support nesting and the whole ISR is run in interrupt
context. Exceptions are not handled yet.

Change-Id: Idc5d622991c7257b4577448d8be08ddd1c24c745
2014-02-09 22:29:30 +01:00
Lorenzo Miori
e876f4df6d Samsung YP-R1 target port
This is the basic port to the new target Samsung
YP-R1, which runs on a similar platform as YP-R0.
Port is usable, although there are still
some optimizations that have to be done.

Change-Id: If83a8e386369e413581753780c159026d9e41f04
2014-02-05 09:56:21 +01:00
Thomas Martitz
b828b9d99b samsung ypr0: Include getty service in the patched firmware for usb serial shell access.
The getty service mointors /dev/ttyGS0 (also created by the patched firmware).
When the g_serial.ko module is loaded this automatically enables shell access
via usb. It exposes a cdc-acm device to the host which is compatible to linux
(usb_serial.ko) and windows.

The g_serial.ko is not included module can be build from the YP-R0 open source
package provided by samsung. It can be loaded via rc.user on the internal memory.

Change-Id: I4903a635fd2e2f0ce6f5e91589a31d72bba2776b
2014-02-04 22:26:06 +01:00
Amaury Pouly
7272a95b9c rk27utils: improve command line parsing, allow arbitrary USB ids in rkusbtool
Change-Id: I884fe29c10dede7823721c2cac5dc627d6ab25c6
Reviewed-on: http://gerrit.rockbox.org/731
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2014-01-30 21:20:06 +01:00
Marcin Bukat
51d8a45057 adfuload: add atj213x timer0 test program
This simple program shows how to setup timer for periodic
operation. Interrupts are not used yet and simply pending
irq bit is polled and cleared when set. This program
supports my understanding of disassm of ADEC_N63.BIN that
P_CLK is configured for 7.5MHz and timer clock source is P_CLK
directly.

Change-Id: Idd6461bf847c763b78b8c324012ec2515f65dd41
2014-01-08 08:56:09 +01:00
Thomas Martitz
98d2121eaa bloat-o-meter.py: Now compatible to python 3.
Change-Id: Id617aa6304a5a9263ef6ceed7d9c3010b47e73a8
2014-01-07 10:35:59 +01:00
Marcin Bukat
062801e3ed atj213x: obtain PC value in more elegant way
Change-Id: I2e6ffb3b58ddda0ea62ce5d4cd71ac5475b34495
2014-01-03 09:00:11 +01:00
Amaury Pouly
8566cd7ebf regtools/qeditor: always open a register tab at init
Change-Id: I47a1413ca648c7166571e6b0ba88c7ebb5ce86a8
2013-12-24 15:25:42 +01:00
Amaury Pouly
a0fd5e8547 hwstub: update zenxfistyle code
Change-Id: I7e85101eca7dfc0f68c215936be4aa19749923ad
2013-12-24 15:25:32 +01:00
Amaury Pouly
16de558b36 hwstub: use delay in zenxfistyle code
Change-Id: Ia9576162b3b28d3778fe479cc321c879d73247c6
2013-12-24 15:25:09 +01:00
Amaury Pouly
01475e724b hwstub: fix lcdif pin setup for 18-bit bus
Change-Id: I30a2cedb1170abbee5a80c33206c147eb4207ca5
2013-12-24 15:24:50 +01:00
Amaury Pouly
5b865de73a hwstub: add delay function
Change-Id: Iab208ed59a9a2540a64b190357411d3de28f288e
2013-12-24 15:24:40 +01:00
Amaury Pouly
1dc91b4560 hwstub: add ZEN X-Fi Style code (preliminary)
Change-Id: I535d54bc3fb2263c174b7ae983ea4f5ed68e6390
2013-12-24 12:39:58 +01:00
Amaury Pouly
84f1a0af3b imxtools/scsitools: tool can now write a firmware using SCSI
Change-Id: Iac803d4b2d48319a1a32d1101f5041d20174c7a1
2013-12-24 12:39:58 +01:00
Amaury Pouly
e0636afed2 hwstub: fix lcdif code for 18-bit word length
Change-Id: I38cf0b5808443d5c19ebddb329c2a1636bcc4b28
2013-12-24 12:39:58 +01:00
Marcin Bukat
87c6df98a3 adfuload: add test program
This test program. I add it mainly to document somehow my work:
1) atj213x.h    lists registers addresses
2) crt0.S       exploits self relocation of the binary
3) test_bl.c    documents how to control backlight on e150

Change-Id: I055e0fe065d926a5c3805b73cea3f537cb64bf52
2013-12-13 22:43:52 +01:00
Amaury Pouly
8666871cb3 hwstub/stmp: disable watchdog
Some targets like Sony NWZ use a watchdog, so we must disable it to prevent
spurious reboot when we take over

Change-Id: I138a8d7f9a1b089acb2d08d7f6c4a58e8b088b3a
2013-12-13 00:20:18 +01:00
Amaury Pouly
3bbe52bb85 hwstub/stmp: cleanup
Conditional no longer needed since ctr0.S is private to target, also setup
stack just before jumping to C code only

Change-Id: I74116239be9e87bbe53e8fa814c45f04f242f1c1
2013-12-13 00:20:18 +01:00
Marcin Bukat
b5ca0cffac adfuload: utility to upload and exec binary using brom adfu mode of atj213x SoC
Change-Id: If52aa34124be2801c2ac316641ff9aa0bbd837c6
2013-12-11 15:42:25 +01:00
Amaury Pouly
99835fa38b imxtools/sbtools/sb1: fix parsing/debug bug about jump/call arguments
Change-Id: Ib406cfc03ced6c8689ed467c154d6a7447a34e5c
2013-12-06 15:22:38 +01:00
Amaury Pouly
6eefc418dc imxtools/sbtools/elf: fix debug code
Change-Id: If043eb214417a41f71e6c05fc6a725eb8f983373
2013-12-06 15:22:38 +01:00
Marcin Bukat
3440f3518e hwstub: Prepare for multi arch support
Change-Id: Id38411ff95660e60ee23f99350b275b92b3e4578
Reviewed-on: http://gerrit.rockbox.org/690
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-12-06 11:46:01 +01:00
Amaury Pouly
c5b209f2d8 elftosb: fix crash on invalid command file
Change-Id: Ifef61b7ca6a391960d1d696ba455e0d14462c967
2013-12-06 11:37:49 +01:00
Amaury Pouly
f365a5123f hwstub: forgot the db command file for stmp
Change-Id: I08ca6be221d3633c5b6e5e4b023afca33713e428
2013-12-06 11:37:10 +01:00
Amaury Pouly
e43bfdd5e8 regtools: update STMP3600 descriptio (fix EMI block)
Change-Id: I654e3210c1050e3bd559c9e9b29707a6341b111b
2013-12-06 02:00:40 +01:00
Amaury Pouly
58bb4b9b4c hwstub: implement i2c and i2c eeprom dump
Change-Id: Iff1b4f40affb88c104e7322e25cdbe34f8886476
2013-12-06 01:56:04 +01:00
Amaury Pouly
a15a15ba61 hstub: add Sansa Express lcd code
Change-Id: I61fc58e3c97a3666eac98d21226865181b85eef1
2013-12-03 01:35:34 +01:00
Amaury Pouly
15155ed100 regtools: update xml format documentation
Change-Id: I7e293532983f350a6f7cd9c7bc2bc6633c8fd3f2
Reviewed-on: http://gerrit.rockbox.org/671
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-12-02 20:21:58 +01:00
Amaury Pouly
f04d3c518a regtools: add shortcut notation for simple register in the desc files
Change-Id: I2745287844ad0a47dd41ba4dae5e1f7218ae5814
Reviewed-on: http://gerrit.rockbox.org/679
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-11-26 00:29:48 +01:00
Amaury Pouly
ef2b6db066 regtools/qeditor: fix url
Change-Id: I9783ff809c69bb5617b2048d1e11374cd8f680ab
2013-11-25 22:52:21 +00:00
Amaury Pouly
85578cdc4d utils/regtools/qeditor: fix compilation by avoiding g++ specific syntax
Change-Id: Ie3d36c6c235a5fd70ffc51552fae3392a015beb0
2013-11-25 12:50:33 +00:00
Marcin Bukat
8e63338591 hwstub rk27xx port
Change-Id: I85ac57117911544b65ccd56eb16303e30be67cab
2013-11-24 00:10:36 +01:00
Amaury Pouly
fb8faa16ea hwstub: only load stmp files on stmp targets
Change-Id: I9266ec6db457b1d649cbdcb6c9bd1d0f3223b867
2013-11-20 16:39:20 +00:00
Amaury Pouly
287be81c16 hwstub: use a more reasonable hclk frequency
The old code would set CPU to 64MHz and HCLK to 9MHz but that's too low for
many things like usb and gpmi. So change HCLK to ~32MHZ.

Change-Id: I6459f25900e42603333cebccb7b0ed26c59640ad
2013-11-18 21:44:06 +00:00
Amaury Pouly
27111d83be hwstub: fix stmp3600
The microseconds register has a different address

Change-Id: I29d2e7feea9eb34b0d539ee217babd092542b612
2013-10-26 17:34:58 +02:00
Amaury Pouly
1085d15a3e hwstub: produce sb1 image too (for STMP3600)
Change-Id: Ib7f38fba1e524ed7438cdc395441d801c5eabcaa
2013-10-26 17:34:35 +02:00
Amaury Pouly
eefab13469 utils/regtools: add a bunch of regdumps for various sources
Change-Id: I67bbd2d1b02ca4541f70d2e9c8c0e6000300dcac
2013-10-22 00:52:43 +02:00
Amaury Pouly
cec5ac7bf7 utils/hwstub: fix zen target id
Change-Id: I9199f573a050223a811a8e82e403f113fb876cca
2013-10-22 00:35:32 +02:00
Amaury Pouly
9ed9807854 hwstub: rework i2c completely
Change-Id: I1e5f87f15f0ca9586d8185316ffcaeef6d9d4d38
2013-10-22 00:34:44 +02:00
Amaury Pouly
bfb67f41a9 hwstub: don't touch mmu registers on non-STMP targets, they might not exist
Change-Id: Ib18475fd90e0d29ab6d7214116f7a0041584d621
2013-10-22 00:34:44 +02:00
Amaury Pouly
f5807141b6 imxtools/scsitools: document some of the SCSI vendor commands
Change-Id: I534fc467aad960c61b54d202096823d5c2c9a5e9
2013-10-10 00:11:47 +02:00
Amaury Pouly
468aa959c7 imxtools/sbloader: rewrite hid code
Rewrite code with proper documentation: it uses a UMS like CBW/CSW to wrap
commands and status.

Change-Id: I10476c87aaea96d4b9e54f8c1c266835c8e89721
2013-10-09 13:06:41 +02:00
Amaury Pouly
1c63993e05 imxtools/sbtools: always probe report size for HID recovery mode
Some older versions of the ROM (TA3 for example), use a 64 byte report size
instead of 1024, so hardcoding 1024 is just a bad idea.

Change-Id: I720c4465cfe2f519bffa307175614bba58766dce
2013-10-09 13:05:43 +02:00
Amaury Pouly
835d740fca hwstub: fix lcd drivers for sony NWZ
Change-Id: I8d581ec906ec2bab0d983aacfb0e8479b77d0c57
2013-09-26 16:41:30 +02:00
Amaury Pouly
46248b3df9 hwstub: add some code for the NWZ-E360/E370
Change-Id: I9fe5da773705ec4c3d014b8ac7f78ad614e20a30
2013-09-25 14:31:39 +02:00
Amaury Pouly
f46ff0f076 hwstub: add stmp i2c code
Change-Id: I6787e682a9e22cb34e6d94d25bf68d7575d784c4
2013-09-25 14:31:39 +02:00
Amaury Pouly
b8c98a86fb regtools/qeditor: improve pinctrl analyser display
Change-Id: I45850f4f0213aac5f0538c865cfa84137fcb83e3
2013-09-18 13:37:25 +02:00
Amaury Pouly
963dfc529c regtools/qeditor: enhance pinctrl analyser
Change-Id: I82c5a86ade4c804872ac7665bce583499467cae9
2013-09-18 13:18:12 +02:00
Amaury Pouly
30b20bf2e7 retools/qeditor: add pin decoder (very basic add the moment)
Change-Id: I5309794efda67fd3bf5c265b35ea7da5faf662f6
2013-09-18 13:18:00 +02:00
Amaury Pouly
8f122e0091 imxtools: add pin map and decoding tool
Also add the tool which was used to generate the map on wiki.

Change-Id: I54f3474028b5fa75348564437ec1b46ba20f071b
2013-09-18 13:17:54 +02:00
Amaury Pouly
27433076e9 tcctool: fix Makefile
The version.sh tool tries to locate the repository root if no argument is
given but it doesn't really work. Instead explicitely give it the path to
the root.

Change-Id: Ie3a35cb3d41bbd8819823358763f714ad045527e
2013-09-18 13:14:20 +02:00
Amaury Pouly
afd85634a0 tcctool: add YP-T10
The SDCFG value is the default one but it seems to work

Change-Id: Iaf990aa2e8e738f0929e49322c0a28ce461d49a7
2013-09-18 13:13:32 +02:00
Lorenzo Miori
66aa00d3e0 Samsung YP-R0/YP-R1 Safe Mode improvement
This is an improvement for the special
mode present in the samsung ypr0 target.
Apart adding new useful functionalities, it
fixes a random disconnection bug, solved by debouncing
and fully support to YP-R1 target.
This opens also the possibility to interface
this operating mode to rockbox USB functionality.

Change-Id: Id70541541fcfaa1234328485fab0696a3bd491c9
2013-09-16 12:55:48 +02:00
Lorenzo Miori
5ef1e2dcfa ypr0-ypr1 firmware tools fix
fixed a bug concerning bytes padding, since it wasn't correctly
implemented regarding original firmware structure.
This fixes ROM generation especially for ypr1.

Change-Id: I1a40fb4bb8f9d6b005d694246123e314c4d19b49
Reviewed-on: http://gerrit.rockbox.org/616
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2013-09-11 23:08:37 +02:00
Amaury Pouly
743a6d0a57 hwstub: add pix clock setup
Change-Id: I94f764c0fcfb47bd9ccafe23f6d6079b42f23826
2013-09-10 23:19:34 +02:00
Amaury Pouly
0ee25f62eb hwstub: various fix
Change-Id: I4dee8e115e282d1d6540013c9b9f1263e30690de
2013-09-10 23:19:34 +02:00
Amaury Pouly
8785a499f4 imxtools/efltosb: fix extern() in db files
Change-Id: I5f1acd619b2f280e709d2bd06a28a3e88cc05e27
2013-09-10 23:19:34 +02:00
Amaury Pouly
3b6d2ac28a hwstub: add delay functions, and plain binary/sb file generation
Change-Id: Idbedb9277b355edcd93975ec5a268428c7b89633
2013-09-10 23:19:34 +02:00
Lorenzo Miori
da8a6a90c3 Firmware tools for Samsung YP-R0/YP-R1 (and possibly others)
They have been rewritten for being completely free and
as fast as possible.
Successfully extracted, patched, repacked and flashed
original firmware (tested on device and it worked)

Change-Id: I74d47d13f2dc3a2832a0d6821d3c2182dfd4b33b
Reviewed-on: http://gerrit.rockbox.org/506
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Tested-by: Thomas Martitz <kugel@rockbox.org>
2013-09-07 15:56:07 +02:00
Amaury Pouly
f40b15d0cb hwstub: improve lcdif, digtctl, add sony nwz-e370
Change-Id: I5316cc9fd9addfca8a674628695fed1c1bf9269f
2013-09-05 23:16:27 +02:00
Amaury Pouly
3713bc4b7c imxtools/scsitools: add option to extract firmware from the device
Change-Id: Ib8cbf2f864a9375575cea0edbba48f740bf8f12e
2013-09-05 23:16:06 +02:00
Marcin Bukat
f182a11f33 rk27utils: Add nandextract utility
This quick and dirty utility allows to extract nand bootloader
from raw 1st nand block dump. I post it mainly to somewhat
document how BCH error correction engine of the rk27xx works.

Change-Id: I37ca91add7d372e3576d2722afc946d0f08971a9
2013-09-02 12:35:47 +02:00
Amaury Pouly
67a16f9ae1 regtools: various fix
Change-Id: I3a37221d1688c2f1cbc649bbd2fd27dc78d286a6
2013-08-22 23:45:14 +02:00
Amaury Pouly
142ce48771 regtools: fix several bugs in qeditor
Change-Id: I1bef76d30eb47c4ebc8a2baca356d9c135b234ae
2013-08-22 17:50:59 +02:00
Amaury Pouly
acaedfdb89 sbtools: fix elf section naming
Change-Id: I4500bf70028af26cc4b8136f111f527e1396d16e
2013-08-22 15:05:13 +02:00
Amaury Pouly
260399ee8c sbtools: more work on sbtoelf and elftosb, support more attributes
Now handle timestamp, sb minor version, component/product versions,
section flags.

Change-Id: I35313efe60c28f04ea3732b36e5e01be3213cf9e
2013-08-22 14:39:46 +02:00
Amaury Pouly
a122b52d66 sbtools: factor code in command parser
Change-Id: I790c373b8a0319cdb00650d3c59919bd4b0b96f6
2013-08-22 01:15:00 +02:00
Amaury Pouly
81f97f67e2 sbtools: now generate a db file along with with elf/rsrc files
Now always generate a "make.db" file which aims at being the exact
representation of the file, ie running sbtoelf and elftosb using
the generated command file should produce the exact same file
(except for the random paddings). We still miss the support
for some option parsing to achieve that though.

Change-Id: Ib7d6b241f7855fd35225df8ab8e0711f69d9ee5a
2013-08-22 00:58:19 +02:00
Amaury Pouly
e64008bf9a sbtools: fix buffer overflow
Change-Id: I7b1c963e58eec88da215722ec219569a0a5a9cea
2013-08-22 00:49:34 +02:00
Amaury Pouly
8dc7970bb5 sbtools: fix red
Change-Id: I28b7d4d59d8f14abbba2a70e2bdea6987b6a3a98
2013-08-21 23:02:49 +02:00
Amaury Pouly
99f3ca174e sbtools: more code refactoring
Factor all printf method with a unique one defined in misc.h

Change-Id: I58fbf8916b76e873a2e6678506d2c8aece7834ec
2013-08-21 22:20:53 +02:00
Amaury Pouly
1357e0a4f1 regtools: add a register dump of the Fuze+ OF
This dump has been obtained with hwpatcher + hwstub, the fuze+
was running OF 2.36.8 in normal mode while playing some mp3.

Change-Id: Ieecaa760fe8ccade0858db929b9d7c175a3eaddf
2013-08-21 20:29:23 +02:00
Amaury Pouly
c323381f0b regtools: add graphical register explorer + analyser
This tool allows one to explore any register map. Register dumps
(like produced by hwstub tools) can be loaded and decoded by the
tool. Finally some analysers are provided for specific soc analysis
like clock tree and emi on imx233 for example.

Change-Id: Iaf81bd52d15f3e44ab4fe9bc039153fcf60cf92a
2013-08-21 20:18:37 +02:00
Amaury Pouly
1b1692ff06 hwstub: add stmp clkctrl code and generic register dumper
Change-Id: I432853fb4171f07ed23b73dc0499814fe8ce8748
2013-08-11 19:18:58 +02:00
Amaury Pouly
d759bd3710 hwstub: add atexit and exit stub function to DEV
Change-Id: I17cfe52de3f6f546a46ace3252113024625f15d1
2013-08-11 19:18:16 +02:00
Amaury Pouly
4aae8274b3 hwstub: fix power off and reboot code on stmp
Change-Id: Ia717c5e6f78a2cecc6a0628e4c667ea39f32c44c
2013-08-11 19:17:57 +02:00
Amaury Pouly
0ec1536d64 hwstub: allow the stub to relocate itself
Change-Id: Iab60c6ec0e8eda19c76c84241f8367d53cb4f87b
2013-08-11 19:17:36 +02:00
Amaury Pouly
cb8274373b sbtools: more printf fixing
Change-Id: Id617297c196b381fd1c381da3eff4345e3157529
2013-08-10 21:37:27 +02:00
Amaury Pouly
c0aba07f1a sbtools: fix output printing
The code used printf instead of the provided printf functions,
resulting in strange output.

Change-Id: I2c7c2531d8d54ecdea97e8c189d18d351320ca7d
2013-08-06 21:24:38 +02:00
Amaury Pouly
97459def3c sbtools: fix handling of NOP instructions
Change-Id: I05ab8176f368a6e2d075dfb2059692871e0c00b3
2013-08-06 21:24:38 +02:00
Amaury Pouly
8b13d2f5f1 elf: fix handling of virtual/physical addresses
Remove the hackish elf_translate_addresses which should not have
existed in the first place, on write always compute the physical
address of a section using elf_translate_virtual_address which
makes it possible to specify any virtual to physical mapping and
fail nicely if there is none.

Change-Id: I4f436945e90280a6fd9430de6c642dbeb8e23d40
2013-08-06 21:24:38 +02:00
Amaury Pouly
8e69c37b5a sbtools: various fixes
Change-Id: I82c4642aea325cf22d66e9b49fc2d47319cd70eb
2013-08-06 21:24:38 +02:00
Amaury Pouly
e69293ecdb sbtools: standard sb print function is now standard
Change-Id: I2746bfff9a360ef4fc823853859609ffed5d2b67
2013-08-06 21:24:38 +02:00
Amaury Pouly
f72617c002 sbtools: elf library can now load global symbols
Change-Id: I4d9f38ce31e65542d6ab192158bff52b6fad8f09
2013-08-06 21:24:38 +02:00
Amaury Pouly
e4c9eaa7e8 sbtools: add helper to determine if a file is a valid ELF image
Change-Id: Ie0e9c05569ca9b02fd36f31fd7323f02b14e1b60
2013-08-06 21:24:38 +02:00
Amaury Pouly
76446dda45 sbtools: make code aware of elf section names
Change-Id: I7ab657959e38d2fcb2c7e6d9858facfb83101423
2013-08-06 21:24:38 +02:00
Amaury Pouly
1c8c24183e sbtools: refactor and cleanup
Factor common elf/sb read/write/printf routines. Factor sb zero
key, move sb version guess.

Change-Id: I5ae1885587456736e782e623610281bbee545039
2013-07-18 00:27:12 +02:00
Amaury Pouly
3c5ee9ac57 hwstub: forgot file
Change-Id: Ib79f4ef89c734d7ba2fcbf648aadc346576e1c17
2013-07-16 22:23:14 +02:00
Amaury Pouly
e5de5e09c1 hwstub: enhance exit protocol and implement on stmp
Rename STOP command to EXIT, introduce ATEXIT, this gives better
control over the exit of the stub. Add stmp implementation.

Change-Id: I45442c8b88b9330d12ef439417ca5ffa1520477a
2013-07-16 19:29:42 +02:00
Amaury Pouly
7827b7ccdb hwstub: allow to escape shell with a function call
Change-Id: I65b7b230d3b89a5014db134d3159861474fd889f
2013-07-13 17:47:01 +02:00
Amaury Pouly
f617da0552 hwstub: enhance protocol with more functions
Change-Id: I7944249c2f7ea3e180e7b79ee8ae402d1d0742d3
2013-07-13 17:47:01 +02:00
Amaury Pouly
140783ef66 hwstub: split target specific code from the common part
Completely rewrite the Mafile, properly put the usb driver in its
own file and the target specific files in a subdirectory.

Change-Id: Iaeee0128e021d5dad76b4d6035a63e33e2d946c1
2013-07-13 17:47:01 +02:00
Amaury Pouly
08e466ff92 imxtools: add device info and serial number requests to scsitool
Change-Id: I17b679062fa53c20034e7db6f4080f8762a7818c
2013-07-07 17:36:21 +02:00
Amaury Pouly
00faabef5e imx233: document some more stmp vendor scsi command
Change-Id: Ie03c0c8288b4bd9c0b4beedae363cff6caf3c5cd
2013-07-03 01:05:00 +02:00
Amaury Pouly
87b84c07d7 sbtools: fix sbloader (allow transfer size override)
Change-Id: Id6d3188b7f837726c29845f01b0b1588acf40407
2013-06-18 14:59:13 +02:00
Amaury Pouly
505f37e1b8 sbtools: various little fixes, mostly cosmetics
Change-Id: Ic53ef0283bdaee8d3272f648b71eff567b25059b
2013-06-17 13:58:59 +02:00
Amaury Pouly
c1eafa1b65 sbtools: add Sansa Express bootloader key
Change-Id: I167a6410e40478173e5ce496ace4f705c3e26a1b
2013-06-17 13:38:31 +02:00
Amaury Pouly
7c7fa36918 sbtools,mkximboot: fix whitespace
Change-Id: I8d8adb783707172d1aaef302366c240310350ed8
2013-06-15 22:27:34 +02:00
Amaury Pouly
5aab4431fb Cosmetics
Change-Id: Id7974f1a79b5d803155ccfc417277a73ffd9046a
2013-06-15 22:27:34 +02:00
Amaury Pouly
97b9ade639 regtools: improve header generator
The generator now has more options to generate or not selectors.
It can also generate a macro header containing lots of using
macros for register operations.

Change-Id: I9dd6b4bdc7daeabd1a2c9365ce082358475721b5
2013-06-15 22:27:33 +02:00
Amaury Pouly
9ad50ade17 imxtools: add Zen, Zen Mozaic and Zen X-Fi bootloader keys
Change-Id: I856e5b91c8e9a1c02b367960052c36f9b527046b
2013-06-13 02:31:19 +02:00
Amaury Pouly
07e82c163e imxtools: rewrite sbloader to handle both versions + user friendly
The tool can now load sb1 and sb files to devices. Detection has
been improved and the tool can infer the packet size for the HID
description as well. The command line interface has been vastly
improved too, this breaks the old one.

Change-Id: I01a0ff8f8a007514aa81c56f114c0f0a86e3303c
2013-06-13 02:29:36 +02:00
Amaury Pouly
1dae3a82e2 sbtools: fix encryption and cosmetics
Change-Id: Id302f236ad3ec13a5166de4e22a3fc85b2a6c64f
2013-06-13 02:27:30 +02:00
Amaury Pouly
f9cb5de580 hwstub: introduce lua code for the STMP and Creative ZEN V/Mozaic
Change-Id: Ice5f509a2e0d2114436d4760f338b9203ef96691
2013-06-13 02:25:15 +02:00
Amaury Pouly
c5357940ab hwstub: major improvement in the stub and the tools
Fix the stub in many way to correctly detect the STMP family and
act upon that. Drop some unused commands and bump version.
Rewrite the tool to allows scripting in lua and load the register
description from an XML file using the regtools. Introduce a new
tool to load and run code using the hwstub (either binary format
or Rockbox additive scramble format). Also switch to an optimise
version of the memcpy/move/set functions to correctly handle
alignement issue (like writing a full word/half-word when
possible for registers which is crucial)

Change-Id: Id1d5cfe0b1b47e8b43900d32c5cd6eafae6414f6
2013-06-13 02:25:15 +02:00
Amaury Pouly
934e1e15af regtools: add the STMP3600 register map
Change-Id: Ief34c219bbe05c9aeed665235942bb158bb0f4d4
2013-06-13 02:25:14 +02:00
Amaury Pouly
73db73dbd3 regtools: modify description format and refactor tools
Change the XML description to unify multi dev/reg in a clean
fashion. Move the description parser to its own library. Fix
the tester and headergen tools to work with the new format and
library. Move the STMP3700/3780 descriptions to the new format
(and fixes many errors as well). Drop the hwemulgen tool
in favor on the upcoming hwstub tools revamp.

Change-Id: I7119a187aab5c8b083cc5228cb1b248ee29f184d
2013-06-13 02:25:08 +02:00
Amaury Pouly
7143ea681c imxtools: move regtools to its own directory
The register tools are in no way stmp specific. The XML
description of the registers is powerful enough to describe
the STMP register which should be more than enough to describe
virtually all other SoCs. The generators follow the STMP coding
convention but others could be used as well.

Change-Id: If1a9f56e4a3594161688de34adbea698e5aaecd8
2013-06-12 19:49:26 +02:00
Amaury Pouly
11da9d23fe imxtools: move hwemul to its own directory
The hwemul is only partly imx specific: the stub is stmp specific
but could be ported to other targets, the computer side and the
protocol are mostly stmp independent (or should be).

Change-Id: If88febffe591b0de86ea11cb740455ba20ddc401
2013-06-12 19:46:04 +02:00
Dominik Riebeling
9574b30066 time-sync: allow passing an arbitrary time.
During testing it can be useful to set an arbitrary (non-current) time on the
device. Extend time-sync to accept an additional (optional) parameter with the
time to set. Only changes date / time, no timezone.

Change-Id: Ib320777cb245cff19ca00b20540db3a43a4e488f
2013-06-09 19:51:08 +02:00
Dominik Riebeling
6b3c4beba4 Rework langstat.
- Generally improve code and make it compliant to PEP8.
- Make it work with Python3 as well.

Change-Id: I9e99999c59dc501664c36dd38fcb85fb60d6d9e6
2013-06-09 16:54:59 +02:00
Marcin Bukat
b2dd1f8d46 rk27load: Fix stage1 (dram init routine)
Change-Id: I9f7bbb7e938bd5886c11533b1aa939bd27cab555
2013-04-15 21:04:21 +02:00
Amaury Pouly
d504a6b220 rknanoutils: fix boot tool
Correctly descramble the first stages (0 to 2) in continuous mode.
Also fix a disassembled (but unused) crc routine used in dfu mode.

Change-Id: I20016d1c696a9bcb6584377ee9b55493783c7159
2013-03-21 19:02:03 +01:00
Amaury Pouly
6ea48cf92b rknanoutils: add dfu tool
This tool can upload a firmware to the device in DFU mode. The
protocol is the same as the rk27xx devices except that it can
load a bigger (unlimited ?) firmware.

Change-Id: Ic9d4c5087629a9156f9d5d5cdc80767e6359c431
2013-03-21 19:02:02 +01:00
Amaury Pouly
d220940443 rknanoutils: fix stupid mistake
Change-Id: I5267533226d833b20abb3cfd27cc390aef1181e4
2013-03-16 01:24:31 +01:00
Frank Gevaerts
3e4be68f8b Make the tarball generation tool handle spaces in filenames
<insert opinion on such filenames here>

Change-Id: Ie1b5fac97eea93c9ac934ffb8bf6c0d9a0559339
2013-03-05 22:37:27 +01:00
Amaury Pouly
bc05242517 imxtools/sbtools: silence warning
Change-Id: I423e760bbc8e418bcce3afe01c5831b5a3e655f3
2013-02-18 13:43:55 +01:00
Amaury Pouly
4362a7ba33 imxtools/sbtools: add -jump command, fix help
Change-Id: I0d5d61c1dc137333bda5e403d06a43d16f2750bf
2013-02-18 13:40:25 +01:00
Amaury Pouly
ac9304299d sbtools/elftosb1: implement key file loading
Change-Id: I2273b8d6314250620611ec50d159237edc6d76c2
2013-02-18 13:40:25 +01:00
Amaury Pouly
b05b762ed4 sbtools: add brute force option for sb1 in sbtoelf
After some reverse engineering, it appears that the keys of the
sb1 format are very weak: the 128 bytes are generated from the
laserfuse words 4,5 and 6 but in a weird manner: 4 and 5 are
simply ORed and 6 is only half used (somehow), making it "only" a
48 bit word to find.

Change-Id: I40702e19d0924ef51c01894efce3cb65bd664456
2013-02-16 20:49:07 +01:00
Amaury Pouly
4db4985f21 sbtools: increase performance by compiling with O3, add zenv key
Change-Id: I2301f695e49d306d21bb9efa9c44acf1d3296a08
2013-02-16 20:49:07 +01:00
Amaury Pouly
a085c10674 imxtools/hwemul: fix Makefile linking order
Change-Id: Ie9ad10c627a86b1e6e689052fd436529d3ba6591
2013-01-30 00:02:56 +00:00
Amaury Pouly
9d2631854c imxtools/hwemul: add readline support
Change-Id: If2e86bf8b520a8d4c38a56ac969918fdeb2c6f91
2013-01-29 23:58:45 +00:00
Amaury Pouly
6d5b1b2448 imxtools/sbtoelf: add more robust version guess
Change-Id: I41ce1005d997cf35153e085b19294bb7d418e968
2013-01-29 20:46:28 +00:00
Amaury Pouly
5b00e59614 imxtools/sbtools: fix file type detection
Change-Id: I872e98f5810df3ecc975e025385f9c5ca7b47a44
2013-01-26 18:24:50 +00:00
Amaury Pouly
75df5c2684 imxtools/hwemul: allow for toolchain prefix override
Change-Id: I4f790441edac01ab2e8cb286c766ea0b272b4780
2013-01-26 18:24:50 +00:00
Amaury Pouly
8ed0d198c5 imxtools/scsitools: add support for more commands
Change-Id: Iddff64502ba357dcd36903d31015b9ae2d00ae62
2013-01-15 19:42:20 +00:00
Amaury Pouly
b9923df170 imxtools/nwztools: fix compilation for windows
There is a windows port of the sg_utils library for scsi pass-
through. This little changes make it compile under mingw. A better
fix would be to implement direct ioctl on both windows and linux
but that's already better than nothing

Change-Id: I0d77cd1bad69806a66f0590362f165f24fa240e9
2013-01-10 00:51:35 +00:00
Amaury Pouly
423755d1bd imxtools/sbtools: improve sb1 key handling
Change-Id: Ib014a102fe44a67dd256e45e804bca9b5812eb61
2012-12-26 01:17:28 +01:00
Amaury Pouly
c3a7190d78 imxtools/sbtools: add crypto code for documentation purpose
Change-Id: I4f3c659d65c1453b192cbce4bf6c85d882761929
2012-12-26 01:17:27 +01:00
Amaury Pouly
54a414b69e elftosb1: fix usage()
Change-Id: I9ce73b907fa6276b9cd1f285156623bdafa6d548
2012-12-26 01:17:27 +01:00
Amaury Pouly
b748243d4f imxtools/sbtools: implement rom/product/component version switch
Change-Id: If3ebae2e60f324c93f85a4f1a6f30257cccb735d
2012-12-16 23:35:23 +01:00
Amaury Pouly
fa1af088e9 imxtools/sbtools: fix sb1 product/component version writing
Change-Id: I0153192f41ccc5fb98e7e9f6f110d97bd76dbc47
2012-12-16 23:35:03 +01:00
Amaury Pouly
47f6d77690 imxtools/sbtools: "fix" address handling in ELF
This is a common problem that proprietary tools don't handle ELF
files correctly. ELF sections use a virtual address and the
virtual -> physical translation is done though segments. This
allows to have a load (physical) address different from the
virtual one. Here is the trick: proprietary tools usually don't
take the pain to do the translation and just grab the virtual
address. This commit implements proper translation in elftosb1
knowing that this introduce a deviation from the behaviour of the
proprietary tool.

Change-Id: I91721a3a8dead382a0603f84ae3b35c5eb9704eb
2012-12-16 21:28:41 +01:00
Amaury Pouly
1e2e79d668 imxtools/sbtools: introduce elftosb1 for stmp36xx
The tool still lacks some feature of the proprietary one but
can create files with all the basic features.

Change-Id: Ib0c91210940ca829291ce70945f88dc510a49974
2012-12-16 21:28:41 +01:00
Amaury Pouly
212cfdf771 imxtools/sbtools: fix some instruction handling & crypto
Change-Id: I6530bdf27896d8325dec4e2ba31c7e6a0131a286
2012-12-16 21:28:41 +01:00
Amaury Pouly
f4f600fc52 imxtools/sbtools: add elf function (sort by address)
Change-Id: Ib68746e11b43eadbbe0443626d4dc65d998348fa
2012-12-16 21:28:41 +01:00
Amaury Pouly
be9787f2e6 imxtools/sbtools: update misc with MIN
Change-Id: I17daaff068fcd3a8c70c52db5fa209082461173f
2012-12-16 21:28:41 +01:00
Amaury Pouly
6f47b29915 imxtools/sbtoelf: use new method to get default xor key
Change-Id: Ie00306a3c78e7490afe9964bd55ce53019e603ed
2012-12-16 01:53:20 +01:00
Amaury Pouly
4fc3397c5b imxtools/sbtools: implement sb1 write
Change-Id: Ic36d3a8fcf09350dff5988eb860d76eb11608cc2
2012-12-16 01:52:19 +01:00
Amaury Pouly
51604e8445 imxtools/elftosb: remove duplicate include
Change-Id: I34776ba3608bb5d25ce0d0fb3c6f228a4c9effc0
2012-12-16 01:51:49 +01:00
Amaury Pouly
cdaef6f382 imxtools/hwemul: remove useless code (pwm)
The PWM code was for testing only the Zen X-Fi and should be
present in general because it could touch pins by error and
without producing any result.

Change-Id: Id20e2940cd7a057941d241254d0a867f5451e2db
2012-12-14 12:06:11 +01:00
Amaury Pouly
788bf2e3b2 imxtools/sbloader: implement stmp36xx recovery support
Change-Id: I6cfb432cd474ca00d7dff77577c0aa499b78fe2d
2012-12-13 16:02:58 +01:00
Amaury Pouly
153bc0d7ec sbtools/sbload: prepare support for the stmp36xx
Change-Id: I13147009f2573d80c2c3dca2852a6d7b45174e9d
2012-12-13 00:24:19 +01:00
Amaury Pouly
2a52b937e4 imxtools/scsitool: retrieve the minimum amount of inquiry data
Some device only report the minimum (36 bytes) amount of inquiry
data so don't ask for more

Change-Id: Ie74d659f6e27b077acba160aeb87d1e7edf82e66
2012-12-13 00:23:33 +01:00
Amaury Pouly
c644f6b7f1 sbootls/rsrc: fix warnings
Change-Id: Id756cab14c9151ea74d628d002e1a203c5fbf01a
2012-12-13 00:23:07 +01:00
Amaury Pouly
b86b0a1b44 imxtools: introduce the new scsitool
It appears that all devices based on the Sigmaltel SDK support a
common vendor specific SCSI interface when in UMS mode. This
applies to the STMP36xx and the STMP37xx. This interface supports
many operations:
- get device info
- get device paritionning
- get janus/drm info
- read/write/allocate/erase any partition
- reset (chip or to updater and/or recovery)
This includes the ability to do a firmware upgrade by rewriting
the firmware partition. The tool currently does mostly nothing
but will be enhanced depending on the reverse engineering efforts
and the use of it. It has been tested on the Fuze+ and the Zen
X-Fi2/3.

Change-Id: Ibd4b2ad364c03ada4f9001573ef4cc87cfb041d1
2012-12-11 20:20:49 +01:00
Amaury Pouly
fb05b3e698 newtools/scsitool: fix typo
Change-Id: I882956c0022db846882c68f8aac7f9d8fe49dfa8
2012-12-11 20:20:49 +01:00
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