Commit graph

56 commits

Author SHA1 Message Date
Amaury Pouly
b772782ce5 mkimxboot: don't forget to pass model if given on command line
Change-Id: I1d20b38ff5b0f337d9a2eef6e2e1d6c170aabce7
2016-12-19 18:46:40 +01:00
Amaury Pouly
a983859291 imx233: add capability to boot OF or updater instead of Rockbox
This commit adds the necessary code in the dualboot stub (bootloader) to
let rockbox control the boot process. In particular, rockbox can now choose
if the next boot will be normal (boot rockbox or OF on magic key), to OF
or to updater.

The intents (to be added in follow-up commits) are:
1) Let the user more easily reboot to the OF. On some targets it is not trivial,
especially in USB mode.
2) Automatically reboot to updater when the user drop firmware.sb at the root
of the drive (currently, the user needs to do that in OF USB mode)
3) Document this OF magic

Change-Id: I86df651dec048c318c6a22de74abb8c6b41aa9ad
2016-12-12 12:03:08 +01:00
Amaury Pouly
1c4373fd1f imx233: fix dualboot, forgot a file
Change-Id: I8d5817d75f76a201c3a8b76db0d1e11f71548179
2016-09-22 21:31:29 +01:00
Amaury Pouly
673ee48675 imx233: fix dualboot stubs
They did not compile anymore after the register hearder rework. This change
only fixes the syntax, the generated binaries are exactly identical.

Change-Id: Iec2347aa3deb1ddfe2ca36f0db1e481c4e2d329c
2016-09-22 21:03:31 +01:00
Amaury Pouly
a6b4bf3a33 mkimxboot: remove code for NWZ-370/380
Since the stub code is shared with NWZ-360, it enables the pullup for the
hold button, but the NWZ-370/380 doesn't have a hold button so don't compile
this code in, it could potentially have unexpected effets or increase consumption

Change-Id: I28c8aa40fc7f9373593ff105fb6df557a6f57ccd
2016-05-25 23:29:04 +01:00
Amaury Pouly
b40ad7d269 mkimxboot: make cross compiler for dualboot stubs overridable
Change-Id: I90d2048f622b355eae7091e536b940b2ac828583
2016-05-25 23:28:25 +01:00
Amaury Pouly
98a69ec500 mkimxboot: fix usage message
Change-Id: I7a7a2c56c434525ac242f447dd8bb287d5fc69eb
2015-03-08 22:57:29 +01:00
Thomas Jarosch
2a3e1628a5 Limit more variables to file scope
Change-Id: I30219d626316776eb73b4205d63376fa3dbc6361
2015-01-11 21:40:51 +01:00
Dominik Riebeling
79a56fabb9 Compile imxtools as gnu99 standard.
With current MinGW using c99 as standard the compiler causes problems with some
types.  Use gnu99 standard instead which doesn't do this.

Change-Id: I731f58025645ae88ac226593a2b2a62140285ee8
2014-06-30 17:58:37 +02:00
Amaury Pouly
61dbeb60b7 mkimxboot: don't forget to select LRADC source before reading
Change-Id: I3435857f48580d7b3bf9363a2eed96738fbda69a
2014-02-10 23:14:25 +01:00
Amaury Pouly
6022d3100a mkimxboot: tool can now recreate a stub to recover from very low battery
Several devices, including the Fuze+ have great trouble recovering from
very low battery states, even in the presence of USB power. This is partly
due to buggy Sigmatel boot stubs and Rockbox bootloader doing unsafe power
operations on boot (should be fixed soon).  In such a state, it is impossible
to boot either the OF and Rockbox, so only the recovery mode is available.
With this commit, mkimxboot can now create a very small stub which only
does one thing but does it well: setup charging to recover from any situation.
It does not provide a fancy charging screen or whatever, screen will just
stay black and the device will slowly charge at ~100mA. When the battery is
back to a normal level, just unplug and boot normally.

Change-Id: Ib50880af85ed1f4f64a7eed0f2221e73c889c351
2014-01-21 19:01:34 +01:00
Amaury Pouly
cddf388f76 mkzenboot: reflect ZEN V target id change
Change-Id: I0bad98b43e1a23c9432f4bdfe78dc77ead7879a8
2014-01-21 19:01:08 +01:00
Amaury Pouly
1b3ae498cd mkimxboot: fix strange MD5 sum about ZEN X-Fi3
This old sum didn't match the US or EU 1.00.25 version and the actual ones were
missing.

Change-Id: I942641e5f367ab45794cb93a8b26b87962172216
2014-01-21 18:52:28 +01:00
Amaury Pouly
69d0dae55b Initial commit for the ZEN X-Fi Style
Change-Id: Ib25a357a7bafd2ef25f273cadff70fafbd8d4661
2014-01-21 18:52:28 +01:00
Amaury Pouly
192f3020f8 mkimxboot: add NWZ-E380 1.0.0 firmware
Since E380 is just rebranded E370, mark it as E370

Change-Id: I2eb7dac9ff18a7dbbd26c44b8784207e54f48dd0
2013-11-13 21:37:52 +00:00
Amaury Pouly
a31c50ff46 Remove useless braces
Change-Id: I88cce98cd8cc04f0245fba8ef30434167df483fc
2013-10-21 23:58:32 +02:00
Amaury Pouly
d13e5b964e mkimxboot: add NWZ-E370 1.0.1 firmware (US)
Change-Id: I49ddcbe2f5c1c3aabc604b81b89272cf0292e28e
2013-09-28 12:14:45 +02:00
Amaury Pouly
b60712deb6 sonynwz: rework dualboot mechanism
Now boot to RB if play/pause is pressed during 1 second, and to OF if
back is pressed 1 second. Otherwise power off. If hold is on, also power
off. In USB and alarm context, always boot and back determines OF vs RB.

Change-Id: Ie1d6c971901d6473255461cc7d71a5ee3177ecad
2013-09-26 20:19:30 +02:00
Amaury Pouly
d527c5595c mkimxboot: always clean up dualboot elf files
Change-Id: I80ed1af784aa80bec9fa0b1e9322f25e69672510
2013-09-26 20:14:09 +02:00
Amaury Pouly
6ac481e8bc Add support for the sony NWZ-E360/E370 to mkimxboot
Change-Id: Ied73591326339d22b4f21d311da9e6b1b9c223ed
2013-09-25 14:31:39 +02:00
Amaury Pouly
a2d4a4a560 mkimxboot: fix crash
I was too aggressive when converting reads to standard reads, this
one is memory based and not file based

Change-Id: Ibe7162894cc44cbd79f56cafe7136bda0f76bcdc
2013-08-22 17:49:50 +02:00
Amaury Pouly
05bd3e4cd2 mkimxboot: add entry for ZEN X-Fi3 1.00.25e firmware
Change-Id: I2c6cc4003bcc96662211fa066dd9e6e438b7e258
2013-08-22 00:48:55 +02:00
Amaury Pouly
99f3ca174e sbtools: more code refactoring
Factor all printf method with a unique one defined in misc.h

Change-Id: I58fbf8916b76e873a2e6678506d2c8aece7834ec
2013-08-21 22:20:53 +02:00
Amaury Pouly
cb8274373b sbtools: more printf fixing
Change-Id: Id617297c196b381fd1c381da3eff4345e3157529
2013-08-10 21:37:27 +02:00
Amaury Pouly
21672ba31c mkimxboot: fix red
Change-Id: Id5d27fc00969b6999df665e7182b7ff27bccfacd
2013-08-06 21:24:39 +02:00
Amaury Pouly
da8ebcec2f mkimxboot: code simplification
Change-Id: Ic16334c262ee5bce3575c306440f7e1de2b247f9
2013-08-06 21:24:38 +02:00
Amaury Pouly
03a4ba5481 mkimxboot: rewrite dualboot
Rewrite dualboot in C code instead of assembly. Also properly
handle subtarget and simply Makefile. This should make the
dualboot stub more readable and easier to extend. The new code
also gracefully handles power up from RTC alarm on imx233.

Change-Id: I7c225254b1463a97e76b6cb4de476aa2d2c9d2f9
2013-07-07 17:36:21 +02:00
Amaury Pouly
55babd5895 mkimxboot: add zen style 100/300 firmware to the list
The tool cannot produce any firmware yet but it can extract the
OF from the installer.

Change-Id: I98684b2bf43310443d93b482aa853464f6f87fa8
2013-06-18 15:02:01 +02:00
Amaury Pouly
d561017f35 mkimxboot: factor code, add support for ELF files
Refactor code.
This tool can now either load a scrambled rockbox
firmware (in which case the model is check against the
firmware), or any ELF file. This is useful for example
for hwstub which produces a ELF file and still needs
to be loaded by producing a SB file.

Change-Id: I7aa381b3f6587788d1950793e89ce5608c53cccc
2013-06-16 02:14:52 +02:00
Amaury Pouly
7c7fa36918 sbtools,mkximboot: fix whitespace
Change-Id: I8d8adb783707172d1aaef302366c240310350ed8
2013-06-15 22:27:34 +02:00
Amaury Pouly
58e27b9fa1 mkimxboot: refactor code, no functional change
The mkimxboot was becoming messy with juge functions and
redundant code. Factor reading/writing/loading code into smaller
functions. Introduce the concept of rockbox firmware to simplify
support of other formats than scramble.

Change-Id: I3a61295ca5abca1a0eee8c9e8709c6b8dfa256a6
2013-06-15 22:27:34 +02:00
Amaury Pouly
6483e23f07 mkximxboot: fix usage() formatting
Change-Id: I2f708e2830168f481018b8d8ce98134e40b4e8f8
2013-06-15 22:27:34 +02:00
Dominik Riebeling
8a4075d454 Make libtools compile rule more generic.
Create the object - source dependency internally and use a more generic rule
for compiling. Removes the need for explicit rules for source files located in
a different folder.

This adds the limitation for SOURCES and LIBSOURCES to only hold C files.

Change-Id: I56f6a4b1e7df36347cd2f54051e072251f456092
2013-05-11 20:34:11 +02:00
Amaury Pouly
44c32f8405 mkimxboot: fix usage
Change-Id: I049908ac0fe65646906999b7e661a64506bd2594
2013-03-10 15:10:56 +01:00
Amaury Pouly
ef958abdae mkimxtool: increase performance by compiling with O3
Change-Id: I3d69801488abec4fbc2a84665614936105f60ad2
2013-02-17 12:47:01 +01:00
Amaury Pouly
42a725f7ec mkimxboot: add a switch to force version
Add a switch to override the product and component version of the
sb file. This can usually for target like the Zen X-Fi2 where the
upader allows to drop any file named firmware.sb and prints the
version: by using a funky version the users can check they got it
right. This should not be used on the fuze+ or zenxfi3 because the
OF prevents downgrade.
Also make rbutil always zero out the option structure passed to
mkimxboot, this has already created bugs in the past.

Change-Id: I175c5def52c40c2132e11300e2f037d60a4f040e
2013-01-29 11:53:07 +00:00
Amaury Pouly
7fda69222c mkimxboot: add support for 1.23.01 installer
Change-Id: Ibce345ec411a189bd4a0a9555d145c4f057d8b15
2013-01-28 21:02:19 +00:00
Amaury Pouly
aad4308f03 zenxfi2: rework dualboot
The previous dualboot scheme had a major flow: it needed to hold
menu to boot OF but the X-Fi2 boot in recovery mode with menu!
It was possible but very trick to enter the OF with USB plugged.
This code provides a new scheme:
- no USB plugged: boot to OF when menu is pressed
- USB plugged: boot to OF when power is pressed

Change-Id: Ia6e76d3ada1f67137b727daa050cf6c77afbbfb9
2013-01-28 19:15:38 +00:00
Amaury Pouly
f2dfc84760 mkimxboot: add partial support for the Zen X-Fi Style
Change-Id: I3428a398959dfd7fc46175d87fc67acce6a75171
2013-01-26 18:37:12 +00:00
Amaury Pouly
2c36c82a89 fix style
Change-Id: I169b6712121979453269f5f5238b33cc49cd62b2
2013-01-26 18:37:05 +00:00
Amaury Pouly
f6e4456cc4 mkimxboot: add an option to extract the of without processing
Change-Id: Ie370f152f4efff4428ee023a9211b82a77fd1df4
2013-01-26 18:24:50 +00:00
Amaury Pouly
b6cad07f33 mkimxboot: fix bad return on internal error
Change-Id: I6aec9ec694568c15856b03322208f257181eca21
2013-01-26 18:24:50 +00:00
Amaury Pouly
4b1c48f5f5 mkximxboot: add version string and add zenxfi3 file
Add a version string with each md5sum, fix the version of an
entry, add a new zenxfi3 file entry.

Change-Id: I9fba76ee6032bbe31acd791b8d5e104b87992653
2013-01-15 19:10:55 +00:00
Dominik Riebeling
1e2c6506fb Fix crash in mkimxboot bootloader installation.
mkimxboot requires passing a structure which got extended with another field.
This wasn't adjusted in Rockbox Utility, causing an out of bound access to an
array, which results in a segfault.

Change-Id: I0252849ed0b41f1d8804537c053debc9b0ecd08d
2012-06-09 22:08:54 +02:00
Amaury Pouly
a87a9ef373 imxtools: move tools to a new sbtools/ subdirectory
Change-Id: I0d8d6831b35037725486f61fc363de87bc8ba92e
2012-05-31 13:57:25 +02:00
Amaury Pouly
e09c1e3d43 mkimxboot: add support for more target and variants
Add creative zen x-fi 2/3 and add a variant mechanism

Change-Id: Ic2ee82a4238a87c2eb5d72b8309650d9a280325f
2012-05-19 16:10:52 +02:00
Amaury Pouly
8c0c844b7b imx233: always boot when powered up from 5v
Change-Id: I3adb901d293c801f0a8493ae4f0b23af4fa535e8
2012-02-29 00:02:31 +01:00
Amaury Pouly
c735ff2ac0 mkimxboot/fuze+: fix booting to the OF
Change-Id: I51db192d9c88952173acac6558941ba6421a31dd
2012-02-28 21:00:23 +01:00
Amaury Pouly
15c69b8baf mkximxboot/fuze+: add power button delay to power on
Only boot to rockbox if the power button is hold sufficiently long.
For consistency, use the same mechanism as the OF:
- read PSWITCH 550000 times
- boot if PSWITCH=1 at least 400000 out of 550000 times
Only apply the delay if Volume Down is not hold,
so that the OF and RB delay don't cumulate.

Change-Id: I1e8a4cd108c56bf784fcf1c320f7a001ef161701
2012-02-28 00:03:46 +01:00
Dominik Riebeling
c5530d9258 Allow passing additional CFLAGS.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31524 a1c6a512-1295-4272-9138-f99709370657
2012-01-02 16:59:26 +00:00