@@ -29,51 +29,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
2929#include <Protocol/EFIChipInfo.h>
3030#include <Protocol/EFIPlatformInfo.h>
3131#include <Protocol/EFISmem.h>
32- #include <Protocol/EFIClock.h>
33-
34- EFI_STATUS
35- EFIAPI
36- SetupAPSSCpuPerfLevels ()
37- {
38- EFI_STATUS Status = EFI_SUCCESS ;
39- EFI_CLOCK_PROTOCOL * pClockProtocol = NULL ;
40- UINT32 perfLevel = 0 ;
41- UINT32 frequencyHz = 0 ;
42-
43- Status = gBS -> LocateProtocol (
44- & gEfiClockProtocolGuid ,
45- NULL ,
46- (VOID * * )& pClockProtocol
47- );
48-
49- if (EFI_ERROR (Status )) {
50- return Status ;
51- }
52-
53- DEBUG ((EFI_D_INFO , "\n\n\n\n\n\n\n\n\n\n\n\n\n" ));
54-
55- // The 9th cluster is L3 cache
56- for (int i = 0 ; i < 9 ; i ++ ) {
57- Status = pClockProtocol -> GetMaxPerfLevel (pClockProtocol , i , & perfLevel );
58-
59- if (EFI_ERROR (Status )) {
60- DEBUG ((EFI_D_ERROR , "%a: Failed to get the maximum performance level for CPU %d, Status: %r\n" , __FUNCTION__ , i , Status ));
61- return Status ;
62- }
63-
64- Status = pClockProtocol -> SetCpuPerfLevel (pClockProtocol , i , perfLevel , & frequencyHz );
65-
66- if (EFI_ERROR (Status )) {
67- DEBUG ((EFI_D_ERROR , "%a: Failed to set the maximum performance level for CPU %d, Status: %r\n" , __FUNCTION__ , i , Status ));
68- return Status ;
69- }
70-
71- DEBUG ((EFI_D_INFO , "%a: CPU %d Now running at %d Hz\n" , __FUNCTION__ , i , frequencyHz ));
72- }
73-
74- // gBS->Stall(10 * 1000 * 1000);
75- return Status ;
76- }
7732
7833EFI_STATUS
7934EFIAPI
231186EFIAPI
232187PlatformSetup ()
233188{
234- SetupAPSSCpuPerfLevels ();
235-
236189 // Allow MPSS and HLOS to access the allocated RFS Shared Memory Region
237190 // Normally this would be done by a driver in Linux
238191 // TODO: Move to a better place!
0 commit comments