samsung: tizen_riscv: Reorganise environment defaults for RISC-V
authorŁukasz Stelmach <l.stelmach@samsung.com>
Wed, 2 Aug 2023 07:26:29 +0000 (09:26 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 17 Oct 2023 11:02:45 +0000 (20:02 +0900)
Rename, reorganize and use the default envitonment settings in the header
file for both VisionFive2 and QEMU targets.

Change-Id: Ic6ab2c5b2dc146d232a54eab6727afce845c1353
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
include/configs/qemu-riscv.h
include/configs/starfive-visionfive2.h
include/samsung/tizen_riscv.h [moved from include/samsung/tizen_visionfive2.h with 72% similarity]

index 584559c..ccd97e3 100644 (file)
@@ -7,6 +7,7 @@
 #define __CONFIG_H
 
 #include <linux/sizes.h>
+#include <samsung/tizen_riscv.h>
 
 #define CFG_SYS_SDRAM_BASE             0x80000000
 
@@ -30,6 +31,7 @@
 
 #define CFG_EXTRA_ENV_SETTINGS \
        CFG_STD_DEVICES_SETTINGS \
+       TIZEN_ENV_SETTING \
        "fdt_high=0xffffffffffffffff\0" \
        "initrd_high=0xffffffffffffffff\0" \
        "kernel_addr_r=0x84000000\0" \
index e75ee8a..123d94e 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef _STARFIVE_VISIONFIVE2_H
 #define _STARFIVE_VISIONFIVE2_H
 
-#include <samsung/tizen_visionfive2.h>
+#include <samsung/tizen_riscv.h>
 
 #define RISCV_MMODE_TIMERBASE          0x2000000
 #define RISCV_MMODE_TIMEROFF           0xbff8
similarity index 72%
rename from include/samsung/tizen_visionfive2.h
rename to include/samsung/tizen_riscv.h
index 8bf0974..1226bee 100644 (file)
@@ -6,8 +6,22 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#ifndef __CONFIG_TIZEN_VISIONFIVE2_H
-#define __CONFIG_TIZEN_VISIONFIVE2_H
+#ifndef __CONFIG_TIZEN_RISCV_H
+#define __CONFIG_TIZEN_RISCV_H
+
+#ifdef CONFIG_TARGET_STARFIVE_VISIONFIVE2
+#define TIZEN_TARGET_ENV_SETTING \
+       "bootdevnum=1\0"                        \
+       "bootdevtype=mmc\0"                     \
+       ""
+#elif defined(CONFIG_TARGET_QEMU_VIRT)
+#define TIZEN_TARGET_ENV_SETTING \
+       "bootdevnum=0\0"                        \
+       "bootdevtype=virtio\0"                  \
+       ""
+#else /* CONFIG_TARGET_* */
+#define TIZEN_TARGET_ENV_SETTING ""
+#endif /* CONFIG_TARGET_* */
 
 #define CLEAR_REBOOT_PARAM \
        "mw.l ${rebootparam_addr} ${normal_val} ; "                                             \
@@ -19,8 +33,8 @@
 #define KERNEL_NAME    "Image"
 
 #define TIZEN_ENV_SETTING \
+       TIZEN_TARGET_ENV_SETTING                \
        "kernel=" KERNEL_NAME "\0"              \
-       "bootdevnum=1\0"                        \
        "bootpart=3\0"                  \
        "rootpart=5\0"                  \
        "informpart=0xb\0"                      \
        "ramdiskpart=9\0"                       \
        "part=9\0"                              \
        "bootmode=ramdisk\0"                    \
-       "bootdevtype=mmc\0"                     \
        "tfm=setenv bootmode download; run bootcmd\0"   \
        "tizen_bootarg= \0"     \
        "opts=loglevel=7\0"                     \
        "reboot_param_clear=" CLEAR_REBOOT_PARAM "\0"                           \
        ""
 
-#endif /* __CONFIG_TIZEN_VISIONFIVE2_H */
+#endif /* __CONFIG_TIZEN_RISCV_H */