Browse Source

Merge tag 'JH7110_515_SDK_v4.5.1' into vf2-devel

version JH7110_515_SDK_v4.5.1 for JH7110 EVB board

1. #4094: u-boot: update uboot logo display function
2. #3910: u-boot: add 1.1 & 1.02v max cpu voltage to enhance cpu binning voltage type
Andy Hu 1 year ago
parent
commit
d72f5788df

+ 15 - 0
arch/riscv/Kconfig

@@ -161,6 +161,21 @@ config RISCV_ISA_C
 	  when building U-Boot, which results in compressed instructions in the
 	  U-Boot binary.
 
+config RISCV_ISA_F
+	bool "Standard extension for Single-Precision Floating Point"
+	default y
+	help
+	  Adds "F" to the ISA string passed to the compiler.
+
+config RISCV_ISA_D
+	bool "Standard extension for Double-Precision Floating Point"
+	depends on RISCV_ISA_F
+	default y
+	help
+	  Adds "D" to the ISA string passed to the compiler and changes the
+	  riscv32 ABI from ilp32 to ilp32d and the riscv64 ABI from lp64 to
+	  lp64d.
+
 config RISCV_ISA_A
 	def_bool y
 

+ 21 - 3
arch/riscv/Makefile

@@ -5,15 +5,22 @@
 
 ifeq ($(CONFIG_ARCH_RV64I),y)
 	ARCH_BASE = rv64im
-	ABI = lp64
+	ABI_BASE = lp64
 endif
 ifeq ($(CONFIG_ARCH_RV32I),y)
 	ARCH_BASE = rv32im
-	ABI = ilp32
+	ABI_BASE = ilp32
 endif
 ifeq ($(CONFIG_RISCV_ISA_A),y)
 	ARCH_A = a
 endif
+ifeq ($(CONFIG_RISCV_ISA_F),y)
+	ARCH_F = f
+endif
+ifeq ($(CONFIG_RISCV_ISA_D),y)
+	ARCH_D = d
+	ABI_D = d
+endif
 ifeq ($(CONFIG_RISCV_ISA_C),y)
 	ARCH_C = c
 endif
@@ -24,7 +31,18 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y)
 	CMODEL = medany
 endif
 
-ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
+
+RISCV_MARCH = $(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_D)$(ARCH_C)
+ABI = $(ABI_BASE)$(ABI_D)
+
+# Newer binutils versions default to ISA spec version 20191213 which moves some
+# instructions from the I extension to the Zicsr and Zifencei extensions.
+toolchain-need-zicsr-zifencei := $(call cc-option-yn, -mabi=$(ABI) -march=$(RISCV_MARCH)_zicsr_zifencei)
+ifeq ($(toolchain-need-zicsr-zifencei),y)
+	RISCV_MARCH := $(RISCV_MARCH)_zicsr_zifencei
+endif
+
+ARCH_FLAGS = -march=$(RISCV_MARCH) -mabi=$(ABI) \
 	     -mcmodel=$(CMODEL)
 
 PLATFORM_CPPFLAGS	+= $(ARCH_FLAGS)

+ 9 - 1
board/starfive/evb/starfive_evb.c

@@ -27,9 +27,11 @@ enum chip_type_t {
 };
 
 enum cpu_voltage_type_t {
+	CPU_VOL_1020 = 0x0e,
 	CPU_VOL_1040 = 0xff,
 	CPU_VOL_1060 = 0xf0,
 	CPU_VOL_1080 = 0xf1,
+	CPU_VOL_1100 = 0xf2,
 };
 
 #define SYS_CLOCK_ENABLE(clk) \
@@ -210,14 +212,20 @@ static void get_cpu_voltage_type(struct udevice *dev)
 	if (ret != sizeof(buf))
 		printf("%s: error reading CPU vol from OTP\n", __func__);
 	else {
+		buf = 0x0e;
 		switch ((buf & 0xff)) {
+		case CPU_VOL_1100:
+			env_set("cpu_max_vol", "1100000");
+			break;
 		case CPU_VOL_1080:
 			env_set("cpu_max_vol", "1080000");
 			break;
 		case CPU_VOL_1060:
 			env_set("cpu_max_vol", "1060000");
 			break;
-		case CPU_VOL_1040:
+		case CPU_VOL_1020:
+			env_set("cpu_max_vol", "1020000");
+			break;
 		default:
 			env_set("cpu_max_vol", "1040000");
 			break;

+ 1 - 1
configs/starfive_evb_defconfig

@@ -25,7 +25,7 @@ CONFIG_QSPI_BOOT=y
 CONFIG_SD_BOOT=y
 CONFIG_SPI_BOOT=y
 CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="console=ttyS0,115200  debug rootwait  earlycon=sbi "
+CONFIG_BOOTARGS="console=tty1 console=ttyS0,115200  debug rootwait  earlycon=sbi "
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="fatload mmc 0:3 $kernel_addr_r jh7110_uEnv.txt; env import -t $kernel_addr_r $filesize;run boot2"
 CONFIG_USE_PREBOOT=y

+ 15 - 1
include/configs/starfive-evb.h

@@ -100,6 +100,10 @@
 #define TYPE_GUID_LOADER2	"2E54B353-1271-4842-806F-E436D6AF6985"
 #define TYPE_GUID_SYSTEM	"0FC63DAF-8483-4772-8E79-3D69D8477DE4"
 
+#define CPU_VOL_1020_SET \
+	"cpu_vol_1020_set=" 			\
+	"fdt set /opp-table-0/opp-1500000000 opp-microvolt <1020000>;\0"
+
 #define CPU_VOL_1040_SET \
 	"cpu_vol_1040_set="			\
 	"fdt set /opp-table-0/opp-1500000000 opp-microvolt <1040000>;\0"
@@ -112,12 +116,20 @@
 	"cpu_vol_1080_set="			\
 	"fdt set /opp-table-0/opp-1500000000 opp-microvolt <1080000>;\0"
 
+#define CPU_VOL_1100_SET \
+	"cpu_vol_1100_set=" 			\
+	"fdt set /opp-table-0/opp-1500000000 opp-microvolt <1100000>;\0"
+
 #define CPU_VOL_SET	\
 	"cpu_vol_set="				\
-	"if test ${cpu_max_vol} = 1080000; then "		\
+	"if test ${cpu_max_vol} = 1100000; then "	\
+		"run cpu_vol_1100_set;"			\
+	"elif test ${cpu_max_vol} = 1080000; then "	\
 		"run cpu_vol_1080_set;"			\
 	"elif test ${cpu_max_vol} = 1060000; then "	\
 		"run cpu_vol_1060_set;"			\
+	"elif test ${cpu_max_vol} = 1020000; then "	\
+		"run cpu_vol_1020_set;"			\
 	"else "						\
 		"run cpu_vol_1040_set;"			\
 	"fi; \0"
@@ -157,9 +169,11 @@
 	"ramdisk_addr_r=0x46100000\0"			\
 	CHIPA_GMAC_SET					\
 	CHIPA_SET					\
+	CPU_VOL_1020_SET				\
 	CPU_VOL_1040_SET				\
 	CPU_VOL_1060_SET				\
 	CPU_VOL_1080_SET				\
+	CPU_VOL_1100_SET				\
 	CPU_VOL_SET					\
 	"type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \
 	"type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \