From 728c19777997dd0a8b83448c2bfae881b57d4b84 Mon Sep 17 00:00:00 2001 From: Przemyslaw Marczak Date: Fri, 15 May 2015 16:26:15 +0200 Subject: samsung: define autoboot command in external header Change-Id: Ifb3f73392246b0585b486ffd9fd4ef43870d6d01 Signed-off-by: Przemyslaw Marczak --- include/samsung/platform_boot.h | 80 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 include/samsung/platform_boot.h diff --git a/include/samsung/platform_boot.h b/include/samsung/platform_boot.h new file mode 100644 index 0000000000..17ec079693 --- /dev/null +++ b/include/samsung/platform_boot.h @@ -0,0 +1,80 @@ +#ifndef _INCLUDE_PLATFORM_BOOT_ +#define _INCLUDE_PLATFORM_BOOT_ + +/* + * Default boot environment for Samsung Platform + * For board config file: + * - add: #include + * - add PLATFORM_BOOT_INFO to CONFIG_EXTRA_ENV_SETTINGS + * - add checkboard macro to CONFIG_EXTRA_ENV_SETTINGS + * e.g.: + * #define CONFIG_EXTRA_ENV_SETTINGS \ + * PLATFORM_BOOT_INFO \ + * "checkboard=\0" \ + * ... + * - add: #define CONFIG_BOOTCOMMAND "run autoboot" + * + * The above changes may need undef the existing configs. + * #undef CONFIG_BOOTCOMMAND + * #undef CONFIG_EXTRA_ENV_SETTINGS + * Note: Add the #undef before the new definitions. + */ + +#define PLATFORM_BOOT_INFO \ + "initrdname=uInitrd\0" \ + "initrdaddr=42000000\0" \ + "fdtaddr=40800000\0" \ + "loadkernel=load mmc ${mmcbootdev}:${mmcbootpart} ${kerneladdr} " \ + "${kernelname}\0" \ + "loadinitrd=load mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \ + "${initrdname}\0" \ + "loaddtb=load mmc ${mmcbootdev}:${mmcbootpart} ${fdtaddr} " \ + "${fdtfile}\0" \ + "check_ramdisk=" \ + "if run loadinitrd; then " \ + "setenv initrd_addr ${initrdaddr};" \ + "else " \ + "setenv initrd_addr -;" \ + "fi;\0" \ + "check_dtb=" \ + "if run loaddtb; then " \ + "setenv fdt_addr ${fdtaddr};" \ + "else " \ + "setenv fdt_addr;" \ + "fi;\0" \ + "kernel_args=" \ + "setenv bootargs root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \ + " rootfstype=${rootfstype} rootwait ${console} ${opts}\0" \ + "boot_fit=" \ + "setenv kerneladdr 0x42000000;" \ + "setenv kernelname Image.itb;" \ + "run loadkernel;" \ + "run kernel_args;" \ + "bootm ${kerneladdr}#${boardname}\0" \ + "boot_uimg=" \ + "setenv kerneladdr 0x40007FC0;" \ + "setenv kernelname uImage;" \ + "run check_dtb;" \ + "run check_ramdisk;" \ + "run loadkernel;" \ + "run kernel_args;" \ + "bootm ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \ + "boot_zimg=" \ + "setenv kerneladdr 0x40007FC0;" \ + "setenv kernelname zImage;" \ + "run check_dtb;" \ + "run check_ramdisk;" \ + "run loadkernel;" \ + "run kernel_args;" \ + "bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \ + "autoboot=" \ + "run checkboard;" \ + "if test -e mmc 0:${mmcbootpart} Image.itb; then; " \ + "run boot_fit;" \ + "elif test -e mmc 0:${mmcbootpart} zImage; then; " \ + "run boot_zimg;" \ + "elif test -e mmc 0:${mmcbootpart} uImage; then; " \ + "run boot_uimg;" \ + "fi;\0" + +#endif -- cgit v1.2.3