summaryrefslogtreecommitdiff
path: root/arch/riscv/cpu/cpu.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-03-19 09:10:30 -0400
committerTom Rini <trini@konsulko.com>2024-03-19 09:10:30 -0400
commitf048104999db28d49362201eaebfc91adb14f47c (patch)
treed8a909e13b846bb4a443283a3d948a39bb835995 /arch/riscv/cpu/cpu.c
parentb145877c22b391a4872c875145a8f86f6ffebaba (diff)
parent386fca68960994ece0d9da8a69a14495b5f1aedf (diff)
Merge tag 'u-boot-socfpga-next-20240319' of https://source.denx.de/u-boot/custodians/u-boot-socfpga into next
- A new driver in the misc to register setting from device tree. This also provides user a clean interface and all register settings are centralized in one place, device tree. - Enable Agilex5 platform for Intel product. Changes, modification and new files are created for board, dts, configs and makefile to create the base for Agilex5. Build-tested on SoC64 boards, boot tested on some of them.
Diffstat (limited to 'arch/riscv/cpu/cpu.c')
-rw-r--r--arch/riscv/cpu/cpu.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c
index 8445c5823e1..ecfefa1a025 100644
--- a/arch/riscv/cpu/cpu.c
+++ b/arch/riscv/cpu/cpu.c
@@ -49,14 +49,24 @@ static inline bool supports_extension(char ext)
}
if (!cpu_get_desc(dev, desc, sizeof(desc))) {
/*
- * skip the first 4 characters (rv32|rv64) and
- * check until underscore
+ * skip the first 4 characters (rv32|rv64)
*/
for (i = 4; i < sizeof(desc); i++) {
- if (desc[i] == '_' || desc[i] == '\0')
- break;
- if (desc[i] == ext)
- return true;
+ switch (desc[i]) {
+ case 's':
+ case 'x':
+ case 'z':
+ case '_':
+ case '\0':
+ /*
+ * Any of these characters mean the single
+ * letter extensions have all been consumed.
+ */
+ return false;
+ default:
+ if (desc[i] == ext)
+ return true;
+ }
}
}