From b1c2a7ae32b6c5dd1dcb7cb29c862af01523ba36 Mon Sep 17 00:00:00 2001 From: Gerlando Falauto Date: Mon, 27 Jan 2014 16:58:28 +0100 Subject: arm/km: define fdt_high env variable and allow backwards compatibility Add set_fdthigh subcommand to "subbootcmds" (release) so to set "fdt_high" This is necessary on Kirkwood so that the FDT does not get relocated above the memory limit that the kernel cannot access (that is the memory part reserved for the switch). This was tested on NUSA1, where it is necessary, and on ETER1, where it doesn't seem to hurt. We want the scripts to also work with older versions of u-boot, where: a) set_fdthigh is not defined (will be default env for newer u-boots) b) the fdt will not be available For this reason, we use "set_fdthigh" to tell whether we are running a newer (FDT-aware) u-boot or not. So if "set_fdthigh" runs successfully or arch != arm we try loading the fdt; otherwise we proceed normally. Notice how, contrary to release mode, set_fdthigh will _not_ be part of subbootcmds for develop and ramfs, but will be executed as part of "tftpfdt". Since this is only needed for kirkwood cards, and it prevents the kernel from booting on QorIQ (though it seemed to work on ETER1), we change its definition in the default env for powerpc so that the value is only set on ARM. Signed-off-by: Valentin Longchamp Signed-off-by: Gerlando Falauto Signed-off-by: Holger Brunck Acked-by: Valentin Longchamp --- board/keymile/scripts/develop-common.txt | 2 +- board/keymile/scripts/ramfs-common.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'board') diff --git a/board/keymile/scripts/develop-common.txt b/board/keymile/scripts/develop-common.txt index f49b26a233..a80812a5d0 100644 --- a/board/keymile/scripts/develop-common.txt +++ b/board/keymile/scripts/develop-common.txt @@ -3,7 +3,7 @@ bootcmd=run ${subbootcmds} configure=run set_uimage; km_setboardid && saveenv && reset subbootcmds=tftpfdt tftpkernel nfsargs add_default boot nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${toolchain}/${arch} -tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb +tftpfdt=if run set_fdthigh || test ${arch} != arm; then tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb; else true; fi tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage} toolchain=/opt/eldk rootfssize=0 diff --git a/board/keymile/scripts/ramfs-common.txt b/board/keymile/scripts/ramfs-common.txt index 0cfb36fba0..d79ad2e21b 100644 --- a/board/keymile/scripts/ramfs-common.txt +++ b/board/keymile/scripts/ramfs-common.txt @@ -7,7 +7,7 @@ nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath} configure=run set_uimage; km_setboardid && saveenv && reset rootfsfile=${hostname}/rootfsImage setrootfsaddr=setexpr value ${pnvramaddr} - ${rootfssize} && setenv rootfsaddr 0x${value} -tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb +tftpfdt=if run set_fdthigh || test ${arch} != arm; then tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb; else true; fi tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage} tftpramfs=tftpboot ${rootfsaddr} ${hostname}/rootfsImage set_uimage=printenv uimage || setenv uimage uImage -- cgit v1.2.1