From: Jaehoon Chung Date: Wed, 27 Sep 2017 06:06:10 +0000 (+0900) Subject: artik530: set the booting device in environemnt value X-Git-Tag: submit/tizen/20180327.075642~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc2e1a3bda9dbb0a33aec615a596910143eae0ee;p=profile%2Fcommon%2Fplatform%2Fkernel%2Fu-boot-artik7.git artik530: set the booting device in environemnt value set_booting_device shoud be set dynamically after checking OM pin. eMMC boot - bootdev = mmcblk0 (rootdev = 0) SD boot - bootdev = mmcblk1 (rootdev = 1) The 'bootdev' env variable should be passed to kernel side after including it in cmdline. Change-Id: Ib24351a87050d11bac39b26269f152e05acd4426 Signed-off-by: Jaehoon Chung --- diff --git a/board/nexell/s5p4418/artik530_raptor/board.c b/board/nexell/s5p4418/artik530_raptor/board.c index 9b3f685ba4..70e608dce9 100644 --- a/board/nexell/s5p4418/artik530_raptor/board.c +++ b/board/nexell/s5p4418/artik530_raptor/board.c @@ -208,6 +208,26 @@ int board_early_init_f(void) return 0; } +/* Set the environment value about booting from which device */ +static void set_booting_device(void) +{ + int port_num; + int boot_mode = readl(PHY_BASEADDR_CLKPWR + SYSRSTCONFIG); + + if ((boot_mode & BOOTMODE_MASK) == BOOTMODE_SDMMC) { + port_num = readl(PHY_BASEADDR_SRAM + DEVICEBOOTINFO); + /* + * Kernel will be detected as the below block devices. + * mmcblk0 - eMMC card + * mmcblk1 - SD card + */ + if (port_num == EMMC_PORT_NUM) + setenv("rootdev", "0"); + else if (port_num == SD_PORT_NUM) + setenv("rootdev", "1"); + } +} + int mmc_get_env_dev(void) { int port_num; @@ -374,6 +394,8 @@ int board_late_init(void) #ifdef CONFIG_ARTIK_OTA check_ota_update(); #endif + set_booting_device(); + return 0; } diff --git a/include/configs/artik530_raptor.h b/include/configs/artik530_raptor.h index 761db4e4df..e55a276ad0 100644 --- a/include/configs/artik530_raptor.h +++ b/include/configs/artik530_raptor.h @@ -473,7 +473,7 @@ "setenv bootargs ${console} " \ "root=/dev/ram0 ${root_rw} " \ "${opts} ${recoverymode} " \ - "drm_panel=$lcd_panel;" \ + "drm_panel=$lcd_panel bootdev=mmcblk${rootdev};" \ "fi;" \ "ext4load mmc ${rootdev}:${bootpart} $ramdiskaddr $ramdisk_file\0" \ "boot_cmd_initrd=" \