samsung: tizen_riscv: Reorganise environment defaults for RISC-V
[platform/kernel/u-boot.git] / include / samsung / tizen_riscv.h
1 /*
2  * Copyright (C) 2023 Samsung Electronics
3  *
4  * Configuration settings for the Tizen on VisionFive2 board and QEMU.
5  *
6  * SPDX-License-Identifier:     GPL-2.0+
7  */
8
9 #ifndef __CONFIG_TIZEN_RISCV_H
10 #define __CONFIG_TIZEN_RISCV_H
11
12 #ifdef CONFIG_TARGET_STARFIVE_VISIONFIVE2
13 #define TIZEN_TARGET_ENV_SETTING \
14         "bootdevnum=1\0"                        \
15         "bootdevtype=mmc\0"                     \
16         ""
17 #elif defined(CONFIG_TARGET_QEMU_VIRT)
18 #define TIZEN_TARGET_ENV_SETTING \
19         "bootdevnum=0\0"                        \
20         "bootdevtype=virtio\0"                  \
21         ""
22 #else /* CONFIG_TARGET_* */
23 #define TIZEN_TARGET_ENV_SETTING ""
24 #endif /* CONFIG_TARGET_* */
25
26 #define CLEAR_REBOOT_PARAM \
27         "mw.l ${rebootparam_addr} ${normal_val} ; "                                             \
28         "ext4write ${bootdevtype} ${bootdevnum}:${informpart} ${rebootparam_addr} /${rebootparamfile} 8; "
29
30 /* SD/MMC configuration */
31 #define CONFIG_MMC_DEFAULT_DEV  1
32
33 #define KERNEL_NAME     "Image"
34
35 #define TIZEN_ENV_SETTING \
36         TIZEN_TARGET_ENV_SETTING                \
37         "kernel=" KERNEL_NAME "\0"              \
38         "bootpart=3\0"                  \
39         "rootpart=5\0"                  \
40         "informpart=0xb\0"                      \
41         "rebootparamfile=reboot-param.bin\0"    \
42         "slotfile=partition-ab.info\0"  \
43         "slot_addr=0x82200000\0"                \
44         "rebootparam_addr=0x82100000\0"         \
45         "upgrade_val=72677075\0"                \
46         "recovery_val=72766372\0"               \
47         "nodef_val=6665646e\0"                  \
48         "normal_val=6d726f6e\0"                 \
49         "download_val=6c6e7764\0"               \
50         "ramdiskpart=9\0"                       \
51         "part=9\0"                              \
52         "bootmode=ramdisk\0"                    \
53         "tfm=setenv bootmode download; run bootcmd\0"   \
54         "tizen_bootarg= \0"     \
55         "opts=loglevel=7\0"                     \
56         "reboot_param_clear=" CLEAR_REBOOT_PARAM "\0"                           \
57         ""
58
59 #endif /* __CONFIG_TIZEN_RISCV_H */