summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/bootsource
blob: 75b5619218c570c0a8f19cc1b2bf848cbcdf0b4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

if [ -n "$nv.boot.default" ]; then
	exit
fi

if [ -e /dev/mmc1.0 ]; then
	nvmem="emmc"
else
	nvmem="nand"
fi

if [ $bootsource = mmc -a $bootsource_instance = 1 ]; then
	global.boot.default="bootchooser emmc mmc spi net"
elif [ $bootsource = mmc -a $bootsource_instance = 0 ]; then
	global.boot.default="mmc $nvmem spi net"
elif [ $bootsource = nand ]; then
	global.boot.default="bootchooser nand spi mmc net"
elif [ $bootsource = spi ]; then
	global.boot.default="spi bootchooser $nvmem mmc net"
elif [ $bootsource = net ]; then
	global.boot.default="net bootchooser $nvmem spi mmc"
fi