[edk2-devel] [edk2-platforms][PATCH 1/1] Platform/RaspberryPi/Drivers/ConfigDxe: make CPU settings Pi-specific

Andrei Warkentin andrey.warkentin at gmail.com
Sun Mar 8 05:31:09 UTC 2020


For Pi 4, the custom CPU frequency range goes all the way up to 2.2GHz.

The acrobatics with CHIPSET_CUSTOM_CPU_CLOCK_HELP_TOKEN in the VFR
are required as the preprocessor is not run on the UNI (strings) file.

Testing: Pi 4 (saw correct help message, could change Hz to 2000).

Signed-off-by: Andrei Warkentin <andrey.warkentin at gmail.com>
---
 Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni |  5 +++--
 Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 12 ++++++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni
index 77eda96d..fc19ce40 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni
@@ -21,14 +21,15 @@
 #string STR_CHIPSET_FORM_SUBTITLE   #language en-US "Note: OS may override settings."
 
 #string STR_CHIPSET_CLOCK_CPU_PROMPT #language en-US "CPU Clock"
-#string STR_CHIPSET_CLOCK_CPU_HELP   #language en-US "CPU Speed"
+#string STR_CHIPSET_CLOCK_CPU_HELP   #language en-US "CPU Speed\n\nWarning: Overclocking can make the system unbootable!"
 #string STR_CHIPSET_CLOCK_CPU_NA     #language en-US "Don't Override"
 #string STR_CHIPSET_CLOCK_CPU_600MHZ #language en-US "Min (600MHz)"
 #string STR_CHIPSET_CLOCK_CPU_MAX    #language en-US "Max"
 #string STR_CHIPSET_CLOCK_CPU_CUSTOM #language en-US "Custom"
 
 #string STR_CHIPSET_CUSTOM_CPU_CLOCK_PROMPT #language en-US "CPU Clock Rate (MHz)"
-#string STR_CHIPSET_CUSTOM_CPU_CLOCK_HELP   #language en-US "Adjust the CPU speed.\nMin value: 100 MHz\nMax value: 1600 MHz\n\nWarning: Overclocking can make the system unbootable!"
+#string STR_CHIPSET_CUSTOM_CPU_CLOCK_HELP_PI4 #language en-US "Adjust the CPU speed.\nMin value: 100 MHz\nMax value: 2200 MHz"
+#string STR_CHIPSET_CUSTOM_CPU_CLOCK_HELP_PI3 #language en-US "Adjust the CPU speed.\nMin value: 100 MHz\nMax value: 1600 MHz"
 
 /*
  * Advanced configuration.
diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr
index 9c2fd64a..2a15e0f5 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr
@@ -9,6 +9,14 @@
 #include <Guid/HiiPlatformSetupFormset.h>
 #include "ConfigDxeFormSetGuid.h"
 
+#if (RPI_MODEL == 4)
+#define CHIPSET_CUSTOM_CPU_CLOCK_MAX 2200
+#define CHIPSET_CUSTOM_CPU_CLOCK_HELP_TOKEN STRING_TOKEN(STR_CHIPSET_CUSTOM_CPU_CLOCK_HELP_PI4)
+#else
+#define CHIPSET_CUSTOM_CPU_CLOCK_MAX 1600
+#define CHIPSET_CUSTOM_CPU_CLOCK_HELP_TOKEN STRING_TOKEN(STR_CHIPSET_CUSTOM_CPU_CLOCK_HELP_PI3)
+#endif /* (RPI_MODEL == 4) */
+
 #pragma pack(1)
 typedef struct {
   /*
@@ -262,10 +270,10 @@ formset
         grayoutif NOT ideqval CpuClock.Clock == 3;
           numeric varid = CustomCpuClock.Clock,
               prompt  = STRING_TOKEN(STR_CHIPSET_CUSTOM_CPU_CLOCK_PROMPT),
-              help    = STRING_TOKEN(STR_CHIPSET_CUSTOM_CPU_CLOCK_HELP),
+              help    = CHIPSET_CUSTOM_CPU_CLOCK_HELP_TOKEN,
               flags   = DISPLAY_UINT_DEC | NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRED,
               minimum = 100,
-              maximum = 1600,
+              maximum = CHIPSET_CUSTOM_CPU_CLOCK_MAX,
               default = 600,
           endnumeric;
         endif;
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55659): https://edk2.groups.io/g/devel/message/55659
Mute This Topic: https://groups.io/mt/71809869/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list