summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/phytec-phycore-omap4460/defaultenv-phytec-phycore-omap4460/bin/nand_bootstrap
blob: 49e38dc4f03d53537f0b7e315c875895fb421185 (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
#!/bin/sh
echo "copying barebox to nand..."

mci0.probe=1
mkdir mnt

mount /dev/disk0.0 /mnt
if [ $? != 0 ]; then
	echo "failed to mount mmc card"
	exit 1
fi

if [ ! -f /mnt/mlo-nand.bin ]; then
	echo "mlo-nand.bin not found on mmc card"
	exit 1
fi

if [ ! -f /mnt/barebox.bin ]; then
	echo "barebox.bin not found on mmc card"
fi

gpmc_nand0.eccmode=bch8_hw_romcode
erase /dev/nand0.xload.bb
cp /mnt/mlo-nand.bin /dev/nand0.xload.bb

gpmc_nand0.eccmode=bch8_hw
erase /dev/nand0.barebox.bb
cp /mnt/barebox.bin /dev/nand0.barebox.bb

echo "success"