Commit graph

1052 commits

Author SHA1 Message Date
Amaury Pouly
0a2290653b nwztools/plattools: rework/clean and add an all-in-one tool
This new tool (all_tools) embeds all the other tools and provides a menu to
choose which one to run.

Change-Id: I0e07864dd46559a7079b0f942c25155e6fa07112
2016-10-31 17:50:16 +01:00
Amaury Pouly
ad9a2d5241 nwztools/plattools: add a tool to change destination and sound pressure
Since the nwz_lib does not have any nvp code yet, it's quite of ugly hack
with hardcoded nvp node (11) for shipment information (shp). Thus I whitelisted
two series (NWZ-E460 and NWZ-A860) which I know for sure use this node ID.

Change-Id: I94c9b0db1f9d7ad764d2aa50576a911e710f25e1
2016-10-28 23:28:25 +02:00
Amaury Pouly
3097239ce6 nwztools/plattools: add device list
This list can map from model id to device name. It was automatically extracted
from Sony's tools. In the future, we will probably generate it from a clean
database containing more useful information.

Change-Id: Ibe580edf25b60bf0bf4aef4a06f40dddd19c5404
2016-10-28 23:27:29 +02:00
Amaury Pouly
281c8d4700 nwztools/scripts: export model id in an environment variable
This is useful because there is no easy way to get it except from Sony's tool,
unless one knows the npv node, but that requires to know the model already...

Change-Id: I202f7cdb2f7cf924cc5bdb53c17e34600d4bf153
2016-10-28 23:25:43 +02:00
Amaury Pouly
37f95f67fe nwztools/upgtools: rewrite keysig brute force search
The new search has two new features:
- it takes advantage of the fact that DES keys are only 56-bit long (and not 64)
- it is now multithreaded
As a proof of concept, I ran it on the A10 series firmware upgrade and was able
to find the key in a few seconds using 4 threads. The search is still limited
to ascii hex passwords (seems to work on all devices I have tried thus far).

Change-Id: Ied080286d2bbdc493a6ceaecaaadba802b429666
2016-10-27 23:06:16 +02:00
Amaury Pouly
794104dd17 nwztools/plattools: switch to BACK key to quit
The power off/option does not exist on some models.

Change-Id: Ifb45293b3b3faa96d9fece2340cbd98299a4a0b7
2016-10-26 20:46:57 +02:00
Amaury Pouly
d42b43c786 nwztools/plattools: add test_power, rework input, add test_ts (touchscreen)
Change-Id: I55ca29627801b5e760d1dbe407d96cd055f659ab
2016-10-26 20:46:57 +02:00
Amaury Pouly
fed083cf06 hwstub: fix compile and linking ordering
Change-Id: I0acd3db2f644f4521da715d4931315bdb7548eae
2016-10-22 15:55:33 +02:00
Amaury Pouly
0b01ca69e0 nwztools/plattools: add adc test
Change-Id: Ic3ef964e8b5cc7b8ca3f02f141e9e4436a4d41db
2016-10-19 18:20:27 +02:00
Amaury Pouly
8d24b62912 nwztools/plattools: add backlight test
Change-Id: I4bef0824eeed54238578d8b24a9845e8602d61af
2016-10-19 17:58:40 +02:00
Amaury Pouly
ba91ff10e8 nwztools: add a new plattools directory with code to run on the device
This is code is intended to development into a library of code for the NWZ that
will be useful to write the "bootloader" on those device. At the same time, it
comes with test programs that are easy to run in firmware upgrade mode and also
provide a great test bench for the library. At the moment, two test programs are
available:
- test_display: simply prints two messages using /usr/bin/lcdmsg
- test_keys: displays input key event

Change-Id: I9d214894ffc9127b528fcdd3eb5d6b61f4e657a7
2016-10-19 17:09:04 +02:00
Amaury Pouly
13d892eef1 nwztools: update makefile and add script
The new script allows the upgrade to execute a file found on the user partition.

Change-Id: I564941d01bcdbae050002e77cb119f3d95ecdc21
2016-10-19 17:09:04 +02:00
Amaury Pouly
eaa1cb3469 fix typo
Change-Id: Ia69e5ff941549ca98b23b40927137bb29876b8f9
2016-10-19 17:09:04 +02:00
Amaury Pouly
21fb5aff39 nwztools: rework upg scripts
The exec_file allows to embed a script/executable and run it on target. It takes
of unpacking, remounting contents rw and redirect output to exec.txt at the root
of the drive. More generally, rework how the makefile works.

Change-Id: Iec719227be96e80701ad8f5398d2d34389f4da9e
2016-10-19 17:09:04 +02:00
Amaury Pouly
6f7ee0bb7c regtools: fix library bug when checking if a reference is valid or not
Change-Id: I8adea40d2fa7c1a26f1975d987233249f61af8ef
2016-09-21 00:31:18 +01:00
Amaury Pouly
7b1bcae879 regtools: rename error_t to err_t to avoid name clash
Change-Id: Ib8d34e4f58f3225b1dafc533ce7e1b7867ad053b
2016-09-21 00:31:12 +01:00
Amaury Pouly
84ff8a4df9 headergen_v1: remove warnings with newer GCCs
Change-Id: I90ed3a0c911014eee013cbea0e98a85f4310471d
2016-09-21 00:31:07 +01:00
Amaury Pouly
cf82f208e3 nwztools: cleanup the code
There was a lot of copy and paste, and the code was just crap. This commit tries
to clarify the code and also document the encryption procedure. Hopefully I didn't
break anything.

Change-Id: I257793010e7cf94f2b090b30bb8608359d3886e3
2016-08-30 17:21:05 +10:00
Amaury Pouly
de8950d63d upgtools: add NWZ-E45x Series key and signature
Also fix a typo in the script makefile

Change-Id: Ie747d8b99ca0f6a98bbcaf1c82e66c7788f00e6e
2016-08-30 17:21:05 +10:00
Amaury Pouly
71a369b37a upgtools: small cleanups
KAS was in its own structure for historical reasons, but it's stupid now.

Change-Id: Ie8d69ac6d489337cd857ace1abe5b1e4b1177172
2016-08-30 17:21:05 +10:00
Amaury Pouly
9d121cfd51 nwztools: upgrade upgtools and add dumping script
Change-Id: I315d1010ce5477c0112f4a890156b360e8123e11
2016-08-17 21:26:31 +01:00
Amaury Pouly
e62203aac1 regtools: add headergen_v2
This new header generator works differently from the previous one:
- it uses the new format
- the generated macro follow a different style (see below)
- the generated macro are highly documented!
- it supports SCT-style platform or RMW-style ones

Compared to the old style, the new one generate a big set of macros per
register/field/enum (loosely related to iohw.h from Embedded C spec). The user
then calls generic (names are customizable) macros to perform operations:

reg_read(REG_A)
reg_read(REG_B(3))
reg_read_field(REG_A, FIELD_X)
reg_read_field(REG_B(3), COOL_FIELD)
reg_write(REG_A, 0x42)
reg_write_field(REG_A, FIELD_X(1), FIELD_Y(3), IRQ_V(FIQ))
reg_write_fielc(REG_B(3), COOL_FIELD_V(I_AM_COOL), BLA(42))

the following use RMW or SET/CLR variants, depending on target:
reg_set_field(REG_A, FLAG_U, FLAG_V)
reg_clr_field(REG_A, FIELD_X, FIELD_Y, IRQ)
reg_clr_field(REG_B(3), COOL_FIELD, BLA)

the following does clear followed by set, on SET/CLR targets:
reg_cs(REG_A, 0xff, 0x42)
reg_cs(REG_B(3), 0xaa, 0x55)
reg_cs_field(REG_A, FIELD_X(1), FIELD_Y(3), IRQ_V(FIQ))
reg_cs_field(REG_B(3), COOL_FIELD_V(I_AM_COOL))

The generator code is pretty long but has lots of documentation and lots of
macro names can be customized.

Change-Id: I5d6c5ec2406e58b5da11a5240c3a409a5bb5239a
2016-05-25 00:11:07 +01:00
Amaury Pouly
c90d42dcc6 jz4670_tools: add usbboot tool, tweak Makefile and packtool
Although the jz4740 contains a similar tool to usbboot, its command-line
interface is not very useful, also it does not compile by default because it
relies on some external code, and it contains code specific to some JZ4740
devices.

Change-Id: I22688238d147e21fb0fd524466b333b6003d4ff1
2016-04-08 18:54:46 +01:00
Amaury Pouly
4934bd6f24 hwstub: remove the old library
Change-Id: I94d0f67cfd0d636407cd9cf3afbe0db4064de28e
2016-04-08 18:52:36 +01:00
Amaury Pouly
5ac0166388 qeditor: port to the new hwstub library and add features
This commit adds support for the version of the hwstub library, which requires
a lot of changes. It also adds some editing features, such as register access
and much better editing of fields using the mouse (double click on a field
to be able to resize and move it).

Change-Id: I3c4e4cc855cb44911c72bc8127bad841b68efe52
2016-04-08 18:46:46 +01:00
Amaury Pouly
cc4c9b70bc regtools: add register access to soc desc
Registers (and variants) can now specify the type of access supported:
- unspecified: for variant means same as register, for register defaults R/W
- read/write
- read only
- write only
Backward compatibility is preserved by setting access to unspecified by default.

Change-Id: I3e84ae18f962a45db62f996a542d08405d05b895
2016-04-08 19:38:36 +02:00
Amaury Pouly
f6c61eb11a hwstub: port hwstub_shell to the new library
Also use this opportunity to cleanup support for multiple devices: the shell
now supports dynamic changes in the device and will call init() everytime
a new device is selected, to prepare a new environment. The shell now
honors register width on register read/write. The shell also provides access
to variants as follows by creating a subtable under the register using the
variant type in UPPER case and having the same layout as a register.
For example if register HW.GPIO.DIR has variants "set" and "clr", those can
be used like this:
HW.GPIO.DIR.SET.write(0xff)
HW.GPIO.DIR.CLR.write(0xff00)

Change-Id: I943947fa98bce875de0cba4338e8b7196a4c1165
2016-04-08 19:38:18 +02:00
Amaury Pouly
a2f4c5201d hwstub: port hwstub_load to the new library
Change-Id: I7e8ae50907401a9480a0da809a4470f1728d3a57
2016-04-08 19:37:59 +02:00
Amaury Pouly
3d8a08ca25 hwstub: rewrite and expand library
Rewrite the hwstub library in C++, with a clean and modular design.
The library was designed from the ground up to be aware of multithreading
issues and to handle memory allocation nicely with shared pointers.

Compared to the original library, it brings the following major features:
- support for JZ boot devices, it is very easy to add support for others
- support for network transparent operations (through sockets): both tcp
  and unix domains are support

Change-Id: I75899cb9c7aa938c17ede2bb3f468e7a55d625b4
2016-04-08 19:37:30 +02:00
Amaury Pouly
56dc54d38a soc_desc: add default constructors to most structures
After being caught by several bugs of the type "let's forgot to initialize
a field to default value", I'm finally fixing this.

Change-Id: I01c33e0611d4f697f767db66465e4fb30858cdab
2016-04-08 18:06:27 +02:00
Marcin Bukat
bb48fa02d2 regtools: Convert rk27xx register description file to v2 format
Change-Id: I60a764567d2fc73ed87fca2a8b0eaf643d4984bc
2016-03-14 13:51:33 +01:00
Marcin Bukat
906a623698 hwstub: fix warning: no newline at end of file with newer gcc
Change-Id: Icb4233fb9b2b0d5b6f8c4a35dff300f38c8d3025
2016-03-14 12:21:42 +01:00
Marcin Bukat
0e2b4908d0 hwstub: rework usb driver for atj213x
Change-Id: I7b175103e567ae4375ff94e74ed1a06215f640c3
2016-03-14 12:21:42 +01:00
Amaury Pouly
7619031307 regtools: make description file parser stricter
The parser would simply ignore unknown elements or attributes, which is bad
on many levels. Now any unknown tag will trigger a fatal error.

Change-Id: I32eead8e96c1567241cf2a565d9e20e62877c14d
2016-02-07 15:46:06 +00:00
Amaury Pouly
7d87ebb470 regtools/desc: convert v1 stmp description files to v2
Conversion done using swiss_knife as follows:
./swiss_knife convert --author "Amaury Pouly" --version "2.4.0" desc/regs-stmp3XXX-v1.xml desc/regs-stmp3XXX.xml

Change-Id: Iad26e04f8f599cf25339a33aa65f231379434e98
2016-02-06 15:32:53 +00:00
Amaury Pouly
6e54f72590 regtools/desc: rename v1 stmp files
Change-Id: Ib66a404acf1f640e19b30b35d6a976094ae4264a
2016-02-06 15:29:38 +00:00
Amaury Pouly
6b9610fb90 regtoosl/qeditor: port to the new description format
This big commit port qeditor from v1 to v2 register file format. Although
the display code was much simplified, the edit code had to be rewritten.
The new code also brings many improvement to the register display widget.

The new code also compiles with both Qt4 and Qt5, although it is recommended
to use Qt5 to get some improvements, especially in the layout of editor.

Change-Id: I24633ac37a144f25d9e705b565654269ec9cfbd3
2016-02-06 15:20:48 +00:00
Amaury Pouly
0f701a64be regtools: update v2 specification, library and tools
A v2 register description file can now include register variants and instances
addresses can now be a list (previously it could only be a stride or a formula).
Update the library to deal with that. The convert option of swiss_knife was
updated and one incompatible change was introduce: if a v1 device has several
addresses, those are converted to a single v2 instance with list (instead of
several single instances). This should have been the behaviour from the start.
Swiss_knife can now also convert regdumps, in which case it needs to be given
both the dump and register description file. Also introduce two register
descriptions files (vsoc1000 and vsoc2000) which give more complicated examples
of v2 register description files.

Change-Id: Id9415b8363269ffaf9216abfc6dd1bd1adbfcf8d
2016-02-06 15:12:55 +00:00
Cástor Muñoz
2ae94318c6 update deploy.py to recognize and use Qt5
Change-Id: Ied8c9d153a34bd8b689a34e45708262cede5348d
2016-01-17 18:38:28 +01:00
Marcin Bukat
ad5e5c42fb hwstub: fix atj213x dsp lua code
Change-Id: I5fbd1799b958bedbe74f91bdcdd8a544e15d2a78
2015-11-17 22:40:31 +01:00
Marcin Bukat
f47f04b65f hwstub: Add ajt213x lua interface for DSP block
With this you can upload and run code on DSP core in atj213x.

The files can be produced using as2181. You can download
this assembler from https://github.com/wodz/as2181
You should use extended mode (-x switch) since DSP core
in atj is non standard and uses 24bit operands.
PX register has different meaning as well and is used as MSB
when loading other registers with immediates (immediate field
is 16bit in instruction so to set register to 24bit value
you need to store MSB in PX prior to this).

MAC MR is 56bit accordingly.

HIP interface seems to be mapped at standard addresses
(except that regular 218x doesn't have HIP).

Have a fun!

Change-Id: I9a80ca0dd3718ba8435ae8579bfffa66e067e022
2015-11-17 13:35:09 +01:00
Amaury Pouly
3fdb86ea41 qeditor: fix uninitialised variable
Change-Id: I12a785e554b7d598b91e526af1b7ebc1fc44f610
2015-10-03 23:09:35 +02:00
Amaury Pouly
bc25437448 hwstub: make it possible to override toolchain
Default toolchain can be overriden using PREFIX, for example:
PREFIX=arm-none-eabi- make

Change-Id: I06f5ad0ad492b9f648ccba853a851918644f0500
2015-09-29 22:49:02 +02:00
Amaury Pouly
1cada1f833 soc_desc: new version of the desc file format
Fix qeditor to use the old soc_desc_v1.
Port hwstub_shell to the new description format.

Change-Id: I9fefbff534bfaa5c3603bb3dd8307a2b76e88cfc
2015-09-11 16:40:19 +02:00
Amaury Pouly
c8d3638b9e qeditor: introduce new "sexy register display"
Change-Id: Ib938b4be71d2c7623851dbc3c211f96105077d7d
2015-09-11 16:02:34 +02:00
Amaury Pouly
2c832968c9 qeditor: use delegate to show bit range information
Change-Id: I314365c3a2cb9d230c412f24d2a8034a12c43444
2015-09-10 15:20:38 +02:00
Cástor Muñoz
ab3581c7ef utils/parse_testcodec.rb: add support for Opus files
Change-Id: I19e59cfe86598c2e5a7b070ef72b5a12e88b7242
2015-07-17 00:51:22 +02:00
Marcin Bukat
e70ea5d21f hwstub: Add completion and some pretty printing to the shell
This uses slightly hacked luaprompt to provide all the goodis.
See https://github.com/dpapavas/luaprompt for original.

Change-Id: Iedddb79abae5809299322bc215722dd928c35cca
2015-06-28 17:55:17 +02:00
Dominik Riebeling
8360937ac2 Append build date when building dev version from local foler.
Change-Id: I1172cb0c4910f1d49b6a5d1125a809491a5aba9c
2015-06-07 22:19:54 +02:00
Dominik Riebeling
e5320303cc Make revision handling work when building from local folder.
Change-Id: I8e6cc0eb8a5bff722bf5278ffa7685436c3d846a
2015-05-30 18:40:40 +02:00
Dominik Riebeling
5f5d7f608a Fix path creation for zip file names in current folder.
When building in the current tree (i.e. buildfolder ending up as '.') creating
the filename to use in the zip file stripped all '.' characters. Use a
different way to create the filename to avoid this.

Change-Id: I139c404d5e83a8bcb028a9a22b125f238911e405
2015-05-30 18:21:32 +02:00
Dominik Riebeling
2af2a1253c Update findversion for change version.h format.
version.h doesn't store the version number as string anymore. Update
findversion to use the individual values instead.

Change-Id: I6bf0fdd4420d41279b44cffd22b42febbfc778ce
2015-05-30 17:59:50 +02:00
Amaury Pouly
b130b50734 Add jz4760 tool
This tool can pack/unpack a jz4760 archive (like the one used for the fiio
x1/x3/x5), and can descramble/scramble (it's the same operation) a firmware
file (the sys.bin file in the archive). I did my best to keep the compatibility
with the leaked Fiio/Ingenic tool which has the same name.

I wrote the tools from scratch, but here are some remarks:
- the format used is a slightly modified IHFS used in the older JZ4640 series,
  I used the information on the wiki about the IHFS format
- the CRC computation done was already reversed engineered by someone on the
  forums but I realised this later
- There are a few unknown fields in the headers, see comments in the source code
- The firmware scrambling was discovered by pure guess, I realised there were
  some repetitve sequences, some I guessed it was a rotative XOR and ran some
  analysis to find the most probable sequence

Change-Id: Ib83735b3db8475be5de9c94231714e88668a0340
2015-03-29 14:08:28 +02:00
Marcin Bukat
0d9124fc79 qeditor: Add external static libraries to build dependecies
The solution is a bit hacky as it simply call make in libs
directory as pre-dependency. Clean doesn't touch libs.

Change-Id: Ib447a48fd87cc41228944f17444474a55d393543
2015-03-04 22:46:03 +01:00
Amaury Pouly
f5f9784ab7 Introduce a new analysis tool to detect which macros are defined in each build.
See the usage() for more information.

Change-Id: I712ef4d6bd21eccefa18cec144e35b8161ca5b3a
2015-02-16 11:31:05 +01:00
Marcin Bukat
f65baf9b0f atj213x: Fix DMAC block in description file
Change-Id: I4afc17b06f85d552248c0248e6b4b921ffc1e7a7
2015-01-23 11:03:49 +01:00
Marcin Bukat
15d4be5e9f atj213x: fix desc file errors
Catched by swiss_knife check there are some overlaping fields
and invalid characters in some names.

Change-Id: Ia26ffd2e29452f4ddd9f8229f78bb2a2cc325ab4
2015-01-22 13:38:13 +01:00
Amaury Pouly
2cdfc43f10 hwstub: implement read/write data abort recovery
Change-Id: I1625873b6864584c40984723d82548ad242ee08e
2015-01-13 23:35:33 +01:00
Thomas Jarosch
2ee2a9697a Fix crash on uninitialized variable
The WRITE() macro checks if the "fw" pointer
is open upon fwrite() error. Since fw was
not initialized before use, it might crash for non-zero fw.

cppcheck reported.
[utils/jz4740_tools/HXFreplace.c:187]: (error) Uninitialized variable: fw

Change-Id: I558170f9f17828c9fd515a5da36ad8b5cb30a9ad
2015-01-13 21:57:24 +01:00
Thomas Jarosch
a71603b4d1 Clean up bogus 'make compiler happy' code
Less code makes the compiler even happier.

Change-Id: I24cf586ba44f432b541fd17079f93dbd52314828
2015-01-12 21:13:00 +01:00
Marcin Bukat
bbd7d1dba3 regtools/headergen: Make generator more flexible
Change-Id: I2328ec021ed990a40257d4ce6f4fc5b3db2ba998
2015-01-12 11:28:52 +01:00
Thomas Jarosch
c907e127f8 jz4740 usbtool: Fix undefined behavior in set_reg()
The variable 'i' should actually be 'size'.
See the read_reg() function above it.

Confirmed via private email from Maurus Cuelenaere. Thanks!
(who also remembered having trouble reading/setting
 registers over USB back then ;))

cppcheck reported:
[rockbox/utils/jz4740_tools/jz4740_usbtool.c:281]: (error) Uninitialized variable: i

Change-Id: I0f34834335e89d2504e7597e8db22cf69b5ca7e7
2015-01-04 18:16:44 +01:00
Thomas Jarosch
89ab3c2761 Fix uninitialized variable (should fix libusb retry handling)
Reported by cppcheck

Change-Id: I5ac7b73f2e3eaee3d5427d118944613e572f684d
2015-01-04 13:35:47 +01:00
Thomas Jarosch
8f1fbd1dc8 Remove unneeded std::string .c_str() call
cppcheck reported:
[utils/zenutils/source/update_patch/main.cpp:105]: (performance) Passing the result of c_str() to a function that takes std::string as argument no. 1 is slow and redundant.

Change-Id: Ied9de135e693af22e1fdc3aa3b67d14b7d2c21e6
2015-01-04 12:33:09 +01:00
Thomas Jarosch
29ffa832fe Remove useless assignment of 'len'
The variable 'len' is not used after this statement.
Probably a copy'n'paste leftover from the similar
looking block above.

cppcheck reported:
[rockbox/utils/zenutils/source/shared/cenc.cpp:212]: (style) Same expression on both sides of '-'.

Change-Id: Ia8357187ed39d3fab10d97df75a1146c4f733790
2014-12-20 15:52:35 +01:00
Amaury Pouly
515a07e51d sb1: fix buggy comparison
cppcheck reported:
[rockbox/utils/imxtools/sbtools/sb1.c:440]: (warning) Comparison of a boolean expression with an integer other than 0 or 1.

Thanks to Thomas Jarosch

Change-Id: I0078232706d4014a1f2acea310a7a0d0edf7788b
2014-12-20 15:31:18 +01:00
Amaury Pouly
5dab768838 regtools/qeditor: use the new model, drop unused code
Change-Id: Ic4e2e201f6d055c85d52b7fe15d25980386df5b8
Reviewed-on: http://gerrit.rockbox.org/1023
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:57:20 +01:00
Amaury Pouly
abed208efb regtools/qeditor: introduce custom table model for reg fields
This one is much more efficient than using a generic table widget.

Change-Id: I3578964eead746e656f6b0a8dcec0f8442deb13d
Reviewed-on: http://gerrit.rockbox.org/1022
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:54:28 +01:00
Amaury Pouly
edaeee168d regtoosl/qeditor: remove unused code
Change-Id: I79ad3151d6a500903786b3467c271b43741f8fee
Reviewed-on: http://gerrit.rockbox.org/1021
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:54:20 +01:00
Amaury Pouly
88053b8832 regtools/qeditor: fix field editor not updating the validator on change
Change-Id: Ib8df47c8b7cfe0beb486e45542e3fcc9187bcc54
Reviewed-on: http://gerrit.rockbox.org/1020
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:54:13 +01:00
Amaury Pouly
04e798eddf regtools/qeditor: fix backend dump bug, be more correct on read
Change-Id: I581c033435f553f092b61144c4b68b05ab931dd8
Reviewed-on: http://gerrit.rockbox.org/1019
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:54:05 +01:00
Amaury Pouly
6cb861137d regtools/socdesc: update library with a field useful functions
Change-Id: Ib2891fe36b0594e8554bb354a29bc8b3485de20d
Reviewed-on: http://gerrit.rockbox.org/1018
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:53:57 +01:00
Amaury Pouly
7749c4d0e9 qeditor: message widget now supports IDs, useful to clear messages
Change-Id: Ibe0a8909128469a71a25415761860e06fc9f1e67
Reviewed-on: http://gerrit.rockbox.org/1006
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:53:49 +01:00
Amaury Pouly
cef5e1018e qeditor: change setting names, they were inconsistent
Change-Id: I47c94520749d0cef1e602c7c62c685a8a3703258
Reviewed-on: http://gerrit.rockbox.org/1000
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:53:41 +01:00
Amaury Pouly
dc3ae2aeb9 qeditor: rework register dump to be more general and flexible
Change-Id: I2fb7a2813c93f0804ed1ca6223625706d0dff9a5
Reviewed-on: http://gerrit.rockbox.org/998
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:53:33 +01:00
Amaury Pouly
1bcc4fc67b qeditor: introduce a new "RAM" backend, and refactor file backend
Change-Id: Icfbbc01b83d3592041803387e35f5aa6fb0fa813
Reviewed-on: http://gerrit.rockbox.org/997
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:53:15 +01:00
Amaury Pouly
4a711fee42 qeditor: display message on "Nothing" backend selection
Change-Id: I071c79500f55afe0b6342cbb5a26a9fddba35d94
Reviewed-on: http://gerrit.rockbox.org/996
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:53:03 +01:00
Amaury Pouly
99ed6d2bea qeditor: backends can now report validity status
Change-Id: Iefedc9cee10a8c7457d972e5a60d151a6cb38aa8
Reviewed-on: http://gerrit.rockbox.org/995
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:52:54 +01:00
Amaury Pouly
b08620dd30 qeditor: introduce a message widget to display non-interactive messages
Change-Id: Iad43efa1f09428389fbd09403c1ae20d2805f1c5
Reviewed-on: http://gerrit.rockbox.org/987
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:52:45 +01:00
Amaury Pouly
3b4e63173d qeditor: rework mainwindow tab names handling
With the previous code, tab names would be ignored if tab is detached
which can happen early on.

Change-Id: I9eac4202850f3e79a04590a4ba1444850ec6a583
Reviewed-on: http://gerrit.rockbox.org/986
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:52:35 +01:00
Amaury Pouly
fe1fed8873 qeditor: add copyright
Change-Id: I7834bc09b21f2a2d84b1c9edbbe1188372809c63
Reviewed-on: http://gerrit.rockbox.org/983
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:52:26 +01:00
Amaury Pouly
94c4834bbb Revert "regtools/qeditor: use the new model, drop unused code"
This reverts commit 3b3d9bf725.
Gerrit did crap on this one.
2014-12-15 22:44:17 +01:00
Amaury Pouly
3b3d9bf725 regtools/qeditor: use the new model, drop unused code
Change-Id: Ic4e2e201f6d055c85d52b7fe15d25980386df5b8
Reviewed-on: http://gerrit.rockbox.org/1023
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-12-15 22:42:43 +01:00
Amaury Pouly
0389fd0982 MTP: put libs after files in the Makefile, to please old gcc versions
Change-Id: I6de6771bd8888e40fb9dafa3c84653c8c680bbef
2014-12-13 12:58:08 +01:00
Marcin Bukat
0cd9e4e6bc hwstub/atj213x: add clock setup to crt0.S
Change-Id: I3b6e1b8ee1fa76396f7abe7df69af26e9599cfe9
Reviewed-on: http://gerrit.rockbox.org/1055
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Tested: Marcin Bukat <marcin.bukat@gmail.com>
2014-11-28 19:39:38 +01:00
Marcin Bukat
5e1381be87 qeditor: add clock analyser for ATJ213x
Change-Id: I5f5a3537d1ddf6b02684dd4c1dd13be862d3a918
Reviewed-on: http://gerrit.rockbox.org/1054
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2014-11-28 19:39:15 +01:00
Marcin Bukat
e99c036ed1 hwstub_shell: add support for call and jump
Change-Id: Ie09d0db21831b79255da858bada7382a08ff4eef
Reviewed-on: http://gerrit.rockbox.org/1052
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Tested: Marcin Bukat <marcin.bukat@gmail.com>
2014-11-28 19:38:02 +01:00
Marcin Bukat
9439635aa2 hwstub: lua functions for atj213x/irivere150
Change-Id: I3ab32996b4b6603fd7d66eee5b3bfd795b79eee1
Reviewed-on: http://gerrit.rockbox.org/1049
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Tested: Marcin Bukat <marcin.bukat@gmail.com>
2014-11-28 19:37:14 +01:00
Marcin Bukat
19f4e396fd regs-atj213x.xml upadte
Change-Id: Ia34dcf651e68ea66baebdeb8c056db86799ea33c
2014-11-18 23:30:44 +01:00
Marcin Bukat
cd04a5f1aa hwstub/qeditor: add support for atomic read/writes
The current code assumed that READ/WRITE would produce atomic read/writes for
8/16/32-bit words, which in turned put assumption on the memcpy function.
Since some memcpy implementation do not always guarantee such strong assumption,
introduce two new operation READ/WRITE_ATOMIC which provide the necessary
tools to do correct read and write to register in a single memory access.

Change-Id: I37451bd5057bb0dcaf5a800d8aef8791c792a090
2014-11-18 23:30:44 +01:00
Amaury Pouly
229a02a4ee adfuload: fix argument parsing
Change-Id: Ibde77a2f7cb7a73c26235be5b2afed9f0aec3e97
Reviewed-on: http://gerrit.rockbox.org/1039
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-11-15 13:01:47 +01:00
Amaury Pouly
16dcde4012 hwstub_shell: add atj target
Change-Id: I566694f19dfb110dbf245be7b7f139a4c616e16b
Reviewed-on: http://gerrit.rockbox.org/1041
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-11-15 13:01:24 +01:00
Marcin Bukat
bb5341c4be regtools: ATJ213x description file
Change-Id: I5b4d29e0808c57e252f5b6c3b9ba26a52c1bd112
2014-11-06 10:31:11 +01:00
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