diff options
author | Jaehoon Chung <jh80.chung@samsung.com> | 2017-02-09 19:06:39 +0900 |
---|---|---|
committer | Jaehoon Chung <jh80.chung@samsung.com> | 2017-04-11 18:58:18 +0900 |
commit | 0ffce3ae623e24d852ce14374f87ff6f0275436d (patch) | |
tree | 745dad56f8aea20d00e8876c27ed5971deeff99e | |
parent | fcc0f325cbf02aec2422e68e04f9512b10eb9055 (diff) | |
download | u-boot-0ffce3ae623e24d852ce14374f87ff6f0275436d.tar.gz u-boot-0ffce3ae623e24d852ce14374f87ff6f0275436d.tar.bz2 u-boot-0ffce3ae623e24d852ce14374f87ff6f0275436d.zip |
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 <jh80.chung@samsung.com>
-rw-r--r-- | include/configs/odroid_xu3.h | 1 | ||||
-rw-r--r-- | include/samsung/platform_boot.h | 20 |
2 files changed, 17 insertions, 4 deletions
diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h index 5c2db2f0af..db988297a2 100644 --- a/include/configs/odroid_xu3.h +++ b/include/configs/odroid_xu3.h @@ -78,6 +78,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; " \ |