Commit graph

60 commits

Author SHA1 Message Date
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
Bertrik Sikken
93de093690 mkamsboot: add support for clip zip original firmware 01.01.21 (tested by me)
Change-Id: Ief8a8e6dfe87a17285dd5259fd3c4cebfc962643
2013-07-12 22:23:36 +02:00
Bertrik Sikken
a28106dc26 Add support for clip+ firmware 1.02.18 to mkamsboot (tested by me)
Change-Id: Ic7d1860c59291e6e5c55b3f91d86de447e53cf66
2012-08-08 19:59:29 +02:00
Dominik Riebeling
c1a71ab9ae Fix a typo and remove line splicing.
Change-Id: Ifce9224e352b2a3efef92aff4bbdde9fc8714587
2012-04-28 21:46:33 +02:00
Bertrik Sikken
a12b2a5df9 mkamsboot: add support for clip zip original firmware 01.01.20 (tested by me)
Change-Id: I1d071539d496c63f47d305375e244f9fbe107ced
2012-04-08 11:46:02 +02:00
Rafaël Carré
88cda7eb26 mkamsboot: fix some Clipv2 that we used to brick
On those models the software bootloader is entered through the SWI vector,
not through the reset vector like we thought.

Use put_uint32le() instead of memcpy
Use mov pc, #0x200 instead of b 0x200, so we can use the same instruction
for both vectors.

Tested on Clipv2 and Clip Zip

Change-Id: I99dc24167dde5558d34fe9795c65b44ff91aa665
2012-01-31 14:23:53 -05:00
Bertrik Sikken
c9a8031695 mkamsboot: add support for sansa clip zip firmware version v1.01.18
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31195 a1c6a512-1295-4272-9138-f99709370657
2011-12-10 09:45:28 +00:00
Bertrik Sikken
1ab2aa1f28 Sansa clip zip: allow original firmware versions 1.1.12, 1.1.15 and 1.1.17 to be patched
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30860 a1c6a512-1295-4272-9138-f99709370657
2011-10-30 08:09:46 +00:00
Bertrik Sikken
e90f961593 Sansa clip zip: update mkamsboot and fix various drivers to make it boot to the main firmware
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30853 a1c6a512-1295-4272-9138-f99709370657
2011-10-29 17:08:05 +00:00
Bertrik Sikken
94c573f3ec Sansa clipzip: miscellaneous updates
* add support for OF version 01.01.17 in mkamsboot
* introduce and implement oled_brightness function
* configure voltage CVDD2 to 2.8V (like the OF does)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30831 a1c6a512-1295-4272-9138-f99709370657
2011-10-23 14:20:47 +00:00
Bertrik Sikken
1195b2384f sansa clipplus: add version 01.02.16 to mkamsboot as a firmware that can be patched
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30726 a1c6a512-1295-4272-9138-f99709370657
2011-10-07 22:49:37 +00:00
Bertrik Sikken
2052540972 sansa clipzip: implement default dualboot code (boots to OF unconditionally for now)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30435 a1c6a512-1295-4272-9138-f99709370657
2011-09-05 18:14:29 +00:00
Bertrik Sikken
463b3ed8b2 Initial framework for the Sandisk Sansa Clip Zip
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30365 a1c6a512-1295-4272-9138-f99709370657
2011-08-27 16:21:19 +00:00
Dominik Riebeling
02dce4500d mkamsboot: restructure model / firmware file information.
Merge the various arrays holding model specific information into a
structure and give it a distinct name. Avoids problems when linking with
Rockbox Utility.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29177 a1c6a512-1295-4272-9138-f99709370657
2011-01-31 20:15:50 +00:00
Rafaël Carré
bff5e3d7ab mkamsboot: take in account the additional 0x200 block when calculating size
Align sizes of different blocks on mkamsboot output

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27482 a1c6a512-1295-4272-9138-f99709370657
2010-07-18 17:05:05 +00:00
Rafaël Carré
765c4f1a97 mkamsboot: update outdated comment
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27442 a1c6a512-1295-4272-9138-f99709370657
2010-07-16 00:05:52 +00:00
Rafaël Carré
f5c79105a4 mkamsboot: fix for newer fuzev2
These models are restricted to OF >= v02.3.31, probably because of a
hardware change
The OF checks a version string located between 0x0 and 0x200 in the
firmware block, so let's keep this part unmodified

We put our dualboot code at 0x200, and insert a branch + vectors at 0x0
That way our patched file will present the OF version to the fuzev2 OF
patching it, and we only waste 512 bytes on other models

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27441 a1c6a512-1295-4272-9138-f99709370657
2010-07-16 00:00:29 +00:00
Rafaël Carré
ff6b0425e4 mkamsboot/rbutil/amsinfo : do not try to detect the model of a given Sansa AMS OF
The field we thought was representative of the model is not, it has
changed in the past for fuzev1 and fuzev2.
For example the value 0x23 is found in 2 old fuzev1 OF versions, and in
the c200v2 OF

The only reliable way to detect the model of a given OF is by using the
built-in list of md5sums.

Modify mkamsboot and rbutilqt to load the rockbox bootloader first, and
then check if the model in the bootloader corresponds to the model of
the known md5sum of the given OF.

That way we can continue to present the user with a list of known OF
versions in case the OF is unknown to mkamsboot

Also explicit the dependency of main.c on mkamsboot.h in case the
prototypes change
Correct the header's description not updated in r21648

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26248 a1c6a512-1295-4272-9138-f99709370657
2010-05-24 10:06:52 +00:00
Rafaël Carré
e2d1eb6fc8 mkamsboot: support Fuzev2 OF 2.03.33
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26230 a1c6a512-1295-4272-9138-f99709370657
2010-05-21 13:13:53 +00:00
Rafaël Carré
d9e508b584 mkamsboot: support Clip+ OF v01.02.15
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26207 a1c6a512-1295-4272-9138-f99709370657
2010-05-20 18:51:49 +00:00
Rafaël Carré
fdf8e2d1e4 mkamsboot: accept Clip+ OF v01.02.13
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25662 a1c6a512-1295-4272-9138-f99709370657
2010-04-17 12:17:01 +00:00
Rafaël Carré
be920c4fb5 Fix Fuzev2 OF version
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25366 a1c6a512-1295-4272-9138-f99709370657
2010-03-28 02:58:00 +00:00
Rafaël Carré
0d96f9e581 mkamsboot: add fuzev2 OF 2.02.31
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25365 a1c6a512-1295-4272-9138-f99709370657
2010-03-28 02:45:09 +00:00
Rafaël Carré
20fccd8489 mkamsboot: add Clipv2 OF v2.01.35
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25287 a1c6a512-1295-4272-9138-f99709370657
2010-03-22 08:32:04 +00:00
Rafaël Carré
a384cdf7e8 mkamsboot: update for Clipv1 OF v01.01.35 (tested)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25213 a1c6a512-1295-4272-9138-f99709370657
2010-03-16 02:11:04 +00:00
Thomas Martitz
f6540e800d Sansa Fuzev2: Add mkamsboot and dualboot support. The bootloader doesn't work, but pressing |<< or inserting USB to boot the OF does.
It should be pretty safe to run test code on it now.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24924 a1c6a512-1295-4272-9138-f99709370657
2010-02-26 13:55:17 +00:00
Rafaël Carré
b6c20c17e4 mkamsboot: prevents 2 potential problems
We checked if the new firmware block (bootloader+ucl function+packed
bootloader & OF) fit in the OF file, but not if it would run properly.

For example the Clipv2 OF is bigger than 0x50000 bytes uncompressed, but
it fitted in this space when packed and concatenated to a packed
bootloader + ucl function and dualboot code (but we use 1MB of RAM and
not 0x50000 anyway).

Now we check that both bootloader and OF are small enough to be unpacked
at runtime: the unpacked data must be smaller than available memory and
not overlap with ucl function and packed data (although the unpacked and
packed data could probably overlap a bit, I don't know how to calculate
this and this could be quite complex).

total_size() is replaced by check_sizes() which will perform all the
checks and set an error string if the firmware can't be patched.
(both mkamsboot and rbutilqt modified accordingly)

The second problem is that dualboot.S assumed r3 and r5 were left
untouched in the device specific checks. This was undocumented and very
error prone when modifying these checks.

r3 is the last byte of packed copy (bootloader or OF)
r5 is the entry point of uclunpack function derived from r3, so move r5
calculation after the device specific code.

Even if r3 is currently unused in the device specific code, we store it
in memory after copying the ucl function, when it points to the last byte
of packed data (not yet copied at this point since we didn't chose if we
boot the OF or the bootloader), and restore it just before using it so no
restriction is placed on registers usage in device specific code.

Add a new variable ucl_dest in dualboot.S set by mkamsboot.c, which
represents the last bound of buffer where we copy the ucl function, and
then the packed data (bootloader or OF).

RAM_SIZE definition is moved from dualboot.S to mkamsboot.c new
model_memory_size(), where it is a bit better documented.

Tested on e200v2 and Clip+

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24772 a1c6a512-1295-4272-9138-f99709370657
2010-02-19 14:10:26 +00:00
Jack Halpin
de3489a6c8 Sansa Clip+ : Add dualboot support for sansa clip+ to mkamsboot.
Dualboot works on the sansa clip+ by holding either the left "|<<" or home buttons.
The USB pin is still undiscovered at this point and should replace the home button when found.
By including the home button for dualboot we avoid bricking due to a single button failure.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24561 a1c6a512-1295-4272-9138-f99709370657
2010-02-08 06:43:47 +00:00
Michael Chicoine
b1dfdd4c7a Update mkamsboot for Fuze OF 01.02.31
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24311 a1c6a512-1295-4272-9138-f99709370657
2010-01-21 14:34:04 +00:00
Rafaël Carré
8b926e98f8 Add Sansa Clip+ target to test mkamsboot
UNTESTED, could ver well brick your Clip+
If it works, booting should just be delayed by a small delay (perhaps
not noticeable)
Hopefully the Clipv2 checks will work for Clip+ and then we'll be able
to test the other Clipv2 code (LCD/button)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24219 a1c6a512-1295-4272-9138-f99709370657
2010-01-13 03:05:29 +00:00
Dominik Riebeling
ea6178065c Clean up mkamsboot building. No functional changes.
- split out standalone functions to a separate file.
- adjust and clean up Makefile.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23520 a1c6a512-1295-4272-9138-f99709370657
2009-11-04 20:58:40 +00:00
Rafaël Carré
e51dbc0f4f mkamsboot: support Fuze OF v 1.02.28
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23067 a1c6a512-1295-4272-9138-f99709370657
2009-10-10 11:21:15 +00:00
Dominik Wenger
a66dfa4ab7 rbutil: add ams sansa targets. (FS#10185)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22317 a1c6a512-1295-4272-9138-f99709370657
2009-08-15 13:04:21 +00:00
Rafaël Carré
b5f9f6152b mkamsboot: remove runtime copyright notice
add a cast to remove a warning in printf()

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21925 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 17:51:01 +00:00
Thomas Martitz
ff2f839c39 Change to versioning for mkamsboot to <rXXXXX>-<DATE> for svn builds. A fixed number like 1.1 can (and should) be used for releases.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21652 a1c6a512-1295-4272-9138-f99709370657
2009-07-05 10:35:47 +00:00
Rafaël Carré
ef7ad19d37 mkamsboot: change version string to 1.1, move devices list in the header
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21650 a1c6a512-1295-4272-9138-f99709370657
2009-07-05 08:25:44 +00:00
Thomas Martitz
f9eeab2b6c Slightly rewrite some parts of mkamsboot for better output and some sanity in the early array declarations. No functional change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21648 a1c6a512-1295-4272-9138-f99709370657
2009-07-05 02:30:33 +00:00
Rafaël Carré
8bb5e430e5 mkamsboot: refuse to patch an untested OF, and provide a list of tested OF versions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21189 a1c6a512-1295-4272-9138-f99709370657
2009-06-04 16:31:11 +00:00
Rafaël Carré
a96f2373db mkamsboot : brackets at the start of functions must be on their line - thanks to linuxstb for noticing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21122 a1c6a512-1295-4272-9138-f99709370657
2009-05-28 21:19:21 +00:00
Rafaël Carré
96165abec2 FS#10253 : mkamsboot v1.0
- Bump version to 1.0
- Add Clipv2 target
- Make mkamsboot work as a library (work by domonoky : FS#10185, with a few modifications by me)
  . Use a macro with variadic arguments for error cases in functions which might error.
  . Add detailed descriptions to functions exported by the library (in the header file)
- modify bin2c.c to produce only one pair of .c/.h files with several files embedded in it
- move files needing to be built by an ARM cross compiler into dualboot/
- commit produced .c/.h files (containing nrv2e_d8.S and dualboot.S built for Clip, Fuze, e200v2, c200v2, m200v4, Clipv2)
- Write a real README file
- cosmetics: indent dualboot.S properly, remove trailing spaces, limit lines to 80 characters
- comments: add/correct comments in dualboot.S and mkamsboot.c
- move back extract_fw.c to utils/AMS/hacking

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21118 a1c6a512-1295-4272-9138-f99709370657
2009-05-28 18:27:08 +00:00
Rafaël Carré
b0e0ec832b mkamsboot: really error out if OF model is different from bootloader model
Error out if firmware md5sum isn't known, and leave the current code #if 0'ed for easier testing

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21073 a1c6a512-1295-4272-9138-f99709370657
2009-05-25 10:35:15 +00:00
Thomas Martitz
238337087e Support Fuze 01.02.26 OF version.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20688 a1c6a512-1295-4272-9138-f99709370657
2009-04-11 20:46:28 +00:00
Bertrik Sikken
e60ca805b6 Add md5 for clip OF version 1.01.32 to mkamsboot (verified to work)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20326 a1c6a512-1295-4272-9138-f99709370657
2009-03-16 18:55:39 +00:00
Michael Giacomelli
68e24d3a16 Commit updated mkamsboot for c200v2 patching. Tested and seems to be working using USB for dualboot.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19575 a1c6a512-1295-4272-9138-f99709370657
2008-12-24 04:23:52 +00:00
Dave Chapman
db1ea97fe8 Add MD5 checksum for v1.01.22 of the Fuze original firmware.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19444 a1c6a512-1295-4272-9138-f99709370657
2008-12-15 14:17:13 +00:00
Dave Chapman
dcb0e43148 Clean up the Makefile a little - no functional changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19106 a1c6a512-1295-4272-9138-f99709370657
2008-11-14 22:16:22 +00:00
Daniel Stenberg
044ba22b93 "mv m200v2 m200v4"
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19060 a1c6a512-1295-4272-9138-f99709370657
2008-11-10 09:27:40 +00:00
Rafaël Carré
29a5373724 mkamsboot: supports Fuze firmwares
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18936 a1c6a512-1295-4272-9138-f99709370657
2008-10-30 20:00:56 +00:00
Dave Chapman
5456859dd7 Correct the MD5 sum for the Clip 1.1.29 firmware.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18929 a1c6a512-1295-4272-9138-f99709370657
2008-10-30 00:27:29 +00:00
Dave Chapman
c91d7873c7 Add MD5 checksumming of the original firmware images - for extra safety, and also because some Fuze firmwares have the same ID (or what we thought was the ID) as the M200 firmwares. Plus a few minor cleanups.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18927 a1c6a512-1295-4272-9138-f99709370657
2008-10-30 00:13:29 +00:00