public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Pete Batard" <pete@akeo.ie>
To: Andrei Warkentin <andrey.warkentin@gmail.com>, devel@edk2.groups.io
Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com
Subject: Re: [edk2-platforms][PATCH 1/1] Platform/RaspberryPi/Drivers/ConfigDxe: make CPU settings Pi-specific
Date: Mon, 9 Mar 2020 12:35:00 +0000	[thread overview]
Message-ID: <899ecb6b-ff1b-3eb5-663f-2ee02287b1a4@akeo.ie> (raw)
In-Reply-To: <20200308053109.92438-1-andrey.warkentin@gmail.com>

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


  reply	other threads:[~2020-03-09 12:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-03-10 23:32   ` Pete Batard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=899ecb6b-ff1b-3eb5-663f-2ee02287b1a4@akeo.ie \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox