GitLab has been upgraded to 13.7.4 If you encounter any issues mail code@riscosopen.org

Commit 2dc1153c authored by Jeffrey Lee's avatar Jeffrey Lee

Fix CPU speed index of 1 being reported when device only has one speed setting

Detail:
  c/cpuclock - Adjust cpuclock_Get to make sure that a speed index of 0 is reported if the device claims to only support one speed (e.g. Pi 1). Also adjust logic so that any speed higher than the low speed counts as the high speed.
Admin:
  Tested on Pi 1B, 2B, 3B


Version 0.04. Tagged as 'BCMSupport-0_04'
parent 2aa44996
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.03"
Module_Version SETA 3
Module_MajorVersion SETS "0.04"
Module_Version SETA 4
Module_MinorVersion SETS ""
Module_Date SETS "25 Mar 2016"
Module_ApplicationDate SETS "25-Mar-16"
Module_Date SETS "26 Mar 2016"
Module_ApplicationDate SETS "26-Mar-16"
Module_ComponentName SETS "BCMSupport"
Module_ComponentPath SETS "mixed/RiscOS/Sources/HWSupport/BCMSupport"
Module_FullVersion SETS "0.03"
Module_HelpVersion SETS "0.03 (25 Mar 2016)"
Module_FullVersion SETS "0.04"
Module_HelpVersion SETS "0.04 (26 Mar 2016)"
END
/* (0.03)
/* (0.04)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.03
#define Module_MajorVersion_CMHG 0.04
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 25 Mar 2016
#define Module_Date_CMHG 26 Mar 2016
#define Module_MajorVersion "0.03"
#define Module_Version 3
#define Module_MajorVersion "0.04"
#define Module_Version 4
#define Module_MinorVersion ""
#define Module_Date "25 Mar 2016"
#define Module_Date "26 Mar 2016"
#define Module_ApplicationDate "25-Mar-16"
#define Module_ApplicationDate "26-Mar-16"
#define Module_ComponentName "BCMSupport"
#define Module_ComponentPath "mixed/RiscOS/Sources/HWSupport/BCMSupport"
#define Module_FullVersion "0.03"
#define Module_HelpVersion "0.03 (25 Mar 2016)"
#define Module_LibraryVersionInfo "0:3"
#define Module_FullVersion "0.04"
#define Module_HelpVersion "0.04 (26 Mar 2016)"
#define Module_LibraryVersionInfo "0:4"
......@@ -182,6 +182,11 @@ uint32_t cpuclock_Get(struct cpuclkdevice *cpuclk)
{
(void) cpuclk;
dprintf(("clk","Get\n"));
/* Avoid getting confused if only one speed is supported but the current speed doesn't match it for some reason */
if (speeds[0] == speeds[1])
{
return 0;
}
struct {
bufheader hdr;
tagheader tag;
......@@ -202,7 +207,7 @@ uint32_t cpuclock_Get(struct cpuclkdevice *cpuclk)
uint32_t ret = 0;
if (!_swix(BCMSupport_SendTempPropertyBuffer,_INR(0,2),&block,&block,0))
{
ret = (block.data[1] >= speeds[1]) ? 1 : 0;
ret = (block.data[1] > speeds[0]) ? 1 : 0;
}
if (irqs)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment