From: Jaehoon Chung Date: Thu, 9 Feb 2017 10:06:39 +0000 (+0900) Subject: samsung: platform_boot: add ramdisk booting about autoboot X-Git-Tag: submit/tizen/20170220.031841~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a60c99ea4e9c37825ab3926d1bd10a5ce4640b79;p=platform%2Fkernel%2Fu-boot.git samsung: platform_boot: add ramdisk booting about autoboot If it needs to boot from ramdisk, root device must be /dev/ram0. But current root device is hard-coding as /dev/mmcblk0p2. When there is ramdisk image, set to root=/dev/ram0. Otherwise maintain the current root device(root=/dev/mmcblk0p2). After this patch, tizen can use the raw ramdisk image without any converting. This patch is also maintaining backward compatibility about not using ramdisk. Change-Id: I5463cfc8067cfe2f7c591ba689269c8d8ea51a0c Signed-off-by: Jaehoon Chung --- diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h index 5d8d65f127..7df97d44da 100644 --- a/include/configs/odroid_xu3.h +++ b/include/configs/odroid_xu3.h @@ -102,6 +102,7 @@ "zImage fat 0 1;" \ "Image.itb fat 0 1;" \ "uInitrd fat 0 1;" \ + "ramdisk.img fat 0 1;" \ "boot.scr fat 0 1;" \ "boot.cmd fat 0 1;" \ "exynos5422-odroidxu3.dtb fat 0 1;" \ diff --git a/include/samsung/platform_boot.h b/include/samsung/platform_boot.h index 17ec079693..996b80c856 100644 --- a/include/samsung/platform_boot.h +++ b/include/samsung/platform_boot.h @@ -23,16 +23,27 @@ #define PLATFORM_BOOT_INFO \ "initrdname=uInitrd\0" \ "initrdaddr=42000000\0" \ + "initrdsize=800000\0" \ "fdtaddr=40800000\0" \ + "root_dev=/dev/mmcblk${mmcrootdev}p${mmcrootpart}\0" \ + "root_device=setenv root_dev /dev/mmcblk${mmcrootdev}p${mmcrootpart}\0" \ "loadkernel=load mmc ${mmcbootdev}:${mmcbootpart} ${kerneladdr} " \ "${kernelname}\0" \ - "loadinitrd=load mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \ - "${initrdname}\0" \ + "loadinitrd=" \ + "if test -e mmc ${mmcbootdev}:${mmcbootpart} ramdisk.img; then " \ + "setenv initrdname ramdisk.img;" \ + "load mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \ + "${initrdname};" \ + "else " \ + "load mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \ + "${initrdname};" \ + "fi;\0" \ "loaddtb=load mmc ${mmcbootdev}:${mmcbootpart} ${fdtaddr} " \ "${fdtfile}\0" \ "check_ramdisk=" \ "if run loadinitrd; then " \ - "setenv initrd_addr ${initrdaddr};" \ + "setenv initrd_addr ${initrdaddr}:${initrdsize}; " \ + "setenv root_dev /dev/ram0 rw;" \ "else " \ "setenv initrd_addr -;" \ "fi;\0" \ @@ -43,7 +54,7 @@ "setenv fdt_addr;" \ "fi;\0" \ "kernel_args=" \ - "setenv bootargs root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \ + "setenv bootargs root=${root_dev}" \ " rootfstype=${rootfstype} rootwait ${console} ${opts}\0" \ "boot_fit=" \ "setenv kerneladdr 0x42000000;" \ @@ -69,6 +80,7 @@ "bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \ "autoboot=" \ "run checkboard;" \ + "run root_device;" \ "if test -e mmc 0:${mmcbootpart} Image.itb; then; " \ "run boot_fit;" \ "elif test -e mmc 0:${mmcbootpart} zImage; then; " \