summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallbase.cpp7
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallmpio.cpp140
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallmpio.h43
-rw-r--r--rbutil/rbutilqt/rbutil.ini14
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp2
-rw-r--r--rbutil/rbutilqt/rbutilqt.pri2
-rw-r--r--rbutil/rbutilqt/rbutilqt.pro9
7 files changed, 211 insertions, 6 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
index 3a94180aab..cf8b9e12fd 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
@@ -29,6 +29,7 @@
29#include "bootloaderinstallchinachip.h" 29#include "bootloaderinstallchinachip.h"
30#include "bootloaderinstallams.h" 30#include "bootloaderinstallams.h"
31#include "bootloaderinstalltcc.h" 31#include "bootloaderinstalltcc.h"
32#include "bootloaderinstallmpio.h"
32#include "utils.h" 33#include "utils.h"
33 34
34#if defined(Q_OS_MACX) 35#if defined(Q_OS_MACX)
@@ -64,6 +65,9 @@ BootloaderInstallBase* BootloaderInstallBase::createBootloaderInstaller(QObject*
64 else if(type == "tcc") { 65 else if(type == "tcc") {
65 return new BootloaderInstallTcc(parent); 66 return new BootloaderInstallTcc(parent);
66 } 67 }
68 else if(type == "mpio") {
69 return new BootloaderInstallMpio(parent);
70 }
67 else { 71 else {
68 return NULL; 72 return NULL;
69 } 73 }
@@ -212,7 +216,7 @@ QString BootloaderInstallBase::postinstallHints(QString model)
212 "<li>After the firmware has been updated reboot your player.</li>"); 216 "<li>After the firmware has been updated reboot your player.</li>");
213 } 217 }
214 if(model == "iaudiox5" || model == "iaudiom5" 218 if(model == "iaudiox5" || model == "iaudiom5"
215 || model == "iaudiox5v" || model == "iaudiom3") { 219 || model == "iaudiox5v" || model == "iaudiom3" || model == "mpioh200") {
216 hint = true; 220 hint = true;
217 msg += tr("<li>Turn the player off</li>" 221 msg += tr("<li>Turn the player off</li>"
218 "<li>Insert the charger</li>"); 222 "<li>Insert the charger</li>");
@@ -224,7 +228,6 @@ QString BootloaderInstallBase::postinstallHints(QString model)
224 "<li>Toggle the battery switch on the player</li>" 228 "<li>Toggle the battery switch on the player</li>"
225 "<li>Hold <i>Power</i> to boot into Rockbox</li>"); 229 "<li>Hold <i>Power</i> to boot into Rockbox</li>");
226 } 230 }
227
228 msg += "</ol>"; 231 msg += "</ol>";
229 msg += tr("<p><b>Note:</b> You can safely install other parts first, but " 232 msg += tr("<p><b>Note:</b> You can safely install other parts first, but "
230 "the above steps are <b>required</b> to finish the installation!</p>"); 233 "the above steps are <b>required</b> to finish the installation!</p>");
diff --git a/rbutil/rbutilqt/base/bootloaderinstallmpio.cpp b/rbutil/rbutilqt/base/bootloaderinstallmpio.cpp
new file mode 100644
index 0000000000..d6db46f0ae
--- /dev/null
+++ b/rbutil/rbutilqt/base/bootloaderinstallmpio.cpp
@@ -0,0 +1,140 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2008 by Dominik Wenger
10 * $Id: bootloaderinstallams.cpp 24778 2010-02-19 23:45:29Z funman $
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include <QtCore>
21#include "bootloaderinstallbase.h"
22#include "bootloaderinstallmpio.h"
23
24#include "../mkmpioboot/mkmpioboot.h"
25
26BootloaderInstallMpio::BootloaderInstallMpio(QObject *parent)
27 : BootloaderInstallBase(parent)
28{
29}
30
31QString BootloaderInstallMpio::ofHint()
32{
33 return tr("Bootloader installation requires you to provide "
34 "a firmware file of the original firmware (bin file). "
35 "You need to download this file yourself due to legal "
36 "reasons. Please refer to the "
37 "<a href='http://www.rockbox.org/manual.shtml'>manual</a> and "
38 "the <a href='http://www.rockbox.org/wiki/MPIOHD200Port'>MPIOHD200Port</a> "
39 "wiki page on how to obtain this file.<br/>"
40 "Press Ok to continue and browse your computer for the firmware "
41 "file.");
42}
43
44bool BootloaderInstallMpio::install(void)
45{
46 if(m_offile.isEmpty())
47 return false;
48
49 qDebug() << "[BootloaderInstallMpio] installing bootloader";
50
51 // download firmware from server
52 emit logItem(tr("Downloading bootloader file"), LOGINFO);
53
54 connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2()));
55 downloadBlStart(m_blurl);
56
57 return true;
58}
59
60void BootloaderInstallMpio::installStage2(void)
61{
62 qDebug() << "[BootloaderInstallMpio] installStage2";
63
64 int origin = 0xe0000; /* MPIO HD200 bootloader address */
65
66 m_tempfile.open();
67 QString bootfile = m_tempfile.fileName();
68 m_tempfile.close();
69
70 int ret = mkmpioboot(m_offile.toLocal8Bit().data(), bootfile.toLocal8Bit().data(), m_blfile.toLocal8Bit().data(), origin);
71
72 if(ret != 0)
73 {
74 QString error;
75 switch(ret)
76 {
77 case -1:
78 error = tr("Could not open the original firmware.");
79 break;
80 case -2:
81 error = tr("Could not read the original firmware.");
82 break;
83 case -3:
84 error = tr("Loaded firmware file does not look like MPIO OF file.");
85 break;
86 case -4:
87 error = tr("Could not open downloaded bootloader.");
88 break;
89 case -5:
90 error = tr("Place for bootloader in OF file not empty.");
91 break;
92 case -6:
93 error = tr("Could not read the downloaded bootloader.");
94 break;
95 case -7:
96 error = tr("Bootloader checksum error.");
97 break;
98 case -8:
99 error = tr("Could not open outputfile.");
100 break;
101 case -9:
102 error = tr("Could not write outputfile.");
103 break;
104 default:
105 error = tr("Unknown errornumber: %1").arg(ret);
106 break;
107 }
108
109 qDebug() << tr("Patching original firmware failed: %1").arg(error);
110 emit logItem(tr("Patching original firmware failed: %1").arg(error), LOGERROR);
111 emit done(true);
112 return;
113 }
114
115 //end of install
116 qDebug() << "[BootloaderInstallMpio] install successfull";
117 emit logItem(tr("Success: modified firmware file created"), LOGINFO);
118 logInstall(LogAdd);
119 emit done(false);
120 return;
121}
122
123bool BootloaderInstallMpio::uninstall(void)
124{
125 emit logItem(tr("To uninstall, perform a normal upgrade with an unmodified "
126 "original firmware"), LOGINFO);
127 logInstall(LogRemove);
128 return false;
129}
130
131BootloaderInstallBase::BootloaderType BootloaderInstallMpio::installed(void)
132{
133 return BootloaderUnknown;
134}
135
136BootloaderInstallBase::Capabilities BootloaderInstallMpio::capabilities(void)
137{
138 return (Install | NeedsOf);
139}
140
diff --git a/rbutil/rbutilqt/base/bootloaderinstallmpio.h b/rbutil/rbutilqt/base/bootloaderinstallmpio.h
new file mode 100644
index 0000000000..8e6c65affe
--- /dev/null
+++ b/rbutil/rbutilqt/base/bootloaderinstallmpio.h
@@ -0,0 +1,43 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2008 by Dominik Wenger
10 * $Id: bootloaderinstallams.h 22317 2009-08-15 13:04:21Z Domonoky $
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#ifndef BOOTLOADERINSTALLMPIO_H
20#define BOOTLOADERINSTALLMPIO_H
21
22#include <QtCore>
23#include "bootloaderinstallbase.h"
24
25//! bootloader installation derivate based on mkmpioboot
26class BootloaderInstallMpio : public BootloaderInstallBase
27{
28 Q_OBJECT
29 public:
30 BootloaderInstallMpio(QObject *parent);
31 bool install(void);
32 bool uninstall(void);
33 BootloaderInstallBase::BootloaderType installed(void);
34 Capabilities capabilities(void);
35 QString ofHint();
36
37 private:
38
39 private slots:
40 void installStage2(void);
41};
42
43#endif
diff --git a/rbutil/rbutilqt/rbutil.ini b/rbutil/rbutilqt/rbutil.ini
index bcef5d7d49..8fe6395d7c 100644
--- a/rbutil/rbutilqt/rbutil.ini
+++ b/rbutil/rbutilqt/rbutil.ini
@@ -65,6 +65,7 @@ platform71=samsungyh920
65platform72=samsungyh925 65platform72=samsungyh925
66platform73=cowond2 66platform73=cowond2
67platform80=vibe500 67platform80=vibe500
68platform90=mpiohd200
68 69
69[archosplayer] 70[archosplayer]
70name="Jukebox Player 6000 / Jukebox Studio 5 / 10 / 20" 71name="Jukebox Player 6000 / Jukebox Studio 5 / 10 / 20"
@@ -618,6 +619,19 @@ usberror=0x04098039
618configure_modelname=vibe500 619configure_modelname=vibe500
619encoder=rbspeex 620encoder=rbspeex
620 621
622[mpiohd200]
623name="MPIO HD200"
624buildserver_modelname=mpiohd200
625bootloadermethod=mpio
626bootloadername=/mpiohd200/bootloader.mpio
627bootloaderfile=/System/HD200_UPG.SYS
628manualname=
629brand=MPIO
630usbid=0x27351004
631configure_modelname=mpiohd200
632encoder=rbspeex
633status=disabled
634
621[05ac1240] 635[05ac1240]
622name="Apple Ipod Nano (Second Generation, DFU Mode)" 636name="Apple Ipod Nano (Second Generation, DFU Mode)"
623 637
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 29ba0e9c81..66e41944f1 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -43,7 +43,7 @@
43#include "progressloggerinterface.h" 43#include "progressloggerinterface.h"
44 44
45#include "bootloaderinstallbase.h" 45#include "bootloaderinstallbase.h"
46 46#include "bootloaderinstallmpio.h"
47 47
48#if defined(Q_OS_LINUX) 48#if defined(Q_OS_LINUX)
49#include <stdio.h> 49#include <stdio.h>
diff --git a/rbutil/rbutilqt/rbutilqt.pri b/rbutil/rbutilqt/rbutilqt.pri
index 53742570df..63d182a0ab 100644
--- a/rbutil/rbutilqt/rbutilqt.pri
+++ b/rbutil/rbutilqt/rbutilqt.pri
@@ -67,6 +67,7 @@ SOURCES += \
67 base/bootloaderinstallchinachip.cpp \ 67 base/bootloaderinstallchinachip.cpp \
68 base/bootloaderinstallams.cpp \ 68 base/bootloaderinstallams.cpp \
69 base/bootloaderinstalltcc.cpp \ 69 base/bootloaderinstalltcc.cpp \
70 base/bootloaderinstallmpio.cpp \
70 base/rockboxinfo.cpp \ 71 base/rockboxinfo.cpp \
71 ../../tools/mkboot.c \ 72 ../../tools/mkboot.c \
72 ../../tools/iriver.c \ 73 ../../tools/iriver.c \
@@ -133,6 +134,7 @@ HEADERS += \
133 base/bootloaderinstallchinachip.h \ 134 base/bootloaderinstallchinachip.h \
134 base/bootloaderinstallams.h \ 135 base/bootloaderinstallams.h \
135 base/bootloaderinstalltcc.h \ 136 base/bootloaderinstalltcc.h \
137 base/bootloaderinstallmpio.h \
136 base/rockboxinfo.h \ 138 base/rockboxinfo.h \
137 ../../tools/mkboot.h \ 139 ../../tools/mkboot.h \
138 ../../tools/iriver.h \ 140 ../../tools/iriver.h \
diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro
index bb191f59c9..13f31de164 100644
--- a/rbutil/rbutilqt/rbutilqt.pro
+++ b/rbutil/rbutilqt/rbutilqt.pro
@@ -63,8 +63,11 @@ libmkamsboot.commands = @$(MAKE) \
63libmktccboot.commands = @$(MAKE) \ 63libmktccboot.commands = @$(MAKE) \
64 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mktccboot \ 64 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mktccboot \
65 libmktccboot$$RBLIBPOSTFIX CC=\"$$QMAKE_CC\" 65 libmktccboot$$RBLIBPOSTFIX CC=\"$$QMAKE_CC\"
66QMAKE_EXTRA_TARGETS += rbspeex libucl libmkamsboot libmktccboot 66libmkmpioboot.commands = @$(MAKE) \
67PRE_TARGETDEPS += rbspeex libucl libmkamsboot libmktccboot 67 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mkmpioboot \
68 libmkmpioboot$$RBLIBPOSTFIX CC=\"$$QMAKE_CC\"
69QMAKE_EXTRA_TARGETS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot
70PRE_TARGETDEPS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot
68 71
69# rule for creating ctags file 72# rule for creating ctags file
70tags.commands = ctags -R --c++-kinds=+p --fields=+iaS --extra=+q $(SOURCES) 73tags.commands = ctags -R --c++-kinds=+p --fields=+iaS --extra=+q $(SOURCES)
@@ -86,7 +89,7 @@ INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher
86 89
87DEPENDPATH = $$INCLUDEPATH 90DEPENDPATH = $$INCLUDEPATH
88 91
89LIBS += -L$$OUT_PWD -L$$MYBUILDDIR -lrbspeex -lmkamsboot -lmktccboot -lucl 92LIBS += -L$$OUT_PWD -L$$MYBUILDDIR -lrbspeex -lmkamsboot -lmktccboot -lmkmpioboot -lucl
90 93
91# check for system speex. Add a custom rule for pre-building librbspeex if not 94# check for system speex. Add a custom rule for pre-building librbspeex if not
92# found. Newer versions of speex are split up into libspeex and libspeexdsp, 95# found. Newer versions of speex are split up into libspeex and libspeexdsp,