From: Łukasz Stelmach Date: Wed, 2 Aug 2023 07:26:29 +0000 (+0200) Subject: samsung: tizen_riscv: Reorganise environment defaults for RISC-V X-Git-Tag: accepted/tizen/unified/riscv/20230821.130836~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2578df3c59a191c91a81b267d25b57d59901c19f;p=platform%2Fkernel%2Fu-boot.git samsung: tizen_riscv: Reorganise environment defaults for RISC-V 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 --- diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h index d81e5d6c86..671a00a8a9 100644 --- a/include/configs/qemu-riscv.h +++ b/include/configs/qemu-riscv.h @@ -7,6 +7,7 @@ #define __CONFIG_H #include +#include #define CONFIG_SYS_SDRAM_BASE 0x80000000 @@ -37,6 +38,7 @@ "qemu " #define CONFIG_EXTRA_ENV_SETTINGS \ + TIZEN_ENV_SETTING \ "fdt_high=0xffffffffffffffff\0" \ "initrd_high=0xffffffffffffffff\0" \ "kernel_addr_r=0x84000000\0" \ diff --git a/include/configs/starfive-visionfive2.h b/include/configs/starfive-visionfive2.h index 7c259ec99d..7da8f2e4d1 100644 --- a/include/configs/starfive-visionfive2.h +++ b/include/configs/starfive-visionfive2.h @@ -8,7 +8,7 @@ #ifndef _STARFIVE_VISIONFIVE2_H #define _STARFIVE_VISIONFIVE2_H -#include +#include #define RISCV_MMODE_TIMERBASE 0x2000000 #define RISCV_MMODE_TIMER_FREQ 4000000 diff --git a/include/samsung/tizen_riscv.h b/include/samsung/tizen_riscv.h new file mode 100644 index 0000000000..1226beea96 --- /dev/null +++ b/include/samsung/tizen_riscv.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2023 Samsung Electronics + * + * Configuration settings for the Tizen on VisionFive2 board and QEMU. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#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} ; " \ + "ext4write ${bootdevtype} ${bootdevnum}:${informpart} ${rebootparam_addr} /${rebootparamfile} 8; " + +/* SD/MMC configuration */ +#define CONFIG_MMC_DEFAULT_DEV 1 + +#define KERNEL_NAME "Image" + +#define TIZEN_ENV_SETTING \ + TIZEN_TARGET_ENV_SETTING \ + "kernel=" KERNEL_NAME "\0" \ + "bootpart=3\0" \ + "rootpart=5\0" \ + "informpart=0xb\0" \ + "rebootparamfile=reboot-param.bin\0" \ + "slotfile=partition-ab.info\0" \ + "slot_addr=0x82200000\0" \ + "rebootparam_addr=0x82100000\0" \ + "upgrade_val=72677075\0" \ + "recovery_val=72766372\0" \ + "nodef_val=6665646e\0" \ + "normal_val=6d726f6e\0" \ + "download_val=6c6e7764\0" \ + "ramdiskpart=9\0" \ + "part=9\0" \ + "bootmode=ramdisk\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_RISCV_H */ diff --git a/include/samsung/tizen_visionfive2.h b/include/samsung/tizen_visionfive2.h deleted file mode 100644 index 8bf09744c9..0000000000 --- a/include/samsung/tizen_visionfive2.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2023 Samsung Electronics - * - * Configuration settings for the Tizen on VisionFive2 board and QEMU. - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#ifndef __CONFIG_TIZEN_VISIONFIVE2_H -#define __CONFIG_TIZEN_VISIONFIVE2_H - -#define CLEAR_REBOOT_PARAM \ - "mw.l ${rebootparam_addr} ${normal_val} ; " \ - "ext4write ${bootdevtype} ${bootdevnum}:${informpart} ${rebootparam_addr} /${rebootparamfile} 8; " - -/* SD/MMC configuration */ -#define CONFIG_MMC_DEFAULT_DEV 1 - -#define KERNEL_NAME "Image" - -#define TIZEN_ENV_SETTING \ - "kernel=" KERNEL_NAME "\0" \ - "bootdevnum=1\0" \ - "bootpart=3\0" \ - "rootpart=5\0" \ - "informpart=0xb\0" \ - "rebootparamfile=reboot-param.bin\0" \ - "slotfile=partition-ab.info\0" \ - "slot_addr=0x82200000\0" \ - "rebootparam_addr=0x82100000\0" \ - "upgrade_val=72677075\0" \ - "recovery_val=72766372\0" \ - "nodef_val=6665646e\0" \ - "normal_val=6d726f6e\0" \ - "download_val=6c6e7764\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 */