public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms][PATCH 1/1] Platform/RaspberryPi/Drivers/ConfigDxe: make CPU settings Pi-specific
@ 2020-03-08  5:31 Andrei Warkentin
  2020-03-09 12:35 ` Pete Batard
  0 siblings, 1 reply; 3+ messages in thread
From: Andrei Warkentin @ 2020-03-08  5:31 UTC (permalink / raw)
  To: devel; +Cc: ard.biesheuvel, leif, pete, philmd

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@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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-platforms][PATCH 1/1] Platform/RaspberryPi/Drivers/ConfigDxe: make CPU settings Pi-specific
  2020-03-08  5:31 [edk2-platforms][PATCH 1/1] Platform/RaspberryPi/Drivers/ConfigDxe: make CPU settings Pi-specific Andrei Warkentin
@ 2020-03-09 12:35 ` Pete Batard
  2020-03-10 23:32   ` Pete Batard
  0 siblings, 1 reply; 3+ messages in thread
From: Pete Batard @ 2020-03-09 12:35 UTC (permalink / raw)
  To: Andrei Warkentin, devel; +Cc: ard.biesheuvel, leif, philmd

On 2020.03.08 05:31, Andrei Warkentin wrote:
> 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@gmail.com>

Reviewed-by: Pete Batard <pete@akeo.ie>
Tested-by: Pete Batard <pete@akeo.ie>

> ---
>   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;
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-platforms][PATCH 1/1] Platform/RaspberryPi/Drivers/ConfigDxe: make CPU settings Pi-specific
  2020-03-09 12:35 ` Pete Batard
@ 2020-03-10 23:32   ` Pete Batard
  0 siblings, 0 replies; 3+ messages in thread
From: Pete Batard @ 2020-03-10 23:32 UTC (permalink / raw)
  To: Andrei Warkentin, devel; +Cc: ard.biesheuvel, leif, philmd

Note: This patch is being superseded by:
https://edk2.groups.io/g/devel/message/55734

On 2020.03.09 12:35, Pete Batard wrote:
> On 2020.03.08 05:31, Andrei Warkentin wrote:
>> 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@gmail.com>
> 
> Reviewed-by: Pete Batard <pete@akeo.ie>
> Tested-by: Pete Batard <pete@akeo.ie>
> 
>> ---
>>   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;
>>
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-10 23:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-08  5:31 [edk2-platforms][PATCH 1/1] Platform/RaspberryPi/Drivers/ConfigDxe: make CPU settings Pi-specific Andrei Warkentin
2020-03-09 12:35 ` Pete Batard
2020-03-10 23:32   ` Pete Batard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox