xref: /OK3568_Linux_fs/buildroot/board/olpc/olpc.fth (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun\ OLPC XO boot script
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun: (visible)  " unfreeze visible" evaluate  ;
4*4882a593Smuzhiyun' (visible) catch  drop  forget (visible)
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun" /aliases" find-device " last" get-property
7*4882a593Smuzhiyunabort" No last alias"
8*4882a593Smuzhiyun" /pci/sd@c"          2over substring?  if  " root=/dev/mmcblk0p1 "                  to boot-file  then
9*4882a593Smuzhiyun" /sd/sdhci@d4280000" 2over substring?  if  " root=/dev/mmcblk1p1 "                  to boot-file  then
10*4882a593Smuzhiyun" /pci/usb@"          2over substring?  if  " root=/dev/sda1 "                       to boot-file  then
11*4882a593Smuzhiyun" /usb@"              2over substring?  if  " root=/dev/sda1 "                       to boot-file  then
12*4882a593Smuzhiyun" /pci/nandflash@c"   2over substring?  if  " root=/dev/mtdblock0 rootfstype=jffs2 " to boot-file  then
13*4882a593Smuzhiyun2drop
14*4882a593Smuzhiyun
15*4882a593Smuzhiyunroot-device " compatible" get-property dend  if  0 0  then  ( compatible$ )
16*4882a593Smuzhiyun" olpc,xo-1.75" 2over sindex -1 > if  ( compatible$ )
17*4882a593Smuzhiyun   \ Version check on XO-1.75
18*4882a593Smuzhiyun   " mrvl,mmp2" 2over sindex -1 =  if ( compatible$ )
19*4882a593Smuzhiyun      2drop                           ( )
20*4882a593Smuzhiyun      cr
21*4882a593Smuzhiyun      ." Firmware Q4E00 or newer is needed to boot a Devicetree enabled kernel." cr
22*4882a593Smuzhiyun      cr
23*4882a593Smuzhiyun      ." One way to update is to copy http://dev.laptop.org/~quozl/q4e00ja.rom" cr
24*4882a593Smuzhiyun      ." to a FAT partition on a USB flash stick and run ""flash u:\q4e00ja.rom""" cr
25*4882a593Smuzhiyun      cr
26*4882a593Smuzhiyun      ." Aborting boot." cr
27*4882a593Smuzhiyun      " show-sad" evaluate
28*4882a593Smuzhiyun      abort
29*4882a593Smuzhiyun   then
30*4882a593Smuzhiyunthen ( compatible$ )
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun" mmp" 2swap sindex -1 > if
33*4882a593Smuzhiyun   \ A Marvell MMP-based machine
34*4882a593Smuzhiyun   " last:\boot\zImage" to boot-device
35*4882a593Smuzhiyun   boot-file " console=ttyS2,115200 " $cat2 to boot-file
36*4882a593Smuzhiyunelse
37*4882a593Smuzhiyun    \ Assume XO-1
38*4882a593Smuzhiyun   " last:\boot\bzImage" to boot-device
39*4882a593Smuzhiyun   boot-file " console=ttyS0,115200 reboot=pci " $cat2 to boot-file
40*4882a593Smuzhiyunthen
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun\ Pick a terminal that looks better on the XO screen
43*4882a593Smuzhiyunroot-device " architecture" get-property dend  if  0 0  else  1-  then
44*4882a593Smuzhiyun" OLPC" $=  if  boot-file " fbcon=font:TER16x32 vt.color=0xf0 " $cat2 to boot-file  then
45*4882a593Smuzhiyun
46*4882a593Smuzhiyunboot-file " console=tty0 rootwait" $cat2 to boot-file
47*4882a593Smuzhiyunboot
48