]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Improve uBoot support; add two targets that use uBoot
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 5 Nov 2013 23:44:33 +0000 (00:44 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 5 Nov 2013 23:44:33 +0000 (00:44 +0100)
README.md
novaboot

index 46c9de24a541afb3024623c5dc74dca589d8dff6..13b9b5f90d88c8b24e8c983c3ccf032bec7e41fa 100644 (file)
--- a/README.md
+++ b/README.md
@@ -326,6 +326,11 @@ See __\--serial__. There will be new options soon.
     particular board that we use. It may be subject to changes in the
     future!
 
+- \--uboot-init
+
+    Command(s) to send the uBoot bootloader before loading the images and
+    botting them.
+
 ## Target's output reception phase
 
 - \-s, --serial\[=device\]
index ce6a9d739f3d2c7a20b1834a0a26519855fd00a0..36be97ef4e06c5490fdbc2313f0d8ff1f67b91ac 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -45,6 +45,9 @@ $CFG::qemu = 'qemu -cpu coreduo -smp 2';
     "tud" => '--server=erwin.inf.tu-dresden.de:~sojka/boot/novaboot --rsync-flags="--chmod=Dg+s,ug+w,o-w,+rX --rsync-path=\"umask 002 && rsync\"" --grub --grub-prefix=(nd)/tftpboot/sojka/novaboot --grub-preamble="timeout 0" --concat --iprelay=141.76.48.80:2324 --scriptmod=s/\\\\bhostserial\\\\b/hostserialpci/g',
     "novabox" => '--server=rtime.felk.cvut.cz:/srv/tftp/novaboot --rsync-flags="--chmod=Dg+s,ug+w,o-w,+rX --rsync-path=\"umask 002 && rsync\"" --pulsar --iprelay=147.32.86.92:2324',
     "localhost" => '--scriptmod=s/console=tty[A-Z0-9,]+// --server=/boot/novaboot/$NAME --grub2 --grub-prefix=/boot/novaboot/$NAME --grub2-prolog="  set root=\'(hd0,msdos1)\'"',
+    "ryuglab" => '--server=pc-sojkam.felk.cvut.cz:/srv/tftp --uboot --uboot-init="mw f0000b00 \${psc_cfg}" --remote-cmd="ssh pc-sojkam.felk.cvut.cz \"cu -l /dev/ttyUSB0 -s 115200\"" --reset-cmd="ssh pc-sojkam.felk.cvut.cz \"dtrrts /dev/ttyUSB0 1 1\""',
+    "ryulocal" => '--dhcp-tftp --serial --uboot --uboot-init="dhcp; mw f0000b00 \${psc_cfg}" --reset-cmd="dtrrts $serial 0 1; sleep 0.1; dtrrts $serial 1 1"',
+
     );
 $CFG::scons = "scons -j2";
 
@@ -135,6 +138,7 @@ my %opt_spec;
                              exists $CFG::targets{$opt_value} or die("Unknown target '$opt_value' (valid targets are: ".join(", ", sort keys(%CFG::targets)).")");
                              GetOptionsFromString($CFG::targets{$opt_value}, %opt_spec); },
     "uboot"         => \$uboot,
+    "uboot-init=s"   => \$uboot_init,
     "h"             => \$help,
     "help"          => \$man,
     );
@@ -689,11 +693,10 @@ if (defined $uboot) {
     print "novaboot: Waiting for uBoot prompt...\n";
     $exp->log_stdout(1);
     $exp->expect(20,
-                [qr/Hit any key to stop autoboot:/, sub { $exp->send('.'); exp_continue; }],
+                [qr/Hit any key to stop autoboot:/, sub { $exp->send("\n"); exp_continue; }],
                 '=> ') || die "No uBoot prompt deteceted";
-
-    $exp->send("dhcp\n");
-    $exp->expect(1, '=> ');
+    $exp->send("$uboot_init\n") if $uboot_init;
+    $exp->expect(10, '=> ') || die "uBoot prompt timeout";
 
     my ($kbin, $kcmd) = split(' ', shift(@$modules), 2);
     my $dtb;
@@ -704,29 +707,28 @@ if (defined $uboot) {
     my $initrd_addr = '-';
     my $dtb_addr = '';
 
-    sleep(1);
     $exp->send("tftp $kern_addr $kbin\n");
-    $exp->expect(1,
+    $exp->expect(10,
                 [qr/#/, sub { exp_continue; }],
                 '=> ') || die "Kernel load failed";
     if (defined $dtb) {
        $dtb_addr = '7f0000';
        $exp->send("tftp $dtb_addr $dtb\n");
-       $exp->expect(1,
+       $exp->expect(10,
                     [qr/#/, sub { exp_continue; }],
                     '=> ') || die "Device tree load failed";
     }
     if (defined $initrd) {
        $initrd_addr = 'b00000';
        $exp->send("tftp $initrd_addr $initrd\n");
-       $exp->expect(1,
+       $exp->expect(10,
                     [qr/#/, sub { exp_continue; }],
                     '=> ') || die "Initrd load failed";
     }
-    $exp->send("mw f0000b00 \${psc_cfg}\n");
     $exp->send("set bootargs $kcmd\n");
-    $exp->expect(1, '=> ');
+    $exp->expect(1, '=> ')  || die "uBoot prompt timeout";
     $exp->send("bootm $kern_addr $initrd_addr $dtb_addr\n");
+    $exp->expect(1, "\n")  || die "uBoot command timeout";
 }
 
 if (defined $exp) {
@@ -1125,6 +1127,11 @@ novaboot script. Implementation of this option is currently tied to a
 particular board that we use. It may be subject to changes in the
 future!
 
+=item --uboot-init
+
+Command(s) to send the uBoot bootloader before loading the images and
+botting them.
+
 =back
 
 =head2 Target's output reception phase