#########################################################
#
# CAUTION: This file is to only be included in the Base
#		Image builds and not the Upgrade Images
#
#########################################################

cd //
cd /boot

ls upgrade.dat
if ($?)
	exit
endif

#
# One time initialization of display parameters
# There seems to be a bug in Lolo that only allows for one custom display driver at a time.
# So in order for this to work, succesive changes to the driver will require an increment in the display number.
# This will force Lolo to create a new entry the overwrites the old one.
#
# NOTE:  BE VERY CAREFUL TO MATCH THE DRIVER NUMBERS HERE AND IN THE "safe" IMAGE, OTHERWISE WINCE WILL NOT FULLY LOAD
# 
# This same selection should be made in config.txt in SafeUpgrade
#

video-init 12 16
	if ($?)
		echo "Creating New Video Driver 12..."
		video-init 7 16
		w 0x44000000 0x02b008f8
		w 0x44000004 0x7204131f
		w 0x44000008 0x140a0ddf
		w 0x4400000C 0x04400003
		w 0x44000010 0x80000000
		w 0x44000014 0x3f3f3f3f
		config V 12 800 480
	else
		echo "Video Driver 12 Exists..."
	endif
	video-init 12 16

if ($?)
	echo "Video Driver Load failed..."
else
	echo "Video Driver Loaded Successfully..."
endif


cd //
cd /boot/IMAGES

video-clear

bitmap Plasma11.bmp

video-on
cd //
cd /boot

echo "Booting From NAND Boot Partition..."

w /w 0x41300008 0x2
w /w 0x4090000C 0x02658000

load bin NK.BIN
exec rtc:rtc_pxa270:skiplcdcinit:1