From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) by mx.groups.io with SMTP id smtpd.web10.29451.1583645482437508209 for ; Sat, 07 Mar 2020 21:31:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LuO7GSJE; spf=pass (domain: gmail.com, ip: 209.85.222.171, mailfrom: andrey.warkentin@gmail.com) Received: by mail-qk1-f171.google.com with SMTP id y126so6323739qke.4 for ; Sat, 07 Mar 2020 21:31:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=dG8RmeBgxskVhW5ZtuRXFOL/QJG/ehHItWIWZeWP49M=; b=LuO7GSJEdQlTmBn0xpMM+WWiYR4j+jw6oX90NagUN5fDfCSA+kFqcMFZuwOlRpp8g1 tJ6nbCq0YpXvAlZUeHG+vBeBNGn2wIklE2BVLreVtUT9alvOaQryeX6lYQElhDZSoJCo Y/jtqm5z+UCXkymSeSXlrVR41Wopj2aX5agudZioKkLovr090Jpt7xI4uS937c3jmEP2 VG/6ype1cU4iaGDUoNwlfQbF+SJas9vlOY6njh/HTtCmTzUQFea0bT0+XjoASIKnv/dj wy6yT76PvSOA9eTdPVZYjlbZ1oaBs+tP2ys/OAIW90roqkkpBhqg0SmDch+XElALk5hJ rwJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dG8RmeBgxskVhW5ZtuRXFOL/QJG/ehHItWIWZeWP49M=; b=TDpjpFqENuO2mpzGkxlZ7hufmbMEQ00MYeMLE2FGTJxZ2A/xdyjXMcdNRMoum+7KrE HJ4O0/2u9aFPvfhQgblBKtqg2Pnej3vENjd5muD5sCZ+fKdhgdxQ4KtW4JRYghaKlFsT FO4NRNhi2B72pYpPwFf5t1ffoXfcRKK5BpXS0i/FW+GfhisXX3p/WzXtW77Rea1VXXlg 6cV1OBOWiPQu/F/MSSLaHQ5zx8tYiADgtZpYaLB9jLoYrcniY46ylAaBPQXXmbvdDlzL ewGxn8Wis4mo/9c+BtHwDTvyEh6pjXKblMaLu2WnouNE6a1j3+Dldhlk+ZL0x4LN++t1 9bDA== X-Gm-Message-State: ANhLgQ0lwg7xceKQ8sqr5KwxJQWSzA/keFZRBtK50HaJ63d/9LDRnMgn cWb4Q87ctolN0dfQ7VlXNd6fMnfcZDfJPg== X-Google-Smtp-Source: ADFU+vtUtpWzM4zgl5OTUu2ikmGquzXmhPnL/UjKPXK7oQzwMuP/iDqNSKpY1XK2vVI1SuH/WNvMMw== X-Received: by 2002:a37:62d1:: with SMTP id w200mr4772187qkb.399.1583645481300; Sat, 07 Mar 2020 21:31:21 -0800 (PST) Return-Path: Received: from ubuntu.localdomain (c-24-147-160-127.hsd1.ma.comcast.net. [24.147.160.127]) by smtp.gmail.com with ESMTPSA id u123sm1766665qkc.16.2020.03.07.21.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Mar 2020 21:31:20 -0800 (PST) From: "Andrei Warkentin" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, pete@akeo.ie, philmd@redhat.com Subject: [edk2-platforms][PATCH 1/1] Platform/RaspberryPi/Drivers/ConfigDxe: make CPU settings Pi-specific Date: Sat, 7 Mar 2020 21:31:09 -0800 Message-Id: <20200308053109.92438-1-andrey.warkentin@gmail.com> X-Mailer: git-send-email 2.17.1 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 --- 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 #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