summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMason Huo <mason.huo@starfivetech.com>2023-06-05 11:09:51 +0300
committerMason Huo <mason.huo@starfivetech.com>2023-06-05 11:09:55 +0300
commit25951fb946194206188682276d0c6d7ca0422e77 (patch)
tree565212fb4d5ee34f809710da1f11d287831f7065
parentd64059f32b47568913ac1f71096d0734386f2d44 (diff)
downloadu-boot-25951fb946194206188682276d0c6d7ca0422e77.tar.xz
board: starfive: jh7110: Add support for 1.25GHz chips
Remove max cpu voltages: 1.12v, 1.10v, 1.08v. Set the cpu max frequency to 1.25G per OTP value. Signed-off-by: Mason Huo <mason.huo@starfivetech.com>
-rw-r--r--board/starfive/evb/starfive_evb.c14
-rw-r--r--include/configs/starfive-evb.h60
2 files changed, 33 insertions, 41 deletions
diff --git a/board/starfive/evb/starfive_evb.c b/board/starfive/evb/starfive_evb.c
index 915ed1d4f9..6e3fc641ba 100644
--- a/board/starfive/evb/starfive_evb.c
+++ b/board/starfive/evb/starfive_evb.c
@@ -30,9 +30,7 @@ enum cpu_voltage_type_t {
CPU_VOL_1020 = 0xef0,
CPU_VOL_1040 = 0xfff,
CPU_VOL_1060 = 0xff0,
- CPU_VOL_1080 = 0xfe0,
- CPU_VOL_1100 = 0xf80,
- CPU_VOL_1120 = 0xf00,
+ CPU_VOL_1000 = 0x8f0,
};
#define CPU_VOL_MASK 0xfff
@@ -215,14 +213,8 @@ static void get_cpu_voltage_type(struct udevice *dev)
printf("%s: error reading CPU vol from OTP\n", __func__);
else {
switch ((buf & CPU_VOL_MASK)) {
- case CPU_VOL_1120:
- env_set("cpu_max_vol", "1120000");
- break;
- case CPU_VOL_1100:
- env_set("cpu_max_vol", "1100000");
- break;
- case CPU_VOL_1080:
- env_set("cpu_max_vol", "1080000");
+ case CPU_VOL_1000:
+ env_set("cpu_max_vol", "1000000");
break;
case CPU_VOL_1060:
env_set("cpu_max_vol", "1060000");
diff --git a/include/configs/starfive-evb.h b/include/configs/starfive-evb.h
index 5f856026d4..362a5fe7de 100644
--- a/include/configs/starfive-evb.h
+++ b/include/configs/starfive-evb.h
@@ -112,32 +112,33 @@
"cpu_vol_1060_set=" \
"fdt set /opp-table-0/opp-1500000000 opp-microvolt <1060000>;\0"
-#define CPU_VOL_1080_SET \
- "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_1120_SET \
- "cpu_vol_1120_set=" \
- "fdt set /opp-table-0/opp-1500000000 opp-microvolt <1120000>;\0"
-
-#define CPU_VOL_SET \
- "cpu_vol_set=" \
- "if test ${cpu_max_vol} = 1120000; then " \
- "run cpu_vol_1120_set;" \
- "elif 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;" \
+#define CPU_SPEED_1250_SET \
+ "cpu_speed_1250_set=" \
+ "fdt rm /opp-table-0/opp-375000000;" \
+ "fdt rm /opp-table-0/opp-500000000;" \
+ "fdt rm /opp-table-0/opp-750000000;" \
+ "fdt rm /opp-table-0/opp-1500000000;\0"
+
+#define CPU_SPEED_1500_SET \
+ "cpu_speed_1500_set=" \
+ "fdt rm /opp-table-0/opp-312500000;" \
+ "fdt rm /opp-table-0/opp-417000000;" \
+ "fdt rm /opp-table-0/opp-625000000;" \
+ "fdt rm /opp-table-0/opp-1250000000;\0"
+
+#define CPU_FREQ_VOL_SET \
+ "cpu_vol_set=" \
+ "if test ${cpu_max_vol} = 1000000; then " \
+ "run cpu_speed_1250_set; " \
+ "else " \
+ "run cpu_speed_1500_set; " \
+ "if 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; " \
"fi; \0"
#define EVB_BOOTENV_NVME \
@@ -195,10 +196,9 @@
CPU_VOL_1020_SET \
CPU_VOL_1040_SET \
CPU_VOL_1060_SET \
- CPU_VOL_1080_SET \
- CPU_VOL_1100_SET \
- CPU_VOL_1120_SET \
- CPU_VOL_SET \
+ CPU_SPEED_1250_SET \
+ CPU_SPEED_1500_SET \
+ CPU_FREQ_VOL_SET \
"type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \
"type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \
"type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \