Commit graph

115 commits

Author SHA1 Message Date
Aidan MacDonald
b8945734f5 Make headergen_v2's output include what it uses
Change-Id: Ie9790faac44c33a170bc2dc39d706575cefa0f2f
2021-02-27 22:02:31 +00:00
Amaury Pouly
235cdeca73 qeditor: add better fallback mecanism for icons
Change-Id: Ib87406c95fc6c579f108b81246350d12de428ba4
2020-11-04 13:14:42 +00:00
Amaury Pouly
e6de6c107e qeditor: add workaround for c++11 in qt4, suggest to use qt5
Change-Id: Iad7b8fd171d57228796a68cb3406914213b91926
2017-09-06 20:45:34 +02:00
Amaury Pouly
2ea0ccb6c5 regtools/qeditor: replace deprecated QStyleOptionViewItemV4
...by QStyleOptionViewItem. Yes Qt got it right, in 5.7 they deprecated
QStyleOptionViewItemV4 and recommend using QStyleOptionViewItem which contains
less fields except on newer Qt where it contains all fields. Hopefully it still
works on Qt>4.x for a large enough value of x.

Change-Id: I013c383d2424b04c1c0745f0d7b1d5e62a29d324
2017-02-04 17:19:50 +01:00
Amaury Pouly
2a3a6bb4b3 regtools/qeditor: compute RAM size
Change-Id: I7bfb5cc25bc3dc55f379b2319b20dc9510434de0
2017-02-04 17:19:20 +01:00
Amaury Pouly
fa5324bbbb regtools/qeditor: enable imx233 analysers for imx233
The clock structure is identical, and the EMI are the same.
Also fix SSP clock, it was broken on imx233 as well.

Change-Id: I25ec66059b00b1a456ef2f02131d225082536c0a
2017-02-04 17:18:59 +01:00
Amaury Pouly
fafb770ca5 regtools/soc_desc: fix bug in library
Because a node ref is at root doesn't make it valid, check that soc is valid
otherwise we return garbage.

Change-Id: I6e5befc959dc670ab39a87484e87af6d90be7726
2017-02-04 17:18:37 +01:00
Amaury Pouly
6f0f1193e5 regtools: add new tool list/find/describe registers
Change-Id: I2d93d24bd421e1a2ea6d27b8f7cfd17311e6d458
2017-02-04 17:18:13 +01:00
Amaury Pouly
d91d9f6851 jz4760b/regtools: fix/rename some register fields, add clock analyzer to qeditor
Change-Id: I196414d6e4fc18c00b77903e334b7e6adfb7debc
2017-01-24 15:25:14 +01:00
Amaury Pouly
51cce81cd4 headergen_v2: add two new macros to write a raw write to set/clr variants
These macros are like jz_setf but instead of writing fields, they write a
raw value directly: jz_set(REG, value) and jz_clr(REG, value).

Change-Id: I660f20dd691b26d367533877875fc3226a26c992
2017-01-24 15:25:14 +01:00
Amaury Pouly
d7c71a3fe8 update jz4760b register desc
Change-Id: Id0a071528eca08fe512941be9c8091819e817e4c
2017-01-24 15:17:46 +01:00
Amaury Pouly
0b6cbd8e49 regtools: add JZ4760B description
This is a register description file for the JZ4760B. There are several
details worth noticing:
- it was obtained by gathering information from several sources/headers, but
  since there are inconsistencies between them about the exact differences
  between JZ4760 and JZ4760B, this file probably contains some errors
- the register names are not the same as the manual ones (which are not the
  same as the one in the headers anyway): I dropped the "R" suffix on most
  registers because it's redundant
- Ingenic likes to have read-only registers and then set/clr registers, with
  very confusing names like DIR/DIRS/DIRC: in the file, the set/clr registers
  are described as set/clr variants of the original register
- Parts of the description were obtained programmatically, which explains why
  there are empty nodes or partially undocumented registers

Change-Id: I8da1d61e172e932e1a4a58ac0a5008f02b1751be
2017-01-24 15:17:46 +01:00
Amaury Pouly
6ef3f7c13b regtools: fix normalization procedure
The code was not updated when I added support for list and other stuff, and thus
it did not properly sort by addresses.

Change-Id: Iaed0717b607beedfb2856c020c2a760e7a5667c5
2017-01-24 15:17:46 +01:00
Amaury Pouly
6b227c5ea6 regtools: convert all reg dumps to v2. keep v1 for reference
Change-Id: Ib496eb5d47adb75479ce94a203d4a93524700843
2017-01-16 20:09:18 +01: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
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
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
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
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
Amaury Pouly
3fdb86ea41 qeditor: fix uninitialised variable
Change-Id: I12a785e554b7d598b91e526af1b7ebc1fc44f610
2015-10-03 23:09:35 +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
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
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
Marcin Bukat
bbd7d1dba3 regtools/headergen: Make generator more flexible
Change-Id: I2328ec021ed990a40257d4ce6f4fc5b3db2ba998
2015-01-12 11:28:52 +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