9
0
Fork 0

pcm038: Update environment for NAND

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2008-08-13 14:31:23 +02:00
parent 6f680b638b
commit 75a9c260c8
6 changed files with 55 additions and 17 deletions

View File

@ -2,9 +2,9 @@
. /env/config
if [ x$1 = xflash ]; then
root=flash
kernel=flash
if [ x$1 = xnand ]; then
root=nand
kernel=nand
fi
if [ x$1 = xnet ]; then
@ -12,19 +12,26 @@ if [ x$1 = xnet ]; then
kernel=net
fi
if [ x$1 = xnor ]; then
root=nor
kernel=nor
fi
if [ x$ip = xdhcp ]; then
bootargs="$bootargs ip=dhcp"
else
bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::"
fi
if [ x$root = xflash ]; then
bootargs="$bootargs root=$rootpart rootfstype=jffs2"
if [ x$root = xnand ]; then
bootargs="$bootargs root=$rootpart_nand rootfstype=jffs2"
elif [ x$root = xnor ]; then
bootargs="$bootargs root=$rootpart_nor rootfstype=jffs2"
else
bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot,v3,tcp"
fi
bootargs="$bootargs mtdparts=physmap-flash.0:$mtdparts"
bootargs="$bootargs mtdparts=physmap-flash.0:$nor_parts;imx_nand:$nand_parts"
if [ $kernel = net ]; then
if [ x$ip = xdhcp ]; then
@ -32,7 +39,9 @@ if [ $kernel = net ]; then
fi
tftp $uimage uImage
bootm uImage
else
elif [ $kernel = nor ]; then
bootm /dev/nor0.kernel
else
bootm /dev/nand0.kernel.bb
fi

1
board/pcm038/env/bin/hush_hack vendored Normal file
View File

@ -0,0 +1 @@
nand -a /dev/nand0.*

View File

@ -4,7 +4,17 @@ PATH=/env/bin
export PATH
. /env/config
addpart /dev/nor0 $mtdparts
if [ -e /dev/nor0 ]; then
addpart /dev/nor0 $nor_parts
fi
if [ -e /dev/nand0 ]; then
addpart /dev/nand0 $nand_parts
# Uh, oh, hush first expands wildcards and then starts executing
# commands. What a bug!
source /env/bin/hush_hack
fi
echo
echo -n "Hit any key to stop autoboot: "
@ -17,4 +27,4 @@ if [ $? != 0 ]; then
exit
fi
boot
boot

View File

@ -3,6 +3,13 @@
. /env/config
image=$uimage
part=/dev/nor0.kernel
if [ x$1 = xnand ]; then
part=/dev/nand0.kernel.bb
elif [ x$1 = xnor ]; then
part=/dev/nor0.kernel
else
echo "usage: $0 nor|nand [imagename]"
exit 1
fi
. /env/bin/_update $1
. /env/bin/_update $2

View File

@ -2,7 +2,15 @@
. /env/config
image=$jffs2
part=/dev/nor0.root
image=$uimage
if [ x$1 = xnand ]; then
part=/dev/nand0.root.bb
elif [ x$1 = xnor ]; then
part=/dev/nor0.root
else
echo "usage: $0 nor|nand [imagename]"
exit 1
fi
. /env/bin/_update $2
. /env/bin/_update $1

View File

@ -1,6 +1,6 @@
#!/bin/sh
# can be either 'net' or 'flash'
# can be either 'net', 'nor' or 'nand''
kernel=net
root=net
@ -21,6 +21,9 @@ autoboot_timeout=3
nfsroot="/ptx/work/octopus/rsc/svn/oselas/bsp/phytec/phyCORE-i.MX27/OSELAS.BSP-Phytec-phyCORE-i.MX27-trunk/root"
bootargs="console=ttymxc0,115200"
mtdparts="128k(uboot)ro,128k(ubootenv),1536k(kernel),-(root)"
rootpart="/dev/mtdblock3"
nor_parts="256k(uboot)ro,128k(ubootenv),1536k(kernel),-(root)"
rootpart_nor="/dev/mtdblock3"
nand_parts="256k(uboot)ro,128k(ubootenv),1536k(kernel),-(root)"
rootpart_nand="/dev/mtdblock7"