Changeset 1977


Ignore:
Timestamp:
05/16/07 21:47:42 (6 years ago)
Author:
andrew
Message:

Make flash.sh less timing dependent by using correct qemu shutdown. Fix usb-gadget initialisation with no '-usb'.

Location:
trunk/src/host/qemu-neo1973
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/host/qemu-neo1973/openmoko/flash.sh

    r1948 r1977  
    7272# for us to be able to issue u-boot commands. 
    7373# This is also an example of how you *shouldn't* write scripts. 
     74# We should parse the u-boot output for command prompt lines and only 
     75# issue commands when u-boot is awaiting them. 
    7476emu () { 
    7577        $qemu -mtdblock "$script_dir/$flash_image" -kernel "$script_dir/$1" \ 
     
    7880uboot () { 
    7981        cd $src_dir 
    80         emu $1 <<< "$3" 
     82        emu $1 <<< "                                
     83$3 
     84neo1973 power-off 
     85" 
    8186        echo Please wait, programming the NAND flash... 
    82         sleep $2 
    83         kill $pid # Ugly, use the qemu monitor instead 
    84         sleep 1 
    85         kill -9 $pid 
    86         sleep 1 
     87        (sleep $2; kill $pid; sleep 1; kill -KILL $pid)& timer=$! 
     88        if ! wait $pid; then 
     89                kill $timer 
     90                echo 
     91                echo U-boot failed to finish writing in $2 seconds, giving up. 
     92                echo 
     93                exit -1 
     94        fi 
     95        kill $timer 
    8796        cd $script_dir 
    8897} 
    8998 
    9099# Set up BBT, u-boot environment, boot menu and program u-boot binary. 
    91 uboot $uboot_image 40 "                
     100uboot $uboot_image 300 " 
    92101setenv dontask y 
    93102nand createbbt 
     
    104113 
    105114# Program bootsplash. 
    106 uboot splash.gz 10 "                
     115uboot splash.gz 60 " 
    107116nand write.e $kernel_addr splash $splash_size" 
    108117 
    109118# Program the kernel binary. 
    110 uboot $kernel_image 10 "                
     119uboot $kernel_image 60 " 
    111120nand write.e $kernel_addr kernel $kernel_size" 
    112121 
    113122# Program the root filesystem. 
    114 uboot $rootfs_image 20 "                
     123uboot $rootfs_image 120 " 
    115124nand write.jffs2 $kernel_addr rootfs $rootfs_size" 
    116125 
  • trunk/src/host/qemu-neo1973/vl.c

    r1948 r1977  
    43104310    USBPort *port; 
    43114311 
     4312    if (strstart(devname, "gadget", &p)) { 
     4313        dev = usb_gadget; 
     4314        port = host_usb_ports; 
     4315        if (!dev || !port) 
     4316            return -1; 
     4317        if (p[0] == ':') 
     4318            usb_gadget_config_set(port, strtoul(&p[1], NULL, 0)); 
     4319        else if (p[0] != 0) 
     4320            return -1; 
     4321        goto attach; 
     4322    } 
     4323 
    43124324    if (!free_usb_ports) 
    43134325        return -1; 
     
    43264338            return -1; 
    43274339        dev = usb_net_init(&nd_table[nr]); 
    4328     } else if (strstart(devname, "gadget", &p)) { 
    4329         dev = usb_gadget; 
    4330         port = host_usb_ports; 
    4331         if (!dev || !port) 
    4332             return -1; 
    4333         if (p[0] == ':') 
    4334             usb_gadget_config_set(port, strtoul(&p[1], NULL, 0)); 
    4335         else if (p[0] != 0) 
    4336             return -1; 
    4337         goto attach; 
    43384340    } else { 
    43394341        return -1; 
Note: See TracChangeset for help on using the changeset viewer.