summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorpancake <pancake@dazo>2007-04-20 18:27:31 +0200
committerpancake <pancake@dazo>2007-04-20 18:27:31 +0200
commit300635ad8f8c5bdb5c50fc95f1c456ea7cc45151 (patch)
treeab2e73c27e8c11a683b66a0d7ae667dbf20c0bbb /src/main.c
parentb1d0ce2848a79664374f802954b1e4390b11da6d (diff)
download0xFFFF-300635ad8f8c5bdb5c50fc95f1c456ea7cc45151.tar.bz2
* 'set root device' patch inclusion from Robert Schuster
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 7812ae1..a463c26 100644
--- a/src/main.c
+++ b/src/main.c
@@ -33,6 +33,7 @@ char *boot_cmdline = NULL;
char *reverseto = NULL;
int rdflags = -1;
int usb_mode = -1;
+int root_device = -1;
int verbose = 0;
int identify = 0;
int reboot = 0;
@@ -157,6 +158,7 @@ void show_usage()
printf(" -I [piece] identify a firmware piece\n");
printf(" -l list supported usb device ids\n");
printf(" -d [vid:pid] injects a usb device into the supported list\n");
+ printf(" -D [0|1|2] sets the root device to flash (0), mmc (1) or usb (2)\n");
printf(" -R reboot the omap board\n");
printf(" -v be verbose and noisy\n");
printf(" -V show 0xFFFF version information\n");
@@ -199,7 +201,7 @@ int main(int argc, char **argv)
struct usb_device_descriptor udd;
int c;
- while((c = getopt(argc, argv, "p:vVhRu:ib:U:r:e:ld:I:")) != -1) {
+ while((c = getopt(argc, argv, "p:vVhRu:ib:U:r:e:ld:I:D:")) != -1) {
switch(c) {
case 'd':
sscanf(optarg, "%04hx:%04hx",
@@ -207,6 +209,9 @@ int main(int argc, char **argv)
&supported_devices[SUPPORTED_DEVICES-2].product_id);
supported_devices[SUPPORTED_DEVICES-2].name = strdup("user");
break;
+ case 'D':
+ root_device = atoi(optarg);
+ break;
case 'e':
reverseto = optarg;
break;
@@ -262,10 +267,12 @@ int main(int argc, char **argv)
&& (rdflags == -1)
&& (info == 0)
&& (reboot == 0)
- && (usb_mode == -1))
+ && (usb_mode == -1)
+ && (root_device == -1))
{
- printf("Usage: 0xFFFF [-hvVRi] [-e path] [-U 0|1] [-p [piece%]file [-p ...]]\n");
+ printf("Usage: 0xFFFF [-hvVRi] [-e path] [-U 0|1] [-p [piece%%]file [-p ...]]\n");
printf(" [-b boot-args] [-I piece [-I ...]] [-u fiasco-image]\n");
+ printf(" [-D 0|1|2]\n");
return 1;
}
@@ -330,6 +337,9 @@ int main(int argc, char **argv)
}
}
+ if (root_device != -1)
+ set_root_device(root_device);
+
if (usb_mode!=-1)
set_usb_host_mode(usb_mode);