summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/freescale-mx35-3-stack/env/bin/boot
blob: fb2fe614d4ed2f2ee7576315dec6aa3c42263b85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh

. /env/config

if [ x$1 = xnand ]; then
	rootfs_loc=nand
	kernel_loc=nand
elif [ x$1 = xnor ]; then
	rootfs_loc=nor
	kernel_loc=nor
elif [ x$1 = xnet ]; then
	rootfs_loc=net
	kernel_loc=net
fi


if [ x$ip = xdhcp ]; then
	bootargs="$bootargs ip=dhcp"
elif [ x$ip != xno ]; then
	bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::"
fi


if [ $rootfs_loc != net ]; then
	if [ x$rootfs_loc = xnand ]; then
		rootfs_mtdblock=$rootfs_mtdblock_nand
	else
		rootfs_mtdblock=$rootfs_mtdblock_nor
	fi


	if [ $rootfs_type = ubifs ]; then
		bootargs="$bootargs root=ubi0:root ubi.mtd=$rootfs_mtdblock"
	else
		bootargs="$bootargs root=/dev/mtdblock$rootfs_mtdblock"
	fi

	bootargs="$bootargs rootfstype=$rootfs_type"
else
	bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot,v3,tcp"
fi


bootargs="$bootargs mtdparts=\"physmap-flash.0:$nor_parts;mxc_nand:$nand_parts\""

if [ $kernel_loc = net ]; then
	if [ x$ip = xdhcp ]; then
		dhcp
	fi
	tftp $kernel uImage || exit 1
	bootm uImage
elif [ $kernel_loc = nor ]; then
	bootm /dev/nor0.kernel
else
	bootm /dev/nand0.kernel.bb
fi