# This is an ide startup file.
report=4 # set verbose, but not debug
$stoponerr=1
hinv -v

gioslot {
	$tmp = mg_setboard 0;
	if ($tmp) {
		echo "Found boards in slot 0"
	}
	else {
		$tmp = mg_setboard 1;
		if ($tmp) {
			echo "Found boards in slot 1"
		}
		else {
			echo "No boards found in slot 0 or slot 1"
		}
	}
}

enabdisp {
mg_pokexmap -r XMAP_DIB_CTRL0 -d 0x100
}

m2 {
	$tmp=khlow
	if($tmp) {
		echo "Failure detected in Knaizuk Hartmann Low Test\n"
		$failed=1;
		wait;
	}
	$tmp=memtest2 3
	if($tmp) {
		echo "Failure detected in Knaizuk Hartmann Test\n"
		$failed=1;
		wait;
	}	
	$tmp=memtest2 5
	if($tmp) {
		echo "Failure detected in Knaizuk Hartmann Parity  Test\n"
		$failed=1;
		wait;
	}	
	$tmp=memtest2 10
	if($tmp) {
		echo "Failure detected in Threebit Memory Test\n"
		$failed=1;
		wait;
	}	
	$tmp=memtest2 12
	if($tmp) {
		echo "Failure detected in Knaizuk Hartmann Doubleword Test\n"
		$failed=1;
		wait;
	}	
	$tmp=memtest2 11
	if($tmp) {
		echo "Failure detected in Butterfly Test\n"
		$failed=1;
		wait;
	}	
	$tmp=memtest2 8
	if($tmp) {
		echo "Failure detected in March X Test\n"
		$failed=1;
		wait;
	}	
	$tmp=memtest2 9
	if($tmp) {
		echo "Failure detected in March Y Test\n"
		$failed=1;
		wait;
	}	
	$tmp=ldram
	if($tmp) {
		echo "Failure detected in ldram test\n"
		$failed=1;
		wait;
	}	
}

memory {
	echo "----------------------------------------------------\n"
	if(dcache1){
		echo "Failure detected in dcache1 test\n"
		$failed=1;
		wait;
	}
	
	echo "----------------------------------------------------\n"
	
	$tmp=icache1
	if($tmp) {
		echo "Failure detected in icache1 test\n"
		$failed=1;
		wait;
	}
	
	echo "----------------------------------------------------\n"
	
	$tmp=icache2
	if($tmp) {
		echo "Failure detected in icache2 test\n"
		$failed=1;
		wait;
	}

	echo "----------------------------------------------------\n"

	$tmp=scache1
	if($tmp) {
		echo "Failure detected in scache1 test\n"
		$failed=1;
		wait;
	}	
	echo "----------------------------------------------------\n"

	$tmp=memtest
	if($tmp) {
		echo "Failure detected in memtest test\n"
		$failed=1;
		wait;
	}	
	echo "----------------------------------------------------\n"

	$tmp=m2
	if($tmp) {
		echo "Failure detected in additional memory tests\n"
		$failed=1;
		wait;
	}	
	echo "----------------------------------------------------\n"

	$tmp=ldram 0xa8800000
	if($tmp) {
		echo "Failure detected in ldram test\n"
		$failed=1;
		wait;
	}	
	echo "----------------------------------------------------\n"

	$tmp=ldram -p
	if($tmp) {
		echo "Failure detected in ldram with parity test\n"
		$failed=1;
		wait;
	}	
	$tmp=dram
	if($tmp) {
		echo "Failure detected in dram test\n"
		$failed=1;
		wait;
	}	
	echo "----------------------------------------------------\n"

	$tmp=dram -p
	if($tmp) {
		echo "Failure detected in dram with parity test\n"
		$failed=1;
		wait;
	}	
}

cpusc {
	echo "Checking for R4600sc\n"
        if (is_r4600sc) {
		echo "R4600sc found!!!";
		if(sc_on){
		  	$failed=1;
			wait;
        	}
		if(sc_hit){
			$failed=1;
			wait;
		}
		if(sc_miss){
		  $failed=1;
		  wait;
        	}
        	if(sc_hit_miss){
	  	  $failed=1;
		  wait;
        	}
        	if(sc_tag){
                  $failed=1
		  wait;
        	}
		if(sc_off){
			$failed=1
		}

        }
	else
		{
			echo "R4600sc not found!!!";

			echo "----------------------------------------------------\n"
			if(tlb){
				$failed=1;
				wait;
			}
	
			echo "----------------------------------------------------\n"
			if(utlb){
				$failed=1;
				wait;
			}
	fi
	}

	echo "----------------------------------------------------\n"
	if(dcache1){
		echo "Failure detected in dcache1 test\n"
		$failed=1;
		wait;
	}
	
	echo "----------------------------------------------------\n"
	
	$tmp=icache1
	if($tmp) {
		echo "Failure detected in icache1 test\n"
		$failed=1;
		wait;
	}
	
	echo "----------------------------------------------------\n"
	
	$tmp=icache2
	if($tmp) {
		echo "Failure detected in icache2 test\n"
		$failed=1;
		wait;
	}

	echo "----------------------------------------------------\n"

	$tmp=scache1
	if($tmp) {
		echo "Failure detected in scache1 test\n"
		$failed=1;
		wait;
	}	
	$tmp=scache2
	if($tmp) {
		echo "Failure detected in scache2 test\n"
		$failed=1;
		wait;
	}	

	echo "----------------------------------------------------\n"
	if(fpu) {
		$failed=1;
		wait;
	}
	echo "----------------------------------------------------\n"

	if ($failed) {
		echo "CPU CARD TEST FAILED";
		wait;
		$cpufailed=1;
		} 
		else
		{ 
			echo "CPU CARD TEST PASSED";
		}
	fi

}

a2test {
	$loopcount = 0;
	report =4;
	$a2tst0pass = 0;
	$a2tst0fail = 0;
	$a2tst1pass = 0;
	$a2tst1fail = 0;
	$a2tst2pass = 0;
	$a2tst2fail = 0;
	$a2tst3pass = 0;
	$a2tst3fail = 0;
	$a2tst4pass = 0;
	$a2tst4fail = 0;
	$a2tst5pass = 0;
	$a2tst5fail = 0;
	$a2tst6pass = 0;
	$a2tst6fail = 0;
	$a2tst7pass = 0;
	$a2tst7fail = 0;
	while ( $loopcount < 3 ) {
		echo ""
		echo "----------------------------------------------------"
		echo "Starting audio test loop" $loopcount
		echo "----------------------------------------------------\n"

		$a2tst = audio -t0
		if($a2tst) {
			$a2tst0fail = $a2tst0fail + 1;
			$failed = 1;
		}
		else {
			$a2tst0pass = $a2tst0pass + 1;
		}
		a2tst = audio -t1
		if($a2tst) {
			$a2tst1fail = $a2tst1fail + 1;
			$failed = 1;
		}
		else {
			$a2tst1pass = $a2tst1pass + 1;
		}
		a2tst = audio -t2
		if($a2tst) {
			$a2tst2fail = $a2tst2fail + 1;
			$failed = 1;
		}
		else {
			$a2tst2pass = $a2tst2pass + 1;
		}
		a2tst = audio -t3
		if($a2tst) 
			$a2tst3fail = $a2tst3fail + 1;
		else
			$a2tst3pass = $a2tst3pass + 1;
		a2tst = audio -t4
		if($a2tst)
			$a2tst4fail = $a2tst4fail + 1;
		else
			$a2tst4pass = $a2tst4pass + 1;
		a2tst = audio -t5
		if($a2tst) {
			$a2tst5fail = $a2tst5fail + 1;
			$failed = 1;
		}
		else {
			$a2tst5pass = $a2tst5pass + 1;
		}
		a2tst = audio -t6
		if($a2tst) {
			$a2tst6fail = $a2tst6fail + 1;
			$failed = 1;
		}
		else {
			$a2tst6pass = $a2tst6pass + 1;
		}
		a2tst = audio -t7
		if($a2tst) 
			$a2tst7fail = $a2tst7fail + 1;
		else
			$a2tst7pass = $a2tst7pass + 1;

		$loopcount = $loopcount + 1;
	}
	echo "audio test 0: 	Pass =" $a2tst0pass"	fail =" $a2tst0fail
	echo "audio test 1: 	Pass =" $a2tst1pass"	fail =" $a2tst1fail
	echo "audio test 2: 	Pass =" $a2tst2pass"	fail =" $a2tst2fail
	echo "audio test 3: 	Pass =" $a2tst3pass"	fail =" $a2tst3fail
	echo "audio test 4: 	Pass =" $a2tst4pass"	fail =" $a2tst4fail
	echo "audio test 5: 	Pass =" $a2tst5pass"	fail =" $a2tst5fail
	echo "audio test 6: 	Pass =" $a2tst6pass"	fail =" $a2tst6fail
	echo "audio test 7: 	Pass =" $a2tst7pass"	fail =" $a2tst7fail
	wait;

	if( $a2tst7pass == 0 ) {
		# Rerun audio -t7 ten more times to get it to pass
		echo "Audio test 7 failed three loops."
		echo "Press ENTER to run audio test 7 for 10 more loops"
		wait;
		$report=1
		$loopcount = 0;
		while ( $loopcount < 10 ) {
			a2tst = audio -t7
			if($a2tst) {
				$a2tst7fail = $a2tst7fail + 1;
			}
			else {
				$a2tst7pass = $a2tst7pass + 1;
				$loopcount = 10
			}
			$loopcount = $loopcount + 1;
		}
		if( $a2tst7pass == 0 ) {
			echo "Audio test 7 FAILED."
			echo "Reject this system with an Audio failure"
			$failed = 1;
		}
	}
}
unix {
	echo "<<<< About to to boot UNIX......>>>>"
	boot dksc(0,1,0)unix;
     }
pm1 {

	echo "----------------------------------------------------\n"
	if(tlb){
		$failed=1;
	}
	
	echo "----------------------------------------------------\n"
	if(utlb){
		$failed=1;
	}

	echo "----------------------------------------------------\n"
	if(dcache1){
		echo "Failure detected in dcache1 test\n"
		$failed=1;
	}
	
	echo "----------------------------------------------------\n"
	
	$tmp=icache1
	if($tmp) {
		echo "Failure detected in icache1 test\n"
		$failed=1;
	}
	
	echo "----------------------------------------------------\n"
	
	$tmp=icache2
	if($tmp) {
		echo "Failure detected in icache2 test\n"
		$failed=1;
	}

	echo "----------------------------------------------------\n"

	$tmp=scache1
	if($tmp) {
		echo "Failure detected in scache1 test\n"
		$failed=1;
	}	

	echo "----------------------------------------------------\n"

	if(hpc3) {
		$failed=1;
	}
	echo "----------------------------------------------------\n"
	if(fpu) {
		$failed=1;
	}

}
ip {
	$tmp = 0;
	echo "----------------------------------------------------\n"

	if(int2) {
		$failed=1;
	}
	if ($skip_timer !=1) {
		echo "----------------------------------------------------\n"
		if(clock) {
			$failed=1;
		}
	}

	echo "----------------------------------------------------\n"

#	$tmp = memtest  0xa8800000:0xa9000000
	$tmp = memtest
	if ($tmp) {
		$failed=1;
		if ($volts == 0) {
			boot -f bootp()mem_vlo.failed;
		}
		else if ($volts == 2) {
			boot -f bootp()mem_vhi.failed;
		}
	}
	else
	{
		boot -f bootp()memtest.pass;
	}
	
	
#	if ($dram_needed) {
#	  echo "----------------------------------------------------\n"
#	  echo  "PLEASE WAIT ... "
#	
#	  $tmp = dram -p 0xa8800000#2M;
#	  if($tmp) {
#		$failed=1;
#	  }
#	}	
	echo "----------------------------------------------------\n"
	# it takes about 3 minutes
	echo  "PLEASE WAIT ... THE FOLLOWING TEST TAKES ABOUT 1 1/2 MINUTES"
	
	$tmp = ldram -p;
	
	if($tmp){
		$failed=1;
	}
	# illegal i3 e1 e2
	
	# Run new SIMM tests
	echo "----------------------------------------------------\n"
	$tmp = m2;
	if($tmp) {
		echo "Failure detected in extra kh memory tests\n"
		$failed=1;
		if ($volts == 0) {
			boot -f bootp()khmem_vlo.failed;
		}
		else if ($volts == 2) {
			boot -f bootp()khmem_vhi.failed;
		}
	}

	boot -f bootp()khmem.passed;

# Duart External tests turned off and internal tests turned on  rwaits 9/23/92
# originally -i0, -i1 on -i2 off, -e0 off -e2, -e3 on
	echo "----------------------------------------------------\n"
	$tmp=duart -i0;
	
	if($tmp) {
		$failed=1;
	}
	
	$tmp= duart -i1;
	
	if($tmp) {
		$failed=1;
	}
	
	
	echo "----------------------------------------------------\n"
	
	$tmp = led 0;
	
	if($tmp){
		$failed=1;
	}
	
	$tmp = led 1;
	
	if($tmp){
		$failed=1;
	}
	
	echo "----------------------------------------------------\n"
	
	if (parity) {
		$failed=1;
		if ($volts == 0) {
			boot -f bootp()parity_vlo.failed;
		}
		else if ($volts == 2) {
			boot -f bootp()parity_vhi.failed;
		}
	}
	else
	{
		boot -f bootp()parity.pass;
	}
	
	echo "----------------------------------------------------\n"
	$status1 = scsi;
	if($status1) {
		$failed=1;
	}
	
	if ($skip_timer != 1) {
		echo "----------------------------------------------------\n"
		if(timer){
		$failed=1;
		}
 	}	
	echo "----------------------------------------------------\n"
	if ($skip_eisa != 1) {
	    if(eisa){
		$failed=1;
	    }
	}
	else {
	    echo "Skipping EIU/EISA interface test"
	}

}	
ip22 {
        $skip_eisa = 0;
	$failed = 0;
	$pm1_failed = 0;

	pm1;

	if($failed) {
		if ($volts == 0) {
			boot -f bootp()pm1_vlo.failed;
		}
		else if ($volts == 2) {
			boot -f bootp()pm1_vhi.failed;
		}
		$pm1_failed = 1;
	}
	else {
		boot -f bootp()pm1.pass;
	}

	cpusc;
	boot -f bootp()cpu.done;

	ip;
	boot -f bootp()ip.done;

	echo "----------------------------------------------------\n"

	
	if($failed) {
		echo "FAILURES DETECTED IN IP22\n"
		$cpu_failed=1;
		if ($pm1_failed == 0) {
			if ($volts == 0) {
				boot -f bootp()ip_vlo.failed;
			}
			else if ($volts == 2) {
				boot -f bootp()ip_vhi.failed;
			}
		}

		wait;
		}
	else
		{
		$cpu_failed=0;
		echo "ALL TESTS IN IP22 PASSED\n";
	}
	fi
}

ip22va {

        $skip_eisa = 0;
	$failed =0;
	echo "\n*****************************\n"
	echo "Voltage changed to 4.75V\n"
	echo "\n*****************************\n"
	chg_volt 0;
	ide_delay -s 15;
        pm1;
	echo "\n*****************************\n"
	echo "Voltage changed to 5.25V\n"
	echo "\n*****************************\n"
	chg_volt 1;
	ide_delay -s 15;
	chg_volt 2;
	ide_delay -s 15;
	cpusc;
	echo "\n*****************************\n"
	echo "Voltage changed to 5.0 V\n"
	echo "\n*****************************\n"
	chg_volt 1;
	ide_delay -s 15;
	
	ip;

	echo "----------------------------------------------------\n"

	
	if($failed) {
		echo "FAILURES DETECTED IN IP22\n"
		$cpu_failed=1;
		}
	else
		{
		$cpu_failed=0;
		echo "ALL TESTS IN IP22 PASSED\n";
		boot dksc(0,1,0)unix;
	}
	fi
}
ip22s {
	
        $skip_eisa = 1;
        ip22
}

a2testva {
	chg_volt 0;
	ide_delay -s 15;
	a2test;
	chg_volt 1;
	ide_delay -s 15;
	chg_volt 2;
	ide_delay -s 15;
	a2test;
	chg_volt 1;
	ide_delay -s 15;
}


# Start of GR2 diagnostics 
# Initialize variables used by GR2.
$stride_failed=0 ;
$zb_failed=0 ;
$gr2_failed=0;
$chkbt457_failed=0;
$bp_failed=0;
$shramre3_failed=0;
$cpushram_failed=0;
$cpure3_failed=0;
$ctxsw_failed=0;
$vdma_failed=0;
$quad_failed=0;
$fourquad_failed=0;
$mon=0;

$test_xmap_failed = 0;
$test_xmap_clut_failed = 0;

gr2_vhwinit {
	gr2_videoclk 0x47
	if ($mon ==1 ) gr2_initclock 0x132;
	else gr2_initclock 0x107;
	fi
	gr2_wrconfig 0x0
	gr2_delay 3
	gr2_wrconfig 0x1
	gr2_vinitdac
}

gr2_initre {
	$a = gr2_getGR2ver;
	if ($a < 4) gr2_wrfifo 0 0;
	else if ($a == 4) gr2_wrfifo 0 1;
	else gr2_wrfifo 0 2;
}

gr2_initsys {
	gr2_reset
	gr2_vhwinit
	$mon = gr2_getMonType;
	if ($mon == 1) gr2_initvc1 4;
	else gr2_initvc1 20;
	fi
	gr2_xcol
	gr2_inithq
	gr2_load_ucode ge
	gr2_load_ucode hq
	gr2_unstall
	gr2_initre
}

clear {
	gr2_wrfifo 35 0
	gr2_wrfifo 6 0
}

gr2_quad {
	gr2_wrfifo 33 0
}

gr2_fourquad {
	gr2_wrfifo 34 0
}

test_xmap {
	gr2_initsys;
	$a=gr2_txmap;
	return $a;
}

test_xmap_clut {
	gr2_initsys;
	$a=gr2_txmap_clut;
	return $a;
}

gr2_vdma {
	gr2_initsys;
	$b=gr2_cachefdma 32 1;
	$b=$b+gr2_cachefdma 256 1;
	$b=$b+gr2_cachefdma 512 1;
	$b=$b+gr2_cachefdma 128 1;
	$b=$b+gr2_yzoomdma ;
	$b=$b+gr2_yzoomdma 32 32;
	$b=$b+gr2_yzoomdma 128 128;
	$b=$b+gr2_yzoomdma 256 256;
	$b=$b+gr2_stridedma;
	$b=$b+gr2_stridedma 32 32;
	$b=$b+gr2_stridedma 256 1;
	$b=$b+gr2_stridedma 512 0;

	return $b;
}

gr2 {
# Too verbose with report=4
	report=3;

	$stride_failed=0 ;
	$zb_failed=0 ;
	$gr2_failed=0;
	$chkbt457_failed=0;
	$bp_failed=0;
	$shramre3_failed=0;
	$cpushram_failed=0;
	$cpure3_failed=0;
	$ctxsw_failed=0;
	$vdma_failed=0;
	$quad_failed=0;
	$fourquad_failed=0;

	$test_xmap_failed = 0;
	$test_xmap_clut_failed = 0;

	gr2_reset;
	buffon


# HQ2 internal register 19  must read 0xdeadbeef
	report = 2;
	gr2_rdhqint 19;
	report = 1;

# Test VC1 SRAM 
	gr2_vhwinit
	report =3 
	if (gr2_vc1_sram) {
		echo "VC1 SRAM test failed";
		resetcons;
		buffoff;
		$err = 1;
	}
# Test ram 0 at Ge7 at 0
	$tmp = gr2_tram 0;
	if ($tmp) {
		echo "GE7 at 0 RAM0 test failed"
		resetcons;
		buffoff;
		$err = 1;
	}
# Test ram 0 at Ge7 at 1
	$tmp = gr2_tram 1;
	if ($tmp) {
		echo "GE7 at 1 RAM0 test failed"
		resetcons;
		buffoff;
		$err = 1;
	}
# Test ram 0 at Ge7 at 2
	$tmp = gr2_tram 2;
	if ($tmp) {
		echo "GE7 at 2 RAM0 test failed"
		resetcons;
		buffoff;
		$err = 1;
	}
# Test ram 0 at Ge7 at 3
	$tmp = gr2_tram 3 ;
	if ($tmp) {
		echo "GE7 at 3 RAM0 test failed"
		resetcons;
		buffoff;
		$err = 1;
	}
# Test ram 0 at Ge7 at 4
	$tmp = gr2_tram 4 ;
	if ($tmp) {
		echo "GE7 at 4 RAM0 test failed"
		resetcons;
		buffoff;
		$err = 1;
	}
# Test ram 0 at Ge7 at 5
	$tmp = gr2_tram 5 ;
	if ($tmp) {
		echo "GE7 at 5 RAM0 test failed"
		resetcons;
		buffoff;
		$err = 1;
	}
# Test ram 0 at Ge7 at 6
	$tmp = gr2_tram 6 ;
	if ($tmp) {
		echo "GE7 at 6 RAM0 test failed"
		resetcons;
		buffoff;
		$err = 1;
	}
# Test ram 0 at Ge7 at 7
	$tmp = gr2_tram 7 ;
	if ($tmp) {
		echo "GE7 at 7 RAM0 test failed"
		resetcons;
		buffoff;
		$err = 1;
	}
# Test shram  
	$tmp = gr2_tram 8 ;
	if ($tmp) {
		echo "Share ram test failed "; 
		resetcons;
		buffoff;
		$err = 1;
	}
# Test Hq2uram
	$tmp = gr2_tram 9 ;
	if ($tmp) {
		echo "HQ2 uram test failed "; 
		resetcons;
		buffoff;
	    	$err = 1;
	}
# Test ge7uram
	$tmp = gr2_tram 10;
	if ($tmp) {
		echo "GE7 uram test failed "; 
		resetcons;
		buffoff;
	    	$err = 1;
	}
	gr2_initsys;
	clear;

# Test HQ2
	if(gr2_hq2test) {
		echo "HQ2 test failed "; 
		resetcons;
		buffoff;
	    	$err = 1;
	}
# Test shareram using Ucode
	if (gr2_shram) {
		echo "Shram test failed"
		resetcons;
		buffoff;
	    	$err = 1;
	}
# Test internal GE7 ram
	if (gr2_ram12) {
		echo "GE7 internal test failed"
		resetcons;
		buffoff;
	    	$err = 1;
	}
# Test seedrom 
	if (gr2_seedrom) {
		echo "GE7 seedrom test failed"
		resetcons;
		buffoff;
	    	$err = 1;
	}
# Test the squaroot rom
	if (gr2_sqrom) { 
		echo "GE7 sqrom test failed"
		resetcons;
		buffoff;
	    	$err = 1;
	}
	gr2_initsys ;

# Test Ge 7 bus
	if (gr2_gebus) {
		echo "GE7 bus test failed"
		resetcons;
		buffoff;
	    	$err = 1;
	}

# Test ge floating point unit
	if (gr2_gefloat) {
		echo "GE7 floating point test failed"
		resetcons;
		buffoff;
	    	$err = 1;
	}
	gr2_initsys;
	clear;

	if ( $err ) {
		echo "HQ & GE Tests failed\n";
		resetcons;
		buffoff;
		if ($volts == 0) {
			boot -f bootp()gr2_hq_vlo.failed;
		}
		else if ($volts == 2) {
			boot -f bootp()gr2_hq_vhi.failed;
		}	
		$err=0
		$gr2_failed=1
	}
	else {
		resetcons;
		buffoff;
		echo "HQ & GE Tests passed\n"
		if ($volts == 0) {
			boot -f bootp()gr2_hq_vlo.pass;
		}
		else if ($volts == 2) {
			boot -f bootp()gr2_hq_vhi.pass;
		}	
	}
	buffon

# Test bt457 
	if (gr2_chkbt457) {
		resetcons;
		buffoff;
	    	$chkbt457_failed = 1;
	    	$err=1;
	}
# Test bitplane VM2
	gr2_initsys
	if (gr2_bp) {
		$bp_failed = 1;
		$err=1;
		resetcons;
		buffoff;
	}
# Test Shared ram and Re
	gr2_initsys
	$tmp = gr2_shramre3
	if ($tmp) {
		resetcons;
		buffoff;
	    	$shramre3_failed =1;
	    	$err=1;
	}
# Test DMA between host and GE7 shared ram
	gr2_initsys
	clear
	$tmp = gr2_cpushram
	if ($tmp) {
		resetcons;
		buffoff;
	    	$cpushram_failed =1;
	    	$err=1;
	}
# Test DMA between host and and RE3
	resetcons
	buffon
	gr2_initsys
	$tmp = gr2_cpure3
	if ($tmp) {
		resetcons;
		buffoff;
	    	$cpure3_failed =1;
	    	$err=1;
	}
# Test GE7 context switching
	if(gr2_ctxsw) {
		resetcons;
		buffoff;
		$ctxsw_failed =1;
		$err=1;
	}
	clear;
# Test quad drawing
	$tmp = gr2_quad
	if ($tmp) {
		resetcons;
		buffoff;
	    	$quad_failed =1;
	    	$err=1;
	}
	$tmp = gr2_fourquad
	if ($tmp){
		resetcons;
		buffoff;
	    	$fourquad_failed = 1;
	    	$err=1;
	}
	clear;
	if ($chkbt457_failed) echo "Bt457 test failed";
	if ($bp_failed)  echo "bitplane test failed";
	if ($shramre3_failed) echo "shramre3 test failed"
	if ($cpushram_failed) echo "CPU shram test failed";
	if ($cpure3_failed) echo "cpure3 test failed ";
	if ($ctxsw_failed) echo "context switching test failed ";
	if ($vdma_failed) echo "vdma controller test failed ";
	if ($quad_failed) echo "quad test failed";
	if ($fourquad_failed) echo "fourquad test failed";

	if ($err)
	{
	    if (!$report) {
		emfail 2;
		exit;
	    }	
	    echo "******  PRESS RETURN TO CONTINUE OR ^C TO EXIT ************"
	    $err=0
	    $gr2_failed=1
	    resetcons;
	    buffoff
	}
	else {
	    resetcons;
	    buffoff;
	    echo "BT457, Bit-Plane, DMA and QUADs Tests Passed.\n"
	}
	buffon

# Test stridedma between shram and re3
	gr2_initsys
	$tmp = gr2_stride
	if ($tmp)  {
	    $stride_failed =1 ;
	    $err=1;
	    resetcons;
	    buffoff;
	}
# Test Zbuffer
	gr2_initsys
	$tmp=gr2_zb
	if($tmp)  {
	    $zb_failed =1;
	    $err=1;
	    resetcons;
	    buffoff;
	}
	resetcons
	buffoff
	echo "************************* RESULTS ********************************"
	if ($stride_failed)  {
	    echo "stride test failed";
	    $gr2_failed = 1;
	}
	if ($zb_failed) { 
	    echo "Zbuffer test failed";
	    $gr2_failed = 1;
	}
	if (!$gr2_failed) echo "Stride DMA, and Z-Buffer Test Passed.\n"
# Test Xmap 
	buffon
	echo "testing XMAP"
	if (test_xmap) {
	    $test_xmap_failed =1;
	    $err=1;
	    resetcons;
	    buffoff;
	}
#Test Xmap CLUT 
	if (test_xmap_clut) {
	    $test_xmap_clut_failed =1;
	    $err=1;
	    resetcons;
	    buffoff;
	}
	resetcons
	buffoff
	echo "************************* RESULTS ********************************"
	if ($test_xmap_failed) {
	    echo "test_xmap test failed";
	    $gr2_failed = 1;
	}
	if ($test_xmap_clut_failed) {
	    echo "test_xmap_clut test failed";
	    $gr2_failed = 1;
	}
	if (!$err) echo "XMAPs Test Passed.\n"
	if ($gr2_failed) {
	    echo "ERROR: Failure detected on graphics board."
	}
	else echo "graphics board tests passed"
	fi
	echo " *****************END OF THE TEST *****************"

	# Restore verbosity
	report=4
}

gr2_all {
        $tmp = gr2_setboard 0;
        if ($tmp) {
			
		echo "Testing gr3/gu1 in slot 0."
                gr2;
        	if ($gr2_failed) {
			echo "ERROR: Failure detected on gr3/gu1 in slot 0."
			if ($volts == 0) {
				boot -f bootp()gr2_0_vlo.failed;
			}
			else if ($volts == 2) {
				boot -f bootp()gr2_0_vhi.failed;
			}
			wait;
		}
		else
		{
			boot -f bootp()gr2_0.pass;
		}
        }

        $tmp = gr2_setboard 1;
        if ($tmp) {
		echo "Testing gr3/gu1 in slot 1."
                gr2;
	        if ($gr2_failed) {
			echo "ERROR: Failure detected on gr3/gu1 in slot 1."
			if ($volts == 0) {
				boot -f bootp()gr2_1_vlo.failed;
			}
			else if ($volts == 2) {
				boot -f bootp()gr2_1_vhi.failed;
			}
			wait;
		}
		else
		{
			boot -f bootp()gr2_1.pass;
		}
        }
}
# END OF GR2 SUPPORT

# Initialize variables used by ng1.
$err=0
$ng1failed=0
$ng1_rex3_failed=0
$ng1_bt445_failed=0
$ng1_cmap_failed=0
$ng1_xmap9_failed=0
$ng1_vc2_failed=0
$ng1_vram_failed=0
$ng1_cid_failed=0
$ng1_dma_failed=0
$ng1_dma_result=-1

# Start of NG1 diagnostics 

ng1_script {
	$ng1failed=0;
	$err=0;
	buffon

# Test Rex3
	if(ng1_rexregs) {
		if (!$report) {
			emfail 2;
			exit;
		}
		$ng1_rex3_failed = 1;
		$err=1;
	}
# Test bt445
	if(ng1_bt445test) {
		if (!$report) {
			emfail 2;
			exit;
		}
		$ng1_bt445_failed =1;
		$err=1;
	}
# Test cmap
	if(ng1_cmaptest) {
		if (!$report) {
			emfail 2;
			exit;
		}
		$ng1_cmap_failed = 1;
		$err=1;
	}
# Test Xmap9
	if(ng1_xmap9test) {
		if (!$report) {
			emfail 2;
			exit;
		}
		$ng1_xmap9_failed = 1;
		$err=1;
	}
# Test VC2 
	if(ng1_vc2test) {
		if (!$report) {
			emfail 2;
			exit;
		}
		$ng1_vc2_failed = 1;
		$err=1;
	}
# Test VRAM
	if(ng1_vram) {
		 if (!$report) {
			emfail 2;
			exit;
		}
		$ng1_vram_failed = 1;
		$err=1;
	}
# Test CID
	if(ng1_cid) {
		if (!$report) {
			emfail 2;
			exit;
		}
		$ng1_cid_failed = 1;
		$err=1;
	}
# Change Bus width to 64 & run DMA tests
	ng1_setvisual 0;
	ng1_color 0;
	ng1_block 0 0 105 105;
	ng1_buswidth 64;
	ng1_rwpacked 1;
	ng1_rwdouble 1;
	$ng1_dma_result=ng1_dmatest 0 0 100 100;
	if($ng1_dma_result == -1) {
		if (!$report) {
			emfail 2;
			exit;
		}
		$ng1_dma_failed = 1;
		$err=1;
	}
	ng1_buswidth 32;
	resetcons
	buffoff
	echo "************************* RESULTS ******************************"

	if($ng1_rex3_failed) {
		echo "Rex3 Register r/w tests failed.";
		$ng1failed = 1;
	}
	if($ng1_cmap_failed) {
		echo "Cmap r/w tests failed.";
		$ng1failed = 1;
	}
	if($ng1_xmap9_failed) {
		echo "Xmap9 r/w tests failed.";
		$ng1failed = 1;
	}
	if($ng1_vc2_failed) {
		echo "VC2 r/w tests failed.";
		$ng1failed = 1;
	}
	if($ng1_vram_failed) {
		echo "VRAM test failed.";
		$ng1failed = 1;
	}
	if($ng1_cid_failed) {
		echo "CID test failed.";
		$ng1failed = 1;
	}
	if($ng1_dma_failed) {
		echo "DMA tests failed.";
		$ng1failed = 1;
	}

	if (!$err) echo "REX3, CMAP, XMAP9, VC2, VRAM, CID & DMA Test Passed.\n"
	if ($ng1failed) echo "ERROR: Failure detected on NG1 graphics board."
	else echo "NG1 graphics board tests passed"
	fi
	echo " *****************END OF THE TEST *****************"
}

ng1 {
# test board 0 only (mostly for Indy)
	ng1_probe;
	$tmp = ng1_setboard 0;
	if ($tmp)
		ng1_script;
}

ng1_all {
        $tmp = ng1_setboard 0;
        if ($tmp) {
		echo "Testing NG1/LG3 in slot 0."
                ng1_script;
        	if ($ng1failed) {
			echo "ERROR: Failure detected on gfx in slot 0."
			if ($volts == 0) {
				boot -f bootp()ng1_0_vlo.failed;
			}
			else if ($volts == 2) {
				boot -f bootp()ng1_0_vhi.failed;
			}
			wait;
		}
		else
		{
			boot -f bootp()ng1_0.pass;
		}
        }

        $tmp = ng1_setboard 1;
        if ($tmp) {
		echo "Testing NG1/LG3 in slot 1."
                ng1_script;
	        if ($ng1failed) {
			echo "ERROR: Failure detected on gfx in slot 1."
			if ($volts == 0) {
				boot -f bootp()ng1_1_vlo.failed;
			}
			else if ($volts == 2) {
				boot -f bootp()ng1_1_vhi.failed;
			}
			wait;
		}
		else
		{
			boot -f bootp()ng1_1.pass;
		}
        }
}

# END OF NG1

ng1va {

	echo "\n*****************************\n"
	echo "Voltage changed to 4.75V\n"
	echo "\n*****************************\n"
	chg_volt 0;
	ide_delay -s 15;
	ng1_all;
	echo "\n*****************************\n"
	echo "Voltage changed to 5.25V\n"
	echo "\n*****************************\n"
	chg_volt 1;
	ide_delay -s 15;
	chg_volt 2;
	ide_delay -s 15;
	ng1_all;
	echo "\n*****************************\n"
	echo "Voltage set back to 5.0V\n"
	echo "\n*****************************\n"
	chg_volt 1;
	ide_delay -s 15;
}

# END OF NG1VA


# START OF MGRAS TESTS

delay {
	ide_delay -s 2;
}

gioslot0 {
        mg_setboard 0;
}


gioslot1 {
        mg_setboard 1;
}

allsetup {
        gioslot
	mg_gfxreset;
	delay;
	mg_set_0ge;
	delay;
	mg_reset;
	delay;
	delay;
	resetcons
	if (!mg_gfxconsole) {
		mg_sync_repp
        	mg_sync_pprdram
        	mg_xmapinit
		mg_rdram_ccsearch
        	mg_initppregs
		enabdisp	
		mg0_clear_color
	}
}

mg_tram_rev_nobuff {
mg_dma_tram -r -e 1 -p
$foo = mg_setnumre4s -q
if ($foo == 2) {
	mg_dma_tram -r -e 1 -p -n 1
}
}

hq3test {
	echo "------	Executing Hq3 Test Suite 	------"
	buffon;
	mg_gfxreset;
	delay;
	mg_set_0ge
	setenv TEST_NAME_IN_OVEN	_01
        $status  	= 	mg_hq3_initcheck;
#        if ($status) {
#                $failed = 1;
#		echo "mg_hq3_initcheck";
#                return(-1);
#        }


	setenv TEST_NAME_IN_OVEN	_02
        $status  	= 	mg_hq3;
        if ($status) {
                $failed = 1;
                return(-1);
        }
	mg_gfxreset;
	delay;
	setenv TEST_NAME_IN_OVEN	_03
     	$status  	= 	mg_hq3_cp;

	setenv TEST_NAME_IN_OVEN	_04
     	$status  	= 	mg_hq3_converter;
     	if ($status) {
                $failed = 1;
                wait ;
        }

	setenv TEST_NAME_IN_OVEN	_05
        $status  	= 	mg_hq3_cfifo;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	echo "********	Hq3 Test Suite Execution Completed 	********\n"
	resetcons; buffoff
}


# GE11 test scripts 


gioslot_2GE {
	$tmp = mg_setboard 0;
	if ($tmp) {
		echo "Mgras Gfx init to GIO Slot 0 "
		mg_setboard 0 2;
	}
	else {
		$tmp = mg_setboard 1;
		if ($tmp) {
			echo "Found boards in slot 1"
			mg_setboard 1 2;
	        }
		else {
			echo "No boards found in slot 0 or slot 1"
		}
	}
}
ge0_ucode {
	mg_reset;
	$ge_no = mg_queryGE;
	if ($ge_no == 0)
	{
		echo "GE11 doesn't exist\n";
	}
	else if ($ge_no == 1){
		echo "\ntesting GE0 Ucode memory....\n";	
      
		gioslot;
		buffon;
		mg_gfxreset;
		mg_set_ge 0;
		$status = mg_ge_ucode_a
		if ($status) {
			$failed = 1;
			return(-1);
		}
		$status = mg_ge_ucode_m
		if ($status) {
			$failed = 1;
			return(-1);
		}
	     }
             else if ($ge_no == 2) {
		echo "\ntesting GE0 Ucode memory....\n";	
      
		gioslot_2GE;
		buffon;
		mg_gfxreset;
		mg_set_ge 0;
		$status = mg_ge_ucode_a
		if ($status) {
			$failed = 1;
			return(-1);
		}
		$status = mg_ge_ucode_m
		if ($status) {
			$failed = 1;
			return(-1);
		}
	     }	
}
ge1_ucode {
	mg_reset;
	$ge_no = mg_queryGE;	
	if ($ge_no == 2) 
	{
		echo "\ntesting GE1 Ucode memory....\n";	
		gioslot_2GE;
		buffon;
		mg_gfxreset;
		mg_set_ge 1;
		$status = mg_ge_ucode_a
		if ($status) {
			$failed = 1;
			return(-1);
		}
		$status = mg_ge_ucode_m
		if ($status) {
			$failed = 1;
			return(-1);
		}
	}
	else {
		echo "GE11 doesn't exist\n";
	     }
}
	
	
getest {
#	echo "------	Executing GE COREs Test Suite 	------"
#        $status 	=	mg_ge_ucode_a;
#        if ($status) {
#                $failed = 1;
#                return(-1);
#        }
#
#        $status 	=	mg_ge_ucode_m;
#        if ($status) {
#                $failed = 1;
#                return(-1);
#        }

#        $status 	=	mg_hq3_dnload;
#        $status 	=	mg_ge11_dnload;
#        $status 	=	mg_ge_go;

        $status 	=	mg_ge_inst;
	if ($status) {
                $failed = 1;
                return(-1);
        }


        $status 	=	mg_ge_cram;
	if ($status) {
                $failed = 1;
                return(-1);
        }

        $status 	=	mg_ge_eram;
	if ($status) {
                $failed = 1;
                return(-1);
        }

        $status 	=	mg_ge_wram;
	if ($status) {
                $failed = 1;
                return(-1);
        }


        $status 	=	mg_ge_alu;
	if ($status) {
                $failed = 1;
                return(-1);
        }

        $status 	=	mg_ge_dreg;
	if ($status) {
                $failed = 1;
                return(-1);
        }

        $status 	=	mg_ge_dma;
	if ($status) {
               $failed = 1;
                return(-1);
        }


	echo "********	GE Test Suite Execution Completed 	********"

}



ge0_setup {
	mg_reset;
	$ge_no = mg_queryGE;
	if ($ge_no == 0)
	{
		echo "No GE11 exists\n";
	}
	if ($ge_no == 2)  {
		echo "------	Executing GE0 test setup 	------"
		gioslot_2GE;
		mg_hq3_dnload;
		mg_gfxreset;
		mg_set_ge 0;
		mg_ge11_dnload;
		mg_ge_go;
	 }
	if ($ge_no == 1)  {

		echo "------	Executing GE0 test setup 	------"
		gioslot_2GE;
		mg_hq3_dnload;
		mg_gfxreset;
		delay;
		mg_ge11_dnload;
		mg_set_ge 0;
		mg_ge_go;
	     }
#	buffoff; resetcons;
}
ge0_test {
	mg_reset;
	$ge_no = mg_queryGE;
	if($ge_no == 0)
	{
		 echo "No GE11 exists\n";
	}
	else {

		echo "------	Executing GE Test Suite on :: GE0 	------"
		ge0_ucode;
		ge0_setup;
		buffon
		mg_gfxreset
		delay;
		
	mg_pon_puts -s "testing ge0_core....\n\r";
		$status 	=	getest;
       		if ($status) {
       	        	 $failed = 1;
                return(-1);
        	}
	}
#	buffoff; resetcons;
}

ge1_setup {
	mg_reset;
	$ge_no = mg_queryGE;
	buffon;
	if($ge_no == 2)
	{
		echo "------	Executing GE1 test setup 	------"
		gioslot_2GE;
		buffon
		mg_gfxreset;
		mg_set_2ge;
		mg_set_ge 0;
		mg_hq3_dnload;
		mg_ge11_dnload;
		mg_ge_go;
		mg_set_ge 1;
		mg_ge11_dnload;
		mg_ge_go;
		mg_gfxreset;
		mg_set_2ge;
		mg_set_ge 0;
		mg_nextge;
		mg_set_ge 1;
	}
	if($ge_no == 1)
	{
		echo "GE11_1 doesn't exist\n";
	}
	buffoff; resetcons;
}

ge1_test {
	mg_reset;
	$ge_no = mg_queryGE;
	buffon;
	if($ge_no == 2)
	{
		mg_gfxreset;
		echo "------	Executing GE Test Suite  :: GE1 	------"
		ge1_ucode;
		ge1_setup;
		$status 	=	getest;
        	if ($status) {
                	$failed = 1;
                	return(-1);
       		 }
	}
	if($ge_no == 1)
	{
		echo "GE11_1 doesn't exist\n";
	}
	buffoff; resetcons;
}
tge_setup {
	mg_reset;
	$ge_no = mg_queryGE;
	if ($ge_no  == 2)
	{
		echo "=== tge_setup ===\n";
		gioslot_2GE;
		buffon;
		mg_hq3_dnload;
		mg_gfxreset;
		delay;
		mg_set_ge 0;
		mg_ge11_dnload;
		mg_ge_go;
		mg_set_ge 1;
		mg_ge11_dnload;
		mg_ge_go;
		mg_set_ge 0;
		resetcons; buffoff;
	}
	if($ge_no == 1)
	{
		echo "Setup GE11_0 only\n";
		ge0_setup;
	}
	if($ge_no == 0)
	{
		echo "NO ge11 exists\n";
	}
	buffoff; resetcons;
}

tge_test {
	mg_reset;
	$ge_no = mg_queryGE;
	if ($ge_no == 2)
	{
	mg_pon_puts -s "testing ge0_ucode....\n\r";
		ge0_ucode;
	mg_pon_puts -s "testing ge1_ucode....\n\r";
		ge1_ucode;
	mg_pon_puts -s "testing tge_setup....\n\r";
		tge_setup;
		gioslot_2GE;
		buffon
		mg_gfxreset
		delay;
		mg_set_2ge;
		mg_set_ge 0
		mg_ge_go
		mg_set_ge 1
		mg_ge_go
		mg_set_ge 0
		echo " testing GE0 COREs....\n";
		$status = getest;
		if ($status) {
			$failed = 1;
			resetcons; buffoff;
			return(-1);
		}
		mg_nextge;
		mg_set_ge 1;
		mg_ge_go
		echo " testing GE1 COREs....\n";
		$status = getest
		if ($status) {
			$failed = 1;
			resetcons; buffoff;
			return(-1);
		}
		resetcons; buffoff
	}
	if ($ge_no == 1) 
	{
		echo "Test only GE11_0\n";
		$status = ge0_test;
		if ($status) {
			$failed = 1;
			resetcons; buffoff;
			return(-1);
		}
		resetcons; buffoff
	}
	if ($ge_no == 0)
	{
		echo "No GE11 exists\n";
		ge0_test;
	}
}
# End of Ge test scripts

dactest {
	echo "------	Executing DAC   Test Suite 	------"
	setenv TEST_NAME_IN_OVEN	_06
        $status 	=	mg_dacreset;
        if ($status) {
                $failed = 1;
                return(-1);
        }


	setenv TEST_NAME_IN_OVEN	_07
        $status 	=	mg_dacmodereg;
        if ($status) {
                $failed = 1;
                return(-1);
        }


	setenv TEST_NAME_IN_OVEN	_08
        $status 	=	mg_dacreset;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_09
        $status 	=	mg_dacaddrreg;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_10
        $status 	=	mg_dacreset;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_11
        $status 	=	mg_clrpaletteaddrUniq;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_12
        $status 	=	mg_dacreset;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_13
        $status 	=	mg_clrpalettewalkbit;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_14
        $status 	=	mg_dacreset;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_15
        $status 	=	mg_clrpalettepatrn;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_16
        $status 	=	mg_dacreset;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	echo "********	DAC Test Suite Execution Completed 	********"
}

vc3test {
	echo "------	Executing VC3   Test Suite 	------"
	setenv TEST_NAME_IN_OVEN	_17
        $status 	=	mg_vc3reset;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_18
        $status 	=	mg_vc3internalreg;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_19
        $status 	=	mg_vc3addrsbus;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_20
        $status 	=	mg_vc3databus;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_21
        $status 	=	mg_vc3addrsuniq;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	setenv TEST_NAME_IN_OVEN	_22
        $status 	=	mg_vc3patrn;
        if ($status) {
                $failed = 1;
                return(-1);
        }


	echo "********	VC3 Test Suite Execution Completed 	********"
}

cmaptest {
	echo "------	Executing CMAP   Test Suite 	------"
	setenv TEST_NAME_IN_OVEN	_23
        $status 	=	mg_vc3init 0x555;
        if ($status) {
                $failed = 1;
		return (-1);
        }


	setenv TEST_NAME_IN_OVEN	_24
        $status 	=	mg_cmaprev;
        if (!$status) {
                $failed = 1;
		return (-1);
        }


	setenv TEST_NAME_IN_OVEN	_25
        $status 	=	mg_cmapdatabus 0;
        if ($status) {
                $failed = 1;
		return (-1);
        }

	setenv TEST_NAME_IN_OVEN	_26
        $status 	=	mg_cmapaddrsbus 0;
        if ($status) {
                $failed = 1;
		return (-1);
        }

	setenv TEST_NAME_IN_OVEN	_27
        $status 	=	mg_cmappatrn 0;
        if ($status) {
                $failed = 1;
		return (-1);
        }

	setenv TEST_NAME_IN_OVEN	_28
        $status 	=	mg_cmapaddrsuniq 0;
        if ($status) {
                $failed = 1;
		return (-1);
        }


	setenv TEST_NAME_IN_OVEN	_29
        $status 	=	mg_cmapdatabus 1;
        if ($status) {
                $failed = 1;
		return (-1);
        }


	setenv TEST_NAME_IN_OVEN	_30
        $status 	=	mg_cmapaddrsbus 1;
        if ($status) {
                $failed = 1;
		return (-1);
        }

	setenv TEST_NAME_IN_OVEN	_31
        $status 	=	mg_cmappatrn 1;
        if ($status) {
                $failed = 1;
		return (-1);
        }

	setenv TEST_NAME_IN_OVEN	_32
        $status 	=	mg_cmapaddrsuniq 1;
        if ($status) {
                $failed = 1;
		return (-1);
        }

	setenv TEST_NAME_IN_OVEN	_33
        $status 	=	mg_cmapuniqtest;
        if ($status) {
                $failed = 1;
		return (-1);
        }


	echo "********	CMAP Test Suite Execution Completed 	********"
}


bkend {
	buffon;
	echo "------	Executing Back End   Test Suite 	------"
        $status 	=	dactest;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing vc3test....\n\r";
        $status 	=	vc3test;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing cmaptest....\n\r";
#        $status 	=	cmaptest;
        if ($status) {
                $failed = 1;
                return(-1);
        }

#        $status 	=	mg_reset; 
        if ($status) {
                $failed = 1;
                return(-1);
        }
	delay;

	mg_pon_puts -s "testing mg_xmapdcbreg 0....\n\r";
	setenv TEST_NAME_IN_OVEN	_34
        $status 	=	mg_xmapdcbreg 0;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_xmapdcbreg 1....\n\r";
	setenv TEST_NAME_IN_OVEN	_35
        $status 	=	mg_xmapdcbreg 1;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	$tmp = mg_setnumre4s -q
	if ($tmp == 2) {
		mg_pon_puts -s "testing mg_xmapdcbreg 2...\n\r";
	setenv TEST_NAME_IN_OVEN	_36
		$status         =       mg_xmapdcbreg 2;
        	if ($status) {
                	$failed = 1;
                	return(-1);
        	}
		mg_pon_puts -s "testing mg_xmapdcbreg 3...\n\r";
	setenv TEST_NAME_IN_OVEN	_37
		$status         =       mg_xmapdcbreg 3;
        	if ($status) {
                	$failed = 1;
                	return(-1);
        	}
	}
		

	setenv TEST_NAME_IN_OVEN	_38
        $status 	=	mg_reset; 
        if ($status) {
                $failed = 1;
                return(-1);
        }
	delay;

#	mg_pon_puts -s "testing mg_crcwalk test suite (1280X1024X60)... \n\r";
#	setenv TEST_NAME_IN_OVEN	_39
#	mg_stoptiming;
#	$status		=	mg_vc3init 0x107
#	if ($status) {
#		$failed = 1;
#		return(-1);
#	}
	setenv TEST_NAME_IN_OVEN	_40
	mg_starttiming;
	$status 	=	mg_crcwalk;
	if ($status) {
		$failed = 1;
		return(-1);
	}
#	setenv TEST_NAME_IN_OVEN	_41
#	$status 	=	mg_reset; 
#	if ($status) {
#		$failed = 1;
#		return(-1);
#	}
#
#	mg_pon_puts -s "testing mg_crcwalk test suite (1280X1024X72)... \n\r";
#	setenv TEST_NAME_IN_OVEN	_42
#	mg_stoptiming;
#	$status		=	mg_vc3init 0x130
#	if ($status) {
#		$failed = 1;
#		return(-1);
#	}
#	setenv TEST_NAME_IN_OVEN	_43
#	mg_starttiming;
#	$status 	=	mg_crcwalk;
#	if ($status) {
#		$failed = 1;
#		return(-1);
#	}
#	setenv TEST_NAME_IN_OVEN	_44
#	$status 	=	mg_reset; 
#	if ($status) {
#		$failed = 1;
#		return(-1);
#	}
#
#	mg_pon_puts -s "testing mg_crcwalk test suite (1280X1024X76)... \n\r";
#	setenv TEST_NAME_IN_OVEN	_45
#	mg_stoptiming;
#	$status		=	mg_vc3init 0x139
#	if ($status) {
#		$failed = 1;
#		return(-1);
#	}
#	setenv TEST_NAME_IN_OVEN	_46
#	mg_starttiming;
#	$status 	=	mg_crcwalk;
#        if ($status) {
#                $failed = 1;
#                return(-1);
#        }
#	setenv TEST_NAME_IN_OVEN	_47
#	$status 	=	mg_reset; 
#	if ($status) {
#		$failed = 1;
#		return(-1);
#	}
#
#	mg_pon_puts -s "testing mg_crcwalk test suite (1600X1200X60)....\n\r";
#	$status		= 	mg_issolid;
#	if ($status) {	
#		mg_pon_puts -s "testing mg_crcwalk for Soild Impact...\n\r"
#		setenv TEST_NAME_IN_OVEN	_48
#		mg_stoptiming;
#		$status	=	mg_vc3init 0x156
#		if ($status) {
#			$failed = 1;
#			return(-1);
#		}
#		setenv TEST_NAME_IN_OVEN	_49
#		mg_starttiming;
#		$status	=	mg_crcwalk;
#		if ($status) {
#			$failed = 1;
#			mg_pon_puts -s "ERROR: mg_crcwalk test failed for Solid Impact\n\r"
#			return(-1);
#		}
#	} else {
#		mg_pon_puts -s "testing mg_crcwalk for Max/High Impact...\n\r"
#		setenv TEST_NAME_IN_OVEN	_50
#		mg_stoptiming;
#		$status	=	mg_vc3init 0x159
#		if ($status) {
#			$failed = 1;
#			return(-1);
#		}
#		setenv TEST_NAME_IN_OVEN	_51
#		mg_starttiming;
#		$status	=	mg_crcwalk;
#		if ($status) {
#			$failed = 1;
#			mg_pon_puts -s "ERROR: mg_crcwalk test failed for Max/High Impact\n\r"
#			return(-1);
#		}
#	}
#
	setenv TEST_NAME_IN_OVEN	_52

	delay;
	echo "Executing mg_vc3cursorposition test..."
	mg_reset;
	delay;
	mg_xmapinit;
	delay;
	repeat 3 {
		delay
	}
	mg_pon_puts -s "testing mg_vc3cursorposition....\n\r";

	setenv TEST_NAME_IN_OVEN	_53
	$status 	=	mg_vc3cursorposition;
	if ($status) {
                $failed = 1;
		resetcons; buffoff;
                return(-1);
	}
	

	resetcons; buffoff;
	echo "********	Back End Test Suite Execution Completed 	********"

}

re4test {
	echo "------	Executing RE4   Test Suite 	------"
	setenv TEST_NAME_IN_OVEN	_54
	$status 	=	mg_re_status_reg;
	if ($status) {
		$failed = 1; return(-1);
	}

	led 0;
	setenv TEST_NAME_IN_OVEN	_55
	$status 	=	mg_re_rdwr_regs;
	if ($status) {
		$failed = 1; return(-1);
	}

	setenv TEST_NAME_IN_OVEN	_56
	$status 	=	mg_re_internal_ram -t0;
	if ($status) {
		$failed = 1; return(-1);
	}

	setenv TEST_NAME_IN_OVEN	_57
	$status 	=	mg_re_internal_ram -t1;
	if ($status)  {
		$failed = 1; return(-1);
	}

	setenv TEST_NAME_IN_OVEN	_58
	$status 	=	mg_re_internal_ram -t2;
	if ($status) {
		$failed = 1; return(-1);
	}

	led 1;
	setenv TEST_NAME_IN_OVEN	_59
	$status 	=	mg_re_internal_ram -t3;
	if ($status) {
		$failed = 1; return(-1);
	}


	setenv TEST_NAME_IN_OVEN	_60
	$status 	=	mg_re_internal_ram -t4;
	if ($status) {
		$failed = 1; return(-1);
	}

	setenv TEST_NAME_IN_OVEN	_61
	$status 	=	mg_re_internal_ram -t5;
	if ($status) {
		$failed = 1; return(-1);
	}

	echo "********	RE4 Test Suite Execution Completed 	********"
}

dmatest {
	echo "------	Executing DMA Test Suite 	------"
	setenv TEST_NAME_IN_OVEN	_62
        $status 	=	mg_host_hqdma;
        if ($status) {
                $failed = 1;
                return(-1);
        }


	setenv TEST_NAME_IN_OVEN	_63
        $status 	=	mg_host_hq_cp_dma;
	if ($status) {
		$failed = 1;
		return(-1);
	}

#        $status 	=	mg_ge_dma;
#	if ($status) {
#                $failed = 1;
#                return(-1);
#        }

#	DMA PIO Test
	setenv TEST_NAME_IN_OVEN	_64
	$status 	=	mg_dma_pp  -r1 -e1 -w1 -d1  -t  -m 0 0 -b 0x240 -y 16 -z 192
	if ($status) {
		$failed = 1;
		return(-1);
	}
	echo "********	DMA Test Suite Execution Completed 	********"
}


# allows colors to be correct for drawings
drawsetup {
	delay;
#	mg_gfxreset;
#	mg_set_0ge;
#	mg_reset;
	delay;
	delay;
	mg_xmapinit;
}

drawclose {
	delay;
#	resetcons;
	delay;
	delay;
}

tex_draw_test {
	echo "------	Executing tex_draw_test  Suite 	------"

	mg_pon_puts -s "testing mg_notex_line....\n\r";
	drawsetup;
	setenv TEST_NAME_IN_OVEN	_65
	$status		=	mg_notex_line
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_notex_poly....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_66
	$status		=	mg_notex_poly
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_poly....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_67
	$status		=	mg_tex_poly 
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_id....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_68
	$status		=	mg_tex_1d
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_3d....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_69
	$status		=	mg_tex_3d
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_scistri....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_70
	$status		=	mg_tex_scistri
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_linegl....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_71
	$status		=	mg_tex_linegl
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_load....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_72
	$status		=	mg_tex_load
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_persp....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_73
	$status		=	mg_tex_persp
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_mag....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_74
	$status		=	mg_tex_mag 
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_detail....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_75
	$status		=	mg_tex_detail
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_bordertall....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_76
	$status		=	mg_tex_bordertall
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_lut4d....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_77
	$status		=	mg_tex_lut4d
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_borderwide....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_78
	$status		=	mg_tex_borderwide
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing mg_tex_mddma....\n\r";
	delay;
	setenv TEST_NAME_IN_OVEN	_79
	$status		=	mg_tex_mddma
	delay
        if ($status) {
                $failed = 1;
                return(-1);
        }

	mg_pon_puts -s "testing drawclose....\n\r";
	drawclose;

	echo "********	tex_draw_test Suite Execution Completed 	********"
}

repp_test {
	echo "------	Executing RE-PP Test Suite 	------"
	drawsetup;
	setenv TEST_NAME_IN_OVEN	_80
	$status		=	mg_z_tri 
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	delay;
	setenv TEST_NAME_IN_OVEN	_81
	$status		=	mg_lines 
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	delay;
	setenv TEST_NAME_IN_OVEN	_82
	$status		=	mg_points 
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	delay;
	setenv TEST_NAME_IN_OVEN	_83
	$status		=	mg_stip_tri  
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	delay;
	setenv TEST_NAME_IN_OVEN	_84
	$status		=	mg_xblock 
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	delay;
	setenv TEST_NAME_IN_OVEN	_85
	$status		=	mg_chars 
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	delay;
	setenv TEST_NAME_IN_OVEN	_86
	$status		=	mg_logicop
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	delay;
	setenv TEST_NAME_IN_OVEN	_87
	$status		=	mg_dither
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	delay;
	setenv TEST_NAME_IN_OVEN	_88
	$status		=	mg_color_tri 
	delay;
        if ($status) {
                $failed = 1;
                return(-1);
        }

	led 1
	delay
	drawclose;

	echo "********	RE/PP Test Suite Execution Completed 	********"
}

rdram_mem {
        echo "------    Executing FRAME BUFFER  Test Suite      ------"
#       Z Buffer Test

	drawsetup
	if (mg_gfxconsole)
		mg_pon_puts -s "testing mg_dma_pp Z Buffer....\n\r";
	setenv TEST_NAME_IN_OVEN	_89
        $status         =       mg_dma_pp  -r0 -e0 -w0 -d0 -b 0x0 -p3
        if ($status) {
                $failed = 1;
		return (-1);
        }

#       Color Buffer Test
	if (mg_gfxconsole)
		mg_pon_puts -s "testing mg_dma_pp Color Buffer....\n\r";
	setenv TEST_NAME_IN_OVEN	_90
        $status         =       mg_dma_pp  -r0 -e0 -w0 -d0  -b 0x240 -p3
        if ($status) {
                $failed = 1;
		return (-1);
        }

#	Overlay Buffer Test
	if (mg_gfxconsole)
		mg_pon_puts -s "testing mg_dma_pp Overlay Buffer....\n\r";
	setenv TEST_NAME_IN_OVEN	_91
        $status         =       mg_dma_pp  -r0 -e0 -w0 -d0  -b 0x1c0 -p3
        if ($status) {
                $failed = 1;
		return (-1);
        }

	$tmp = mg_setnumre4s -q
	if ($tmp == 2) {
#		Display Buffer-CD Test
		if (mg_gfxconsole)
			mg_pon_puts -s "testing mg_dma_pp Buffer CD....\n\r";
	setenv TEST_NAME_IN_OVEN	_92
        	$status = mg_dma_pp  -r0 -e0 -w0 -d0  -b 0x320 -p3
        	if ($status) {
                	$failed = 1;
			return (-1);
        	}
#		ACC36 or AUX 0 Buffer
		if (mg_gfxconsole)
		    mg_pon_puts -s "testing mg_dma_pp ACC36/AUX Buffer....\n\r";
	setenv TEST_NAME_IN_OVEN	_93
        	$status = mg_dma_pp  -r0 -e0 -w0 -d0  -b 0x0e0 -p3
        	if ($status) {
                	$failed = 1;
			return (-1);
        	}
	}
		

        echo "********  FRAME BUFFER  Test Suite Execution Completed    ********"
}

tram_mem {
	delay;
        echo "------    Executing TRAM Memory Test Suite        ------"
	delay
	mg_tram_rev_nobuff
	delay;
	setenv TEST_NAME_IN_OVEN	_94
        $status         =       mg_dma_tram -m 3 -e 0
        if ($status) {
                $failed = 1;
		return (-1);
        }
	delay
	$foo = mg_setnumre4s -q
	delay
	if ($foo == 2) {
	setenv TEST_NAME_IN_OVEN	_95
        	$status         =       mg_dma_tram -m 3 -e 0 -n 1
        	if ($status) {
                	$failed = 1;
			return (-1);
        	}
	}
}

re4flextest {
        echo "------    High Density Flex Connectivity Test ------"
	setenv TEST_NAME_IN_OVEN	_96
	$status		=		mg_hq3 4
        if ($status) {
                $failed = 1;
        }
}


mg_test_all {
	$failed = 0;
	if (mg_gfxconsole) {
		report=2;
	} else {
		report=2;
	}
        repeat 3 delay;
        gioslot;
        if (mg_gfxconsole) {
                mg_reset;
                delay;
                delay;
                resetcons;
        } else {
                allsetup;
        }

	buffon
	mg_pon_puts -s "Start mg_test_all test script ....\n\r";
	delay;
	delay;
	mg_pon_puts -s "testing re4flextest....\n\r";
	$status		=	re4flextest;
	if ($failed) {
			echo "Flex Test FAILED"
			resetcons; buffoff;
                	return($status);
	}
	
	mg_pon_puts -s "testing hq3test....\n\r";
	$status	=	hq3test;
	if ($failed) {
			echo "hq3test FAILED"
                	return($status);
	}
	
	mg_pon_puts -s "testing bkend....\n\r";
	resetcons;
	gioslot;
	mg_reset;
	delay;
	delay;
	resetcons;
	$status		=	bkend;
	if ($failed) {
			echo "bkend FAILED" 
			resetcons; buffoff;
                	return($status);
	}

	mg_pon_puts -s "testing ge_test....\n\r";
#	resetcons; 

	mg_reset;

	$ge_no = mg_queryGE;
	if ($ge_no == 2) 					# 2 GE system
	{
		echo "Testing 2GE system....\n"
		setenv TEST_NAME_IN_OVEN	_41
		$status		=	tge_test;
	}
	if ($ge_no == 1) 					# 1 ge system
	{
	mg_pon_puts -s "testing ge11_0 ...\n\r";
		echo "Testing 1GE system....\n"
		setenv TEST_NAME_IN_OVEN	_44
		$status = ge0_test;
	mg_pon_puts -s "finished ge11_0 test ...\n\r";
	}

	if ($failed) {
		echo "ge_test FAILED"
		resetcons; buffoff;
               	return($status);
	}
	
	
	allsetup;
        buffon

	mg_pon_puts -s "\rtesting re4test....\n\r";
	$status		=	re4test;
	if ($failed) {
			echo "re4test FAILED"
			resetcons; buffoff;
                	return(-1);
	}
	mg_pon_puts -s "testing dmatest....\n\r";
	$status		=	dmatest;
	if ($failed) {
			echo "dmatest FAILED"
			resetcons; buffoff;
                	return($status);
	}

	mg_pon_puts -s "testing rdram_mem....\n\r";
	$status 	=	rdram_mem;
	if ($failed) {
			echo "RDRAM FAILED"
			resetcons; buffoff;
                	return($status);
	}

	mg_pon_puts -s "testing repp_test....\n\r";
	$status		=	repp_test;
	if ($failed) {
			echo "repp_test FAILED"
			resetcons; buffoff;
                	return($status);
	}

	delay;

	allsetup ;
	delay;
        delay;
	mg_reset;
        delay;
	resetcons; buffoff;
	buffon;

	echo "Testing TRAM memory"
	repeat 3 delay;
	mg_pon_puts -s "testing tram_mem....\n\r";
	$status		=	tram_mem;
	if ($failed) {
			echo "tram test FAILED"
			resetcons; buffoff;
                	return(-1);
	}

	mg_pon_puts -s "testing tex_draw_test....\n\r";
		setenv TEST_NAME_IN_OVEN	_96
	$status		=	tex_draw_test
	if ($failed) {
			echo "tex_draw_test FAILED"
			resetcons; buffoff;
                	return(-1);
	}
	
	mg_pon_puts -s "All tests have passed....\n\r";
	echo " All tests have passed"
	delay;
	delay;
	mg_reset;
	resetcons; buffoff;
	report=4
}

mg_all {
	$failed = 0;
        $tmp = mg_setboard 0;
        if ($tmp) {
		echo "Testing Impact boards in slot 0."
                mg_test_all;
        	if ($failed) {
			echo "ERROR: Failure detected on gfx in slot 0."
			if ($volts == 0) {
				boot -f bootp()mg0L.failed;
			}
			else if ($volts == 2) {
				boot -f bootp()mg0H.failed;
			}
			forever wait;
		}
		else
		{
			unsetenv TEST_NAME_IN_OVEN
			echo "gfx in slot 0 passed."
			boot -f bootp()mg_0.pass;
		}
        }

	$failed = 0;
        $tmp = mg_setboard 1;
        if ($tmp) {
		echo "Testing Impact boards in slot 1."
                mg_test_all;
	        if ($failed) {
			echo "ERROR: Failure detected on gfx in slot 1."
			if ($volts == 0) {
				boot -f bootp()mg1L.failed;
			}
			else if ($volts == 2) {
				boot -f bootp()mg1H.failed;
			}
			forever wait;
		}
		else
		{
			unsetenv TEST_NAME_IN_OVEN
			echo "gfx in slot 1 passed."
			boot -f bootp()mg_1.pass;
		}
        }
}

mgva {

	echo "\n*****************************\n"
	echo "Voltage changed to 4.75V\n"
	echo "\n*****************************\n"
#	chg_volt 0;
#	ide_delay -s 15;
	mg_all;
#	echo "\n*****************************\n"
#	echo "Voltage changed to 5.25V\n"
#	echo "\n*****************************\n"
#	chg_volt 1;
#	ide_delay -s 15;
#	chg_volt 2;
#	ide_delay -s 15;
#	mg_all;
#	echo "\n*****************************\n"
#	echo "Voltage set back to 5.0V\n"
#	echo "\n*****************************\n"
#	chg_volt 1;
#	ide_delay -s 15;
}
# END OF IMPACT 
# Top level functions

gfx_diag {
    $express = gr2_probe;
    $newport=ng1_probe;

    if ($newport) {
	ng1_all;
    }
    if ($express) {
	gr2_all;
    }
#    ng1_all;
#    gr2_all;
}


gfx {
    $express = gr2_probe;
    $newport=ng1_probe;
    $mgras = mg_probe;

    if ($newport) {
	ng1_all;
    }
    if ($express) {
	gr2_all;
    }
    if ($mgras) {
	forever mg_all;
    }
    unix;
} 

gfxva {
    echo "Voltage changed to 4.75 V\n"
    chg_volt 0;
	ide_delay -s 15;
    $express = gr2_probe;
    $newport=ng1_probe;
    $mgras = mg_probe;

    if ($newport) {
	ng1_all;
    }
    if ($express) {
	gr2_all;
    }
    if ($mgras) {
	mg_all;
    }
#    echo "Voltage changed to 5.25 V\n"
#    chg_volt 1;
#	ide_delay -s 15;
#    chg_volt 2;
#	ide_delay -s 15;
    $express = gr2_probe;
    $newport=ng1_probe;

    if ($newport) {
	ng1_all;
    }
    if ($express) {
	gr2_all;
    }
    if ($mgras) {
	mg_all;
    }
#    echo "Voltage changed to 5.0 V\n"
#    chg_volt 1;
#	ide_delay -s 15;
#    unix
}

############################################################
# Oven Script .... Begin
############################################################
echo " WELCOME TO THE IMPACT OVEN TESTS"
echo ""
echo "Voltage changed to 4.75 V\n"
chg_volt 0;
	ide_delay -s 15;
boot -f bootp()voltage_low.pass
$skip_timer =0;
$volts = 0;
ip22s;
boot -f bootp()ip22_low.done
$express = gr2_probe;
$newport=ng1_probe;
$mgras_do = mg_probe;

if ($newport) {
	ng1_all;
}

if ($express) {
	gr2_all;
}

if ($mgras_do) {
	mg_all;
}

boot -f bootp()gfx_low.done
echo "Voltage changed to 5.25 V\n"
chg_volt 1;
	ide_delay -s 15;
chg_volt 2;
	ide_delay -s 15;
boot -f bootp()voltage_hi.pass
$skip_timer =1;
$volts = 2;
report=4
ip22s;
boot -f bootp()ip22_hi.done
$express = gr2_probe;
$newport=ng1_probe;
$mgras_do = mg_probe;

if ($newport) {
	ng1_all;
}

if ($express) {
	gr2_all;
}

if ($mgras_do) {
	mg_all;
}
boot -f bootp()gfx_hi.done

echo "Voltage changed to 5.00 V\n"
chg_volt 1;
	ide_delay -s 15;
boot -f bootp()start_unix;
unix;
############################################################
# Oven Script .... End
############################################################

############################################################
# Board Repair Script .... Begin
############################################################
#echo " WELCOME TO THE IMPACT BOARD REPAIR TESTS"
#echo ""
#ra_menu
############################################################
# Board Repair Script .... End
############################################################

############################################################
# IBM Function Test Script .... Begin
############################################################
#echo " WELCOME TO THE IMPACT FUNCTION TESTS"
#echo ""
#$mgras_do = mg_probe;
#if ($mgras_do) {
#        $failed = 0;
#        $tmp = mg_setboard 0;
#        if ($tmp) {
#                echo "Testing Impact boards in slot 0."
#                mg_test_all;
#        }
#}
############################################################
# IBM Function Test Script .... End
############################################################

############################################################
# RA-BOARD Script .... Begin
############################################################
#echo " WELCOME TO THE RA-BOARD TESTS"
#echo ""
#echo " WELCOME TO THE RA-BOARD TESTS"
#echo ""
#mg_all;
############################################################
# RA-BOARD Script .... End
############################################################

############################################################
# FUCTION (IP22) Script .... Begin
############################################################
#echo "WELCOME TO THE IMPACT FUNCTION TESTS"
#echo ""
#menu
############################################################
# FUCTION (IP22) Script .... End
############################################################
