]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/BdsLib/BdsLinuxFdt.c
ArmPkg/BdsLib: Update 'cpu-release-addr' with the UEFI locations if the method is...
[mirror_edk2.git] / ArmPkg / Library / BdsLib / BdsLinuxFdt.c
index 98cd1db32868aee1391c4c45b854b523cce6eed0..5fccf8cac791152370e44fb1daa8f40771347080 100644 (file)
@@ -452,12 +452,13 @@ PrepareFdt (
         }\r
 \r
         // If Power State Coordination Interface (PSCI) is not supported then it is expected the secondary\r
-        // cores are spinning waiting for the Operation System to release them\r
+        // cores are spinning waiting for the Operating System to release them\r
         if (PsciSmcSupported == FALSE) {\r
-          // Before to write our method check if a method is already exposed in the CPU node\r
+          // We as the bootloader are responsible for either creating or updating\r
+          // these entries. Do not trust the entries in the DT. We only know about\r
+          // 'spin-table' type. Do not try to update other types if defined.\r
           Method = fdt_getprop(fdt, cpu_node, "enable-method", &lenp);\r
-          if (Method == NULL) {\r
-            // No 'enable-method', we can create our entries\r
+          if ( (Method == NULL) || (!AsciiStrCmp((CHAR8 *)Method, "spin-table")) ) {\r
             fdt_setprop_string(fdt, cpu_node, "enable-method", "spin-table");\r
             CpuReleaseAddr = cpu_to_fdt64(ArmCoreInfoTable[Index].MailboxSetAddress);\r
             fdt_setprop(fdt, cpu_node, "cpu-release-addr", &CpuReleaseAddr, sizeof(CpuReleaseAddr));\r
@@ -466,6 +467,8 @@ PrepareFdt (
             if (((ArmCoreInfoTable[Index].ClusterId != ClusterId) || (ArmCoreInfoTable[Index].CoreId != CoreId))) {\r
               fdt_setprop_string(fdt, cpu_node, "status", "disabled");\r
             }\r
+          } else {\r
+            Print(L"Warning: Unsupported enable-method type for CPU[%d] : %a\n", Index, (CHAR8 *)Method);\r
           }\r
         }\r
       }\r