summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMason Huo <mason.huo@starfivetech.com>2024-02-07 05:23:33 +0300
committerMason Huo <mason.huo@starfivetech.com>2024-02-07 05:55:20 +0300
commitf0e66d4fd3a6a9e7cbee4b3a47d65b397b2cfa26 (patch)
tree215cb231a85be59ca54c27edf0014ff004d1a275
parent7277a071034220c99a6d8beffddef277725e9475 (diff)
downloadu-boot-f0e66d4fd3a6a9e7cbee4b3a47d65b397b2cfa26.tar.xz
board: starfive: Add the default cpu max voltage
The system will read cpu info from OTP, but if the OTP read fails or OTP driver is not enabled, then the cpu voltage script will fail to delete cpu frequencies node in dts file. Add the default cpu max voltage to avoid these corner cases. Signed-off-by: Mason Huo <mason.huo@starfivetech.com>
-rw-r--r--board/starfive/devkits/starfive_devkits.c3
-rw-r--r--board/starfive/evb/starfive_evb.c4
-rw-r--r--board/starfive/visionfive2/starfive_visionfive2.c4
3 files changed, 8 insertions, 3 deletions
diff --git a/board/starfive/devkits/starfive_devkits.c b/board/starfive/devkits/starfive_devkits.c
index 741c190d2e..66c1918e31 100644
--- a/board/starfive/devkits/starfive_devkits.c
+++ b/board/starfive/devkits/starfive_devkits.c
@@ -219,7 +219,6 @@ static void get_cpu_voltage_type(struct udevice *dev)
env_set("cpu_max_vol", "1020000");
break;
default:
- env_set("cpu_max_vol", "1040000");
break;
}
}
@@ -361,6 +360,8 @@ err:
eth_env_set_enetaddr("eth0addr", mac0);
eth_env_set_enetaddr("eth1addr", mac1);
+ /* Set the default cpu max voltage. */
+ env_set("cpu_max_vol", "1040000");
#if CONFIG_IS_ENABLED(STARFIVE_OTP)
get_cpu_voltage_type(dev);
#endif
diff --git a/board/starfive/evb/starfive_evb.c b/board/starfive/evb/starfive_evb.c
index 6d3ef222b7..0a9cb872c5 100644
--- a/board/starfive/evb/starfive_evb.c
+++ b/board/starfive/evb/starfive_evb.c
@@ -229,7 +229,6 @@ static void get_cpu_voltage_type(struct udevice *dev)
env_set("cpu_max_vol", "1020000");
break;
default:
- env_set("cpu_max_vol", "1040000");
break;
}
}
@@ -281,6 +280,9 @@ err:
eth_env_set_enetaddr("eth1addr", mac1);
chip = get_chip_type();
+
+ /* Set the default cpu max voltage. */
+ env_set("cpu_max_vol", "1040000");
#if CONFIG_IS_ENABLED(STARFIVE_OTP)
get_cpu_voltage_type(dev);
#endif
diff --git a/board/starfive/visionfive2/starfive_visionfive2.c b/board/starfive/visionfive2/starfive_visionfive2.c
index 1d14c618dc..a6656dcce1 100644
--- a/board/starfive/visionfive2/starfive_visionfive2.c
+++ b/board/starfive/visionfive2/starfive_visionfive2.c
@@ -322,7 +322,6 @@ static void get_cpu_voltage_type(struct udevice *dev)
env_set("cpu_max_vol", "1020000");
break;
default:
- env_set("cpu_max_vol", "1040000");
break;
}
}
@@ -484,6 +483,9 @@ err:
get_chip_type();
set_uboot_fdt_addr_env();
+
+ /* Set the default cpu max voltage. */
+ env_set("cpu_max_vol", "1040000");
#if CONFIG_IS_ENABLED(STARFIVE_OTP)
get_cpu_voltage_type(dev);
#endif