summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandy.hu <andy.hu@starfivetech.com>2023-03-17 13:08:30 +0300
committerandy.hu <andy.hu@starfivetech.com>2023-03-17 13:08:30 +0300
commit6d6509830845b9f3c2752519726b443454795a76 (patch)
tree924ee797718dfc1268c7412cf3ce5ea76b2a68e3
parentd4dedcadbc2e80be5b91556b7b1f14cd28c9d0e1 (diff)
parent2f68eec8b4838ac03a07ee27fe0c1ebfe17fedb0 (diff)
downloadu-boot-6d6509830845b9f3c2752519726b443454795a76.tar.xz
Merge branch 'CR_3910_Add_cpu_vol_mason.huo' into 'jh7110-master'
CR_3910 board: starfive: jh7110: Add 1.1 & 1.02v max cpu voltage See merge request sdk/u-boot!40
-rw-r--r--board/starfive/evb/starfive_evb.c10
-rw-r--r--include/configs/starfive-evb.h16
2 files changed, 24 insertions, 2 deletions
diff --git a/board/starfive/evb/starfive_evb.c b/board/starfive/evb/starfive_evb.c
index e1e3f2dbc4..c219252b09 100644
--- a/board/starfive/evb/starfive_evb.c
+++ b/board/starfive/evb/starfive_evb.c
@@ -26,9 +26,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) \
@@ -209,14 +211,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;
diff --git a/include/configs/starfive-evb.h b/include/configs/starfive-evb.h
index b9587ff043..d9f1e9aeb2 100644
--- a/include/configs/starfive-evb.h
+++ b/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" \