1#!/usr/bin/perl 2 3my $dtc_old = "/home/jdl/FSL/dtc/dtc-old"; 4my $dtc_new = "/home/jdl/FSL/dtc/dtc-new"; 5 6my $basic_options = "-b 0 -f -I dts -O dtb"; 7 8my $linux_dts_dir = "/usr/src/linux-2.6/arch/powerpc/boot/dts"; 9 10# Yeah, sure, we could, like, readdir() this instead... 11my @boards = ( 12 "bamboo", 13 "ebony", 14 "ep88xc", 15 "holly", 16 "kilauea", 17 "kuroboxHD", 18 "kuroboxHG", 19 "lite5200", 20 "lite5200b", 21 "mpc7448hpc2", 22 "mpc8272ads", 23 "mpc8313erdb", 24 "mpc832x_mds", 25 "mpc832x_rdb", 26 "mpc8349emitx", 27 "mpc8349emitxgp", 28 "mpc834x_mds", 29 "mpc836x_mds", 30 "mpc8540ads", 31 "mpc8541cds", 32 "mpc8544ds", 33 "mpc8548cds", 34 "mpc8555cds", 35 "mpc8560ads", 36 "mpc8568mds", 37 "mpc8572ds", 38 "mpc8610_hpcd", 39 "mpc8641_hpcn", 40 "mpc866ads", # Feh. Bad node references... 41 "mpc885ads", 42 "pq2fads", 43 "prpmc2800", 44 "ps3", 45 "sequoia", 46 "walnut", 47); 48 49foreach my $board (@boards) { 50 my $dts_file = "$linux_dts_dir/$board.dts"; 51 52 my $old_dtb_file = "/tmp/$board.dtb.old"; 53 my $new_dtb_file = "/tmp/$board.dtb.new"; 54 55 my $cmd_old = "$dtc_old $basic_options -o $old_dtb_file $dts_file"; 56 my $cmd_new = "$dtc_new $basic_options -o $new_dtb_file $dts_file"; 57 my $cmd_cmp = "cmp $old_dtb_file $new_dtb_file"; 58 59 print "------------------------------------------------\n"; 60 print "OLD: $cmd_old\n"; 61 unlink($old_dtb_file) if (-f $old_dtb_file); 62 system("$cmd_old >& /dev/null"); 63 my $status = $?; 64 if ($status) { 65 print " FAILED to run old DTC on $board\n"; 66 } 67 68 print "NEW: $cmd_new\n"; 69 unlink($new_dtb_file) if (-f $new_dtb_file); 70 system("$cmd_new >& /dev/null"); 71 $status = $?; 72 if ($status) { 73 print " FAILED to run new DTC on $board\n"; 74 } 75 76 if (-f $old_dtb_file && -f $new_dtb_file) { 77 print "CMP: $cmd_cmp\n"; 78 system($cmd_cmp); 79 $status = $?; 80 if ($status) { 81 print " FAILED $board\n"; 82 } 83 } else { 84 printf " FAILED: Missing dtb file\n"; 85 } 86} 87