summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrzemyslaw Marczak <p.marczak@samsung.com>2015-05-15 16:26:15 +0200
committerPrzemyslaw Marczak <p.marczak@samsung.com>2015-05-18 11:54:53 +0200
commit728c19777997dd0a8b83448c2bfae881b57d4b84 (patch)
treeab36c2af85f4925e79a457deeb0bd8e11ebd81ec
parent47ec51afc21997f6eebad16a0e031f2d31c89e73 (diff)
downloadu-boot-728c19777997dd0a8b83448c2bfae881b57d4b84.tar.gz
u-boot-728c19777997dd0a8b83448c2bfae881b57d4b84.tar.bz2
u-boot-728c19777997dd0a8b83448c2bfae881b57d4b84.zip
samsung: define autoboot command in external header
Change-Id: Ifb3f73392246b0585b486ffd9fd4ef43870d6d01 Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
-rw-r--r--include/samsung/platform_boot.h80
1 files changed, 80 insertions, 0 deletions
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 <samsung/platform_boot.h>
+ * - 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