Commit graph

1278 commits

Author SHA1 Message Date
Dominik Riebeling
08afedf1f5 sansapatcher: Add cmake target to build executable.
Change-Id: Idff5674acb5347643c8a26ef64506f892445977e
2022-03-12 20:40:08 +01:00
Aidan MacDonald
cdee5284d4 jztool: support new binary header on x1000
Change-Id: If0d3fb3d5b03cf6ed87cbbb8a968ef48edb660f7
2022-03-11 11:15:56 -05:00
Dominik Riebeling
57cffae369 rbutil: Change MacOS bundle identifer to org.rockbox.
Change-Id: I06d0513a25197a942b222a59d04f44275edb7a5a
2022-03-09 19:02:01 +01:00
Dominik Riebeling
b1965b4197 rbutil: Fix setting bootloader "file" for Ipod bootloader.
On Ipods we use the bootloader "filename" to pass the mountpoint, which
is then used to determine the correct device to use.

Change-Id: I1dd2060ae9176bfdece9337160db08caf326e1f5
2022-03-08 22:42:34 +01:00
Dominik Riebeling
3cebc983a2 rbutil: Fix a crash for devices without bootloader file.
Don't try to get a bootloader filename from an empty list. This happens
if the device doesn't have a bootloader file on disk.

Change-Id: Idd4c265e7ae298913c5feefb3963120867a0e858
2022-03-08 22:32:13 +01:00
Dominik Riebeling
911b216aff rbutil: Properly initialize sansa / ipod bootloader buffer.
Fixes a crash on MacOS.

Change-Id: Ibb64a37266182c4ddfee32b2ac47b9d8f25a78e5
2022-03-08 22:32:13 +01:00
Dominik Riebeling
ae97d410c5 utils: Set cmake build type to default to Release.
Change-Id: Ie4e6aa326840cb1fbae0fe8d025e592e139d4508
2022-02-28 20:37:32 +01:00
Dominik Riebeling
8d462a1edd rbutil: Rework Logo display.
Replace QLabel with QSvgWidget so the widget draws the svg directly
instead of first creating a pixmap from it.

This also avoids an issue when building with mxe which causes the image
to not show due to a missing svg plugin (which doesn't happen for svg
icons.)

Change-Id: Ic4e265f0567984d1ffe7a3e1cc641df27755e90b
2022-02-28 20:37:32 +01:00
Dominik Riebeling
83e4078d9c cmake: Strip Release binaries when building with gcc.
Change-Id: Iaf87d6b65a38b6d0ecb66c5cb8bc7164741d7419
2022-02-28 20:37:32 +01:00
Dominik Riebeling
72904569e3 Remove outdated theme editor deploy script.
This doesn't work anymore since the switch to cmake.

Change-Id: I3a829cc58412f2e1415c6c9defeb552137757214
2022-02-28 20:37:32 +01:00
Dominik Riebeling
fa1e6cc5bf rbutil: Replace deploy with tarball script.
The old deployment script doesn't work anymore due to the change to
cmake, and since we build the distribution packages (zip / dmg /
AppImage) with cmake directly there's not much need left for the old
deployment.

Change-Id: Ide20887c5bc2e22aabbfb47374d70529609fbc3c
2022-02-28 20:37:23 +01:00
Aidan MacDonald
cbb57fe714 rbutil: allow checking bootloader installer capabilities
Instead of checking for certain hardcoded strings, fetch
the actual capability bitmask by instantiating an installer
and querying it.

Change-Id: I7883d9c1e90da37ee7c0189732ac626685adbfa1
2022-01-02 15:50:17 -05:00
Dominik Riebeling
bbd1056afb themeeditor: Fix dmg deploy steps.
- Fix binary name in Info.plist.
- Run dmgbuild as Python module, in some cases it isn't available directly.
- Add missing dmgbuild configuration for themeeditor.

Change-Id: I2db50959b88283f43e2203cf71b130cdb33103dd
2021-12-28 19:53:54 +01:00
Dominik Riebeling
3d983ad3a1 themeeditor: Create MacOS AppBundle / Win32 GUI application.
cmake needs to know about this, otherwise we'll only get an executable.

Change-Id: If40a2a5d021ca49df4afe6bb5bce538d2b466426
2021-12-28 18:34:08 +01:00
Dominik Riebeling
875fcc7daf themeeditor: Fix cmake Qt major version.
Use the correct variable.

Change-Id: I5c59664cb86b0e4d3731e7c9ad13a276a1720cbc
2021-12-28 18:16:28 +01:00
Dominik Riebeling
c055b5e933 rbutil: Add data tags to data driven unit tests.
Make tests implemented as data driven tests show a sensible test data
tag value, so test can get identified more easily.

Change-Id: Ifeb42ed11ce9a8efc6491b2c3b9fe31802a67d33
2021-12-28 17:57:04 +01:00
Dominik Riebeling
0c8f539182 rbutil: Auto-discover tests with cmake.
Change-Id: I2f6511ddc306ba1caecaa917667074cf51b61262
2021-12-28 17:57:04 +01:00
Dominik Riebeling
f37a917e9a cmake: Disable QtTest discovery when cross compiling.
Change-Id: I46e2ad16f592f3adc9f01347e9fcda451c0b3a26
2021-12-28 17:57:04 +01:00
Dominik Riebeling
c1ad915055 cmake: Add QtTest test discovery module.
Allow discivery of the QtTest based unit test.
Taken from https://github.com/ocroquette/cmake-qtest-discovery

Change-Id: I79a54568b2dbc216d35a463b6be36c197203c5b5
2021-12-28 17:57:04 +01:00
Dominik Riebeling
f53f1fbafa rbutil: Fix some more issues found by clazy.
Change-Id: I0a1a849ecea4b4666b08ccb050eb17918e90a258
2021-12-28 17:57:04 +01:00
Dominik Riebeling
b774699560 themeeditor: Remove qmake project files.
It is now part of building with cmake.

Change-Id: I6e6317f3070311c7921f93a3ec44eefdd4f55baf
2021-12-28 10:37:50 +01:00
Dominik Riebeling
3e2a7a56c0 rbutil: Remove qmake project files.
To build it configure with cmake from utils/ folder.

Change-Id: I43fab2df1768e1a055e46ec5712e3a45fefef5a9
2021-12-28 10:35:39 +01:00
Dominik Riebeling
1ddc5a202d themeeditor: Convert to cmake.
Change-Id: Ib46842c157121c64cd0091118aa9b7e43d83b8b3
2021-12-27 16:18:17 +01:00
Dominik Riebeling
36cb0d4050 themeeditor: Add svg application icon and desktop file.
Change-Id: I3213e60679330b5312bddd37669da2b18e7f9627
2021-12-27 16:17:30 +01:00
Dominik Riebeling
2ecbc18535 rbutil: cmake: Make linuxdeploy download a global target.
That way we won't get duplicated targets when the deploy function is
used for multiple targets.

Change-Id: Ie14fdd74fcc496647c3c041ae2fcf902a3cb15fa
2021-12-27 16:14:46 +01:00
Dominik Riebeling
67942629cf rbutil: Explicitly enable AppImage qt deploy plugin.
Change-Id: Id2cb21882b06f60541ecfe22b101d13c4f631131
2021-12-27 12:29:52 +01:00
Dominik Riebeling
88a50ab104 rbutil: Change MacOS dmgbuild to use plistlib.
We're not dealing with binary plist files, to biplist is not the one we
want. Also, plistlib is part of Python.

Change-Id: I529516da0d6b04809a7c0d38b20c6f40900560f8
2021-12-26 21:59:19 +01:00
Dominik Riebeling
5999b4f791 rbutil: Fix cmake deploy function paths.
Update scripts paths with the split-up setup.

Change-Id: I62cd66b7440faa27daead92d04f3cdae67748d60
2021-12-26 21:31:49 +01:00
Dominik Riebeling
241d478ce9 rbutil: Replace QRegExp with QRegularExpression.
More updating for Qt6 compatibility.

Change-Id: I2f5bb943acc1f6bdd7bdab0e90e3c0ede596f43a
2021-12-26 20:13:05 +01:00
Dominik Riebeling
1ad4faa334 rbutil: Modernize connect() calls.
Auto fixed by clazy.

Change-Id: Iea16d892fd81c151f0081f7476acc5eda62afc25
2021-12-26 19:50:19 +01:00
Dominik Riebeling
9f3d6e47e7 rbutil: Remove generated header from giversion interface target.
cmake on Windows doesn't like this, and it's not necessary.

Change-Id: I65b9eb989e51df388cabcb36a246068dba80630c
2021-12-26 11:14:22 +01:00
Dominik Riebeling
80c0268c7a rbutil: Make test compile with Qt6.
Change-Id: I2e6520588c7a82482b2c605d0b295f8fc7e0a03b
2021-12-26 11:06:57 +01:00
Dominik Riebeling
35bc4590ae rbutil: Remove ProgressLogger interface class.
Since we're using signals to connect to the Logger we don't need an
interface class, and the only thing still used was the log level enum.
Put those values in a dedicated header instead.

Change-Id: Ic3aee14ba13b81e283b477d11b1c15a5c26ffeab
2021-12-26 11:05:25 +01:00
Dominik Riebeling
01e245417e rbutil: Fix various issues found by clazy.
Change-Id: I91ca2baed34f0f3b561602f95f66bbd4e17e74ab
2021-12-25 19:59:57 +01:00
Dominik Riebeling
0768705545 rbutil: Fix invalid access on error in test.
Change-Id: Ie9c65041bb4a1ba4215a2d0786bf984cfa6d023b
2021-12-25 17:47:14 +01:00
Dominik Riebeling
c753d31549 rbutil: Remove unused variable from test.
Change-Id: Iea57ffa319f50df8836c0c7c608ff37a394eb68d
2021-12-25 17:47:14 +01:00
Dominik Riebeling
6ff75b475c rbutil: Modernize connect() calls.
Auto fixed by clazy.

Change-Id: Ib7cce8c0a85f8f915263980bf5d2508a4b19bbe3
2021-12-25 17:47:14 +01:00
Dominik Riebeling
dce2ccdd96 rbutil: Remove unused mspack source to fix warning.
We don't need this file, and the implementations are stubs, causing a
compile warning. Remove it from the build.

Change-Id: I4ee2594c8fbc3ecf4661cc4144f8d9072bd6d983
2021-12-25 17:47:14 +01:00
Dominik Riebeling
afe0e18113 mkamsboot: Fix a warning.
Change-Id: Ie16176226bf23a19e51abd6e9ae94244701872db
2021-12-25 17:47:14 +01:00
Dominik Riebeling
eb8dc75d38 rbutil: Create git version information at build time.
Change-Id: Iaf701f4d64d6852423f6a28a753b27abc43477e2
2021-12-25 17:47:14 +01:00
Dominik Riebeling
e9ef7f0dd3 rbutil: Split out rbutilqt parts into separate cmake list.
Change-Id: I84ada20765b98620e1f06bc7116bbdaaae296fe9
2021-12-25 17:47:14 +01:00
Dominik Riebeling
c979717b80 rbutil: Fix logger segfault on application exit.
Getting the values from a QMultiMap() returns a list, but not the same
on consecutive calls. Thus calling it twice to get the iterators will
yield different lists, causing the iterator to fail.

Fixes a segfault when destructing the logger.

Change-Id: Ie8ea8d3a9acf6fbd3969fbb49cbc50a1c1fa2854
2021-12-25 17:47:14 +01:00
Dominik Riebeling
774b35cccf rbutil: Deploy support in cmake.
Add a "deploy" target that will create a distributable file.

- Linux: AppImage.
- Windows: zip file.
- MacOS: dmg.

Change-Id: Id8ae9c021bc5bbb1abf066205b57d943c3f3b327
2021-12-25 17:47:14 +01:00
Dominik Riebeling
4eb3f05042 rbutil: Increase test timeout value for HttpGet tests.
The test timeout is used to abort the tests if something goes wrong and
should not occur during normal test run. On some systems the current
value is too small, causing a timeout and thus test failure before
HttpGet responds.  Increasing the timeout fixes this.

Change-Id: Ib61dd97d9f866c03cca9d2f0d7cb151f7076410d
2021-12-25 17:47:14 +01:00
Dominik Riebeling
f2798c225a rbutil: Simplify reading rockbox-info.txt.
Simplify, and replace use of QRegExp with QRegularExpression for Qt6
compatibility.

Also fix the test running on Windows. RockboxInfo constructs the
filename from path and filename, so we cannot pass an empty path, since
that results in an invalid path. On Linux / MacOS this works only
because we use an absolute path.

Change-Id: Ieaf30a2df005291d3e997aabf42d64ee832381c2
2021-12-25 17:47:14 +01:00
Dominik Riebeling
dc677208d0 rbutil: Fix unit tests on Windows.
Change-Id: I124882eb26b01e1acfadfba55bc718ab330ab52a
2021-12-25 17:47:14 +01:00
Dominik Riebeling
3d6d186d2e rbutil: Initial cmake support.
Rewrite in cmake, and include all necessary libs. This removes calling
separate Makefiles which is rather error-prone on non-Linux systems.

Change-Id: Ic2af4a3810e4b000e3ad33304229e2349a930e16
2021-12-25 17:47:14 +01:00
Dominik Riebeling
f3a54a7c22 rbutil: Put translation qrc next to translations.
That way we don't need to put paths in the file, and will help with
cmake support later.

Change-Id: I0835674e0ea2e5ec5a1596798e26cfbfde29468d
2021-12-24 18:05:53 +01:00
Dominik Riebeling
2fdc056fee rbutil: Use https URLs in Changelog links.
Change-Id: I9a40163c9025550185104dc00356932bda16f782
2021-12-24 18:05:53 +01:00
Dominik Riebeling
9e28474e47 rbutil: Replace QRegExp with QRegularExpression.
The former is not part of Qt6 anymore, while the latter has been
introduced with Qt5. We don't support Qt4 anymore, so move to
QRegularExpression.

Change-Id: Icc15ef422790f3740660c5581294aa0536f46b1f
2021-12-24 18:05:53 +01:00
Dominik Riebeling
72071d108c rbutil: Remove unnecessary include from logger.
Change-Id: I860331880a45912ad73f02f049f869dd155eeb2d
2021-12-24 18:05:53 +01:00
Dominik Riebeling
c876d3bbef rbutil: Merge rbutil with utils folder.
rbutil uses several components from the utils folder, and can be
considered part of utils too. Having it in a separate folder is an
arbitrary split that doesn't help anymore these days, so merge them.

This also allows other utils to easily use libtools.make without the
need to navigate to a different folder.

Change-Id: I3fc2f4de19e3e776553efb5dea5f779dfec0dc21
2021-12-24 18:05:53 +01:00
Aidan MacDonald
7a5130a277 x1000: fix broken OST2 timer prescaler
It turns out the prescaler fields in OST_CTRL are 2 bits wide,
not 3. The programming manual (as usual) is ambiguous and its
diagram shows 2-bit wide fields, but the bit positions in the
text give a 3-bit wide field. Ingenic's Linux code and my own
testing shows that they are, in fact, 2 bits wide.

This caused the OST2 divisor to be 16 instead of 4; the OST1
divisor was correct. This means that all udelay/mdelay calls
took 4x longer than they should've. After this change the OST2
prescaler will be 4, as intended, and udelay/mdelay calls will
wait for the intended duration.

Change-Id: I2ac0a9190f49b59a840c649bf586131f5f9fde82
2021-10-16 16:58:19 -04:00
Solomon Peachy
04fe77a465 Remove the (very) incomplete port for the Tatung TPJ-1102
It was barely even a stub, and hasn't seen any development since 2009

Change-Id: I0aa15d9a7b90ae8c771924d9f401380d4cc0fab9
2021-08-14 16:29:39 -04:00
Aidan MacDonald
65aa9ce570 x1000: more CPM register definitions
Change-Id: Ie6fa343a65a6bd19e578664b10bac771289ed0b3
2021-07-08 16:01:38 +00:00
James Buren
3831051c47 mknkboot: optimize verifyfirm
The checksum only needs to be calculated once. A small oversight on
my initial implementation.

Change-Id: Ie23faf36f5add7ed7f146769b604dbd8204c2605
2021-06-17 15:30:51 +00:00
Aidan MacDonald
89f4064743 x1000: Extend CPM registers for dual boot
Change-Id: I283834a653506fd95ff8b56897e5f3afaf375cf5
2021-06-14 20:45:14 +01:00
James Buren
a90ef8195b mknkboot/beastpatcher: implement basic firmware validation
This imports the MD5 code used by other utilities and creates
a function for checking the provided NK.bin against known original
firmware checksums. Integration into mknkboot and beastpatcher is
also added.

For the sake of consistency with beastpatcher, mknkboot had its
printf statements rewrote to print to stderr like beastpatcher
does.

Change-Id: I0e52271d8d627a5b02302ab5cd1da2815b7cec1e
2021-06-12 06:32:08 +00:00
James Buren
fe9bcd0468 beastpatcher: fix some minor issues
This mainly fixes some compiler warnings and makes it
work with mingw64.

Change-Id: Iabd13b5bed3427869ae78ceeb7e2255e68a6f7bd
2021-06-11 19:32:55 +00:00
James Buren
ab0f23c4b1 sendfirm: fix some minor issues
This patches some compile warnings and also makes it work correctly
with modern mingw64.

Change-Id: I8cd292bc989ae04bbaa1d7149d58d6d833a51c0a
2021-06-11 19:32:35 +00:00
Aidan MacDonald
2066465b78 FiiO M3K: minor fixes
- Drop obsolete NAND patch script (it's simpler to use 'dd' directly)
- Remove an outdated comment
- Fix missing 'void' in a function definition
- Reset the poweroff timer when we poke the backlight

Change-Id: I752624386f30ac95f41a731d2b6be837e12275a9
2021-06-01 00:26:20 +01:00
Aidan MacDonald
f63edb52ef x1000: refactor AIC initialization
Have pcm-x1000 handle most work, so target's audiohw code touches
only the relevant settings.

Change-Id: Icf3d1b7ca428ac50a5a16ecec39ed8186ac5ae13
2021-05-30 19:17:50 +00:00
Aidan MacDonald
f64e8dc33c x1000: Complete the register definitions
I think this covers everything now, although some fields are missing
enum values. Those can be added in if and when they are needed.

Change-Id: Ib1a94ba9c9a5949b6a038f8c1a49786823fae58f
2021-05-29 16:34:32 +01:00
Aidan MacDonald
75cb8ba8a4 FiiO M3K/X1000: add USB support
This only required a minor patch to the usb-designware driver due
to DMA requiring physical addresses -- on the X1000, these differ
from virtual addresses so we have to do the usual conversion.

Both the mass storage and HID drivers work, but there are a few
issues so this can't be considered 100% stable yet.

- Mass storage might not be detected properly on insertion,
  and USB has to be replugged before it shows up
- HID driver may occasionally panic or hang the machine

Change-Id: Ia3ce7591d5928ec7cbca7953abfef01bdbd873ef
2021-04-21 18:31:55 +00:00
Aidan MacDonald
3ec66893e3 New port: FiiO M3K on bare metal
Change-Id: I7517e7d5459e129dcfc9465c6fbd708619888fbe
2021-03-28 00:01:37 +00:00
James Buren
018372bf39 usb: implement macro for initializing USB strings
This uses the new unicode string literal feature that is available
now to greatly simplify the initialization of these special string
types. This makes them much more readable at a quick glance.

Change-Id: Iad8b49aa763486608e3bb7e83fb8abfb48ce0a7b
2021-03-25 13:26:03 -05:00
Aidan MacDonald
73cee8f177 Add RegGen-NG tool and definitions for Ingenic X1000
Change-Id: Ib9ec35c068e1cff8dcf120a13cfe3f5f58908a95
2021-03-02 00:36:01 +00:00
Aidan MacDonald
13c7f482ce Add ingenic_tools/usbboot utility
This is essentially an expanded version of jz4760_tools/usbboot,
able to support both X1000 and JZ4760 CPUs and easily extended to
handle other Ingenic CPUs using the same boot protocol.

Change-Id: I70ce3acc3531d65390c6bbae4d2b3352140acf0a
2021-02-28 02:52:56 +00:00
Aidan MacDonald
b8945734f5 Make headergen_v2's output include what it uses
Change-Id: Ie9790faac44c33a170bc2dc39d706575cefa0f2f
2021-02-27 22:02:31 +00:00
Dominik Riebeling
65d0867a25 rbutil: Add option to langstat to pass git hash.
Don't always operate on the remote head, instead default to the local
HEAD, and allow passing a hash to use for calculating statistics.

Change-Id: I420308e66769689c1dfac56e19058b097a0533a2
2021-01-02 21:31:20 +01:00
Dominik Riebeling
ff7e8b4293 deploy: Update sources list for Rockbox Utility.
Change-Id: If23a2ee8056b124500e385a9d973dfbddbc32e02
2020-11-22 18:30:01 +01:00
William Wilgus
47e1f96427 Bugfix Backlight_init should be called after lcd_init
the rest..

Change-Id: I50585ba2191aa8134de3045b1445859b27503a68
2020-11-13 13:57:39 -05:00
Amaury Pouly
235cdeca73 qeditor: add better fallback mecanism for icons
Change-Id: Ib87406c95fc6c579f108b81246350d12de428ba4
2020-11-04 13:14:42 +00:00
Dominik Riebeling
1058ed5b25 tomcrypt: Set target macOS version.
Make sure the target version isn't the default one so it also runs on
older macOS version than the current one.

Change-Id: Ib3517c97eee23ce1648e644ffc9daba2d1e7b599
2020-10-31 19:20:36 +01:00
Dominik Riebeling
1801dcc999 rbutil: Fix native Windows build for tools.
- When make on Windows finds sh.exe it will try to use that. We use
  cmd.exe calls when detecting Windows, so make sure we use cmd.exe as
  shell.
- Add missing Windows compatibility to tomcrypt Makefile.

Change-Id: Iaef133ca27472a5ddf449174d540983f15c66aea
2020-10-21 21:33:39 +02:00
Amaury Pouly
08513103c6 nwzstools: add NW-A820 nvp nodes
Change-Id: Iab79eb0c9b0bbf8fb7622f5630f385d56878507a
2020-10-18 22:34:16 +02:00
Dominik Riebeling
a05d061aa3 rbutil: Pass isysroot to rbutil libs on macOS.
On macOS we pass the full path to the compiler. On recent versions this
causes the compiler to not find its SDK path, this needs to get passed
via the isysroot option.

Change-Id: Iea2820e1755cc80e12691119dfa31d70938ea511
2020-10-18 19:16:27 +02:00
Dominik Riebeling
d097742155 sbtools: Change crypto wrapper implementation to C.
There's nothing C++ left.

Change-Id: I98d8406215287c02b56029ed7c0e2b0e645bbcf1
2020-10-18 19:08:32 +02:00
Dominik Riebeling
2037b837f8 sbtools: convert crypto to libtomcrypt.
Replace the use of crypto++ with tomcrypt, which is much smaller and C.
This gets rid of various build issues for systems that don't ship
crypo++ (i.e. everything except Linux.)

Change-Id: Ic0799e17b94935c71b14765cf9a2a7ea2b0adc7a
2020-10-18 19:08:32 +02:00
Dominik Riebeling
815b289cb3 imxtools: Replace use of "byte" with its underlying uint8_t.
libtomcrypt uses a macro "byte" which conflicts with this type. Since
the underlying type is uint8_t and there's no real benefit from using a
custom type use the actual underlying type.

Change-Id: I982c9b8bdcb657b99fa645a5235303af7afda25b
2020-10-18 19:08:32 +02:00
Dominik Riebeling
387a45923c utils: Add Makefile for our copy of libtomcrypt.
Change-Id: I6b9ffe86b9e78b494a3a9211d6e79bb81c9fb6d4
2020-10-18 19:08:32 +02:00
Dominik Riebeling
caa9d9c1c5 utils: Add (partial) libtomcrypt.
Add the parts of libtomcrypt that we're about to use.

Change-Id: I0adc1d7d1f4833e7bb3ed53b9a4d9a85977cfb8b
2020-10-18 19:08:32 +02:00
Amaury Pouly
df8b817c96 nwztools/scsitool: fix incorrect declaration in header file
Change-Id: I10727311db4747a66b3ae7f72a92a64cc99dfc82
2020-10-15 23:03:15 +02:00
Amaury Pouly
4e89e0e0ea nwztools: fix wrongly generate MD5 files
When generating the MD5 using -z index,name the tool would add the entry but
forgot to increase the file size, hence truncating the file.

Change-Id: Ibd3c594722ab46350cda60d158666fe34a96e922
2020-10-11 16:20:45 +02:00
Amaury Pouly
fcdfeb2a45 nwztools: re-implement MD5 on Windows
I forgot to fixup the windows up and missed it because of conditional
compilation

Change-Id: I526c765b9d56508815941ecb9b9dbac7ea407cf0
2020-10-11 14:10:12 +02:00
Amaury Pouly
e371dee4a3 nwztool: fix computation
It turns out the calculation gives the right result for the wrong reason, this
fixes it.

Change-Id: I36053c8993b5ae1e85380da59546ffade265fb3f
2020-10-11 13:08:03 +02:00
Amaury Pouly
8ce60c54f7 nwztools/upgtool: add support for MD5
When compressing, it is possible to tell the tool to add an entry to the MD5
file (index 1), it is still necessary to give an empty file for that index.
To do so, pass the option "-z idx,name" insteas of "-z idx". This will create
an entry of the form "size md5 name". For instance "-z 6,system.img".
When decompressing, if one passes "-z idx,name" instead of "-z idx", the tool
will decompress and check against the value in the MD5 file.

Change-Id: Ifb945f6121644ae9105265d2d83ce6067301c5b2
2020-10-11 13:08:03 +02:00
Amaury Pouly
7cba599106 nwztool/upgtools: add NW-A55 and DMP-Z1 KAS, reorganize list
Change-Id: I24bc6b15c954540cfa9b4f176ecbf817b1b641e7
2020-10-11 13:08:03 +02:00
Amaury Pouly
1b5e824405 nwztool/upgtool: add support for compression
To decompress some output file(s), simply pass -z <idx> where idx is the index
of the file to decompress, starting from 0. For example
  upgtool -e NW_WM_FW.UPG -o tmp/ -m nw-wm1a -z 6 -z 7
to decompress files 6 and 7. To compress file, use the same options:
  upgtool -c NW_WM_FW.UPG -m nw-wm1a -z 2 script.sh md5sum.txt system.img

Change-Id: I1ef0b3e02c98e58154f1a959fb1ad70ad2ce6500
2020-10-11 13:08:03 +02:00
Amaury Pouly
1f338f7078 nwztools/upgtools: add support for windows
In order to avoid the crypto++ mess, the code uses the Windows Cryptography API,
which is standard. There is also some makefile magic to cross-compile:
  make PREFIX=i686-w64-mingw32- EXE_EXT=.exe
I selected the option so that it should statically link supports libraries used
by gcc (slsj and libwinpthread).

Change-Id: Iaf07da23afe81ed217fb3921ce13367c5441514d
2020-10-11 13:08:03 +02:00
Amaury Pouly
05fa8fc343 scsitools: typo
Change-Id: I0f4e5b6c5e88a1ae49102e6f6fc6f8c86cb63959
2020-10-11 13:08:03 +02:00
Amaury Pouly
53d2742a48 nwztools: add support for new UPG format on post-WM1/A30 devices
The new code supports reading and writing UPG files. I kept the old keysig
search code but it only supports the old format (the new format has too long
keys anyway). Since we now have to support two types of encryption(DES and AES),
I reorganized the crypto routines and clean-up some code.

Change-Id: Ie9be220ec2431ec6d0bd11699fa0493b62e1cec2
2020-10-11 13:08:03 +02:00
Amaury Pouly
cda16f9439 scsitools: const correctness and add "get_dnk_nvp all" subcommand.
Change-Id: Ic5cb3dfa3be684f31a2c55a3cb7d45cfe8c65b25
2020-10-11 13:08:03 +02:00
Amaury Pouly
76fbb33adf nwztools: fix MW-WM1/A30 KAS, fix KAS length
Split WM1A/WM1Z because they don't have the same KAS. On newer devices, the KAS
is actually 64 bytes, not 60. The strange thing is that "get_dnk_nvp kas" returns
60 bytes whereas "get_dnk_prop kas" returns 64, not sure why.

Change-Id: I944d3d838209ba58388439af0cdf5d7c74f1f7fc
2020-10-11 13:08:03 +02:00
Solomon Peachy
ec413f7692 jz4760: Heavily rework USB driver to add working DMA support
* DMA Bulk IN (ie our TX) results in sequential transfers 33-68% faster.
 * DMA Bulk OUT (ie RX) is mostly stripped out due to complete brokenness.
 * Interrupt and control endpoints remain PIO-driven.

Other improvements:

1) Use consistent endpoint references (no magic numbers)
2) Greatly enhanced logging
3) DMA support can be compiled out completely
4) Setting lockswitch will disable all DMA operations at runtime
5) Much more robust error checking and recovery

Change-Id: I57b82e655e55ced0dfe289e379b0b61d8fe443b4
2020-09-17 11:26:04 -04:00
Dominik Riebeling
db350ac3e2 themeeditor: Get revision info from git.
We're not using svn anymore. This isn't used, but at least try to get
the right value.

Change-Id: I66e726d28b504a0f15d5b6497a02963243ba466a
2020-09-04 19:08:54 +02:00
Dominik Riebeling
6810d83686 themeeditor: Update targetdb.
Change-Id: Iec78635b46e08a508a20048a14687f3be830ad63
2020-09-03 19:14:11 +02:00
Dominik Riebeling
93bb14c877 themeeditor: Make NSIS script work with mxe.
Change-Id: I592a28f64f88c4ec0d1c4f45aeb8148ac2bc7d9b
2020-09-03 19:09:43 +02:00
Dominik Riebeling
fa330c109d themeeditor: Make it compile with current Qt5.
- Replace use of obsolete members with their replacements.
- Fix type issue that requires explicitly creating the right object now.
- Update project file to work with Qt5.

Change-Id: I3af2b1520796e977e58c0a01e165c77c469a23b9
2020-09-03 18:45:48 +02:00
Dominik Riebeling
ff38666a19 themeeditor: Fix download URL for targetdb.
We're not using svn anymore since long.

Change-Id: I408b1c59dfaafe1e403b0fa49b912862b68c72f8
2020-09-03 18:45:48 +02:00