Skip to content

Commit

Permalink
sdm845: remove clock setting code in MsPlatformDevicesLib
Browse files Browse the repository at this point in the history
  • Loading branch information
strongtz committed Oct 21, 2022
1 parent dd20001 commit 6d18a05
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,51 +29,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Protocol/EFIChipInfo.h>
#include <Protocol/EFIPlatformInfo.h>
#include <Protocol/EFISmem.h>
#include <Protocol/EFIClock.h>

EFI_STATUS
EFIAPI
SetupAPSSCpuPerfLevels()
{
EFI_STATUS Status = EFI_SUCCESS;
EFI_CLOCK_PROTOCOL *pClockProtocol = NULL;
UINT32 perfLevel = 0;
UINT32 frequencyHz = 0;

Status = gBS->LocateProtocol(
&gEfiClockProtocolGuid,
NULL,
(VOID **)&pClockProtocol
);

if (EFI_ERROR(Status)) {
return Status;
}

DEBUG((EFI_D_INFO, "\n\n\n\n\n\n\n\n\n\n\n\n\n"));

// The 9th cluster is L3 cache
for (int i = 0; i < 9; i++) {
Status = pClockProtocol->GetMaxPerfLevel(pClockProtocol, i, &perfLevel);

if (EFI_ERROR(Status)) {
DEBUG((EFI_D_ERROR, "%a: Failed to get the maximum performance level for CPU %d, Status: %r\n", __FUNCTION__, i, Status));
return Status;
}

Status = pClockProtocol->SetCpuPerfLevel(pClockProtocol, i, perfLevel, &frequencyHz);

if (EFI_ERROR(Status)) {
DEBUG((EFI_D_ERROR, "%a: Failed to set the maximum performance level for CPU %d, Status: %r\n", __FUNCTION__, i, Status));
return Status;
}

DEBUG((EFI_D_INFO, "%a: CPU %d Now running at %d Hz\n", __FUNCTION__, i, frequencyHz));
}

// gBS->Stall(10 * 1000 * 1000);
return Status;
}

EFI_STATUS
EFIAPI
Expand Down Expand Up @@ -231,8 +186,6 @@ VOID
EFIAPI
PlatformSetup()
{
SetupAPSSCpuPerfLevels();

// Allow MPSS and HLOS to access the allocated RFS Shared Memory Region
// Normally this would be done by a driver in Linux
// TODO: Move to a better place!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@
gEfiChipInfoProtocolGuid ## CONSUMES
gQcomSMEMProtocolGuid ## CONSUMES
gEfiPlatformInfoProtocolGuid ## CONSUMES
gEfiClockProtocolGuid

0 comments on commit 6d18a05

Please sign in to comment.