+ //\r
+ // Set up the device path to the FDT.\r
+ // We detect whether we are running on a Juno r0 or Juno r1 board at\r
+ // runtime by checking the value of the MIDR register.\r
+ //\r
+\r
+ Midr = ArmReadMidr ();\r
+ CpuType = (Midr >> ARM_CPU_TYPE_SHIFT) & ARM_CPU_TYPE_MASK;\r
+ CpuRev = Midr & ARM_CPU_REV_MASK;\r
+ TextDevicePath = NULL;\r
+\r
+ switch (CpuType) {\r
+ case ARM_CPU_TYPE_A53:\r
+ if (CpuRev == ARM_CPU_REV (0, 0)) {\r
+ TextDevicePath = (CHAR16*)FixedPcdGetPtr (PcdR0FdtDevicePath);\r
+ } else if (CpuRev == ARM_CPU_REV (0, 3)) {\r
+ TextDevicePath = (CHAR16*)FixedPcdGetPtr (PcdR1FdtDevicePath);\r
+ }\r
+ break;\r
+\r
+ case ARM_CPU_TYPE_A57:\r
+ if (CpuRev == ARM_CPU_REV (0, 0)) {\r
+ TextDevicePath = (CHAR16*)FixedPcdGetPtr (PcdR0FdtDevicePath);\r
+ } else if (CpuRev == ARM_CPU_REV (1, 1)) {\r
+ TextDevicePath = (CHAR16*)FixedPcdGetPtr (PcdR1FdtDevicePath);\r
+ }\r
+ }\r
+\r
+ if (TextDevicePath != NULL) {\r
+ TextDevicePathSize = StrSize (TextDevicePath);\r
+ Buffer = PcdSetPtr (PcdFdtDevicePaths, &TextDevicePathSize, TextDevicePath);\r
+ Status = (Buffer != NULL) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL;\r
+ } else {\r
+ Status = EFI_NOT_FOUND;\r
+ }\r
+\r