/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>\r
+ Copyright (c) 2011 - 2015, ARM Ltd. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
#define SCR_AW (1 << 5)\r
\r
// MIDR - Main ID Register definitions\r
+#define ARM_CPU_TYPE_SHIFT 4\r
#define ARM_CPU_TYPE_MASK 0xFFF\r
#define ARM_CPU_TYPE_AEMv8 0xD0F\r
#define ARM_CPU_TYPE_A53 0xD03\r
#define ARM_CPU_TYPE_A57 0xD07\r
#define ARM_CPU_TYPE_A15 0xC0F\r
#define ARM_CPU_TYPE_A9 0xC09\r
+#define ARM_CPU_TYPE_A7 0xC07\r
#define ARM_CPU_TYPE_A5 0xC05\r
\r
#define ARM_CPU_REV_MASK ((0xF << 20) | (0xF) )\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- Copyright (c) 2011-2014, ARM Ltd. All rights reserved.<BR>\r
+ Copyright (c) 2011-2015, ARM Ltd. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
#define SCR_AW (1 << 5)\r
\r
// MIDR - Main ID Register definitions\r
+#define ARM_CPU_TYPE_SHIFT 4\r
#define ARM_CPU_TYPE_MASK 0xFFF\r
#define ARM_CPU_TYPE_AEMv8 0xD0F\r
#define ARM_CPU_TYPE_A53 0xD03\r
#define ARM_CPU_TYPE_A57 0xD07\r
#define ARM_CPU_TYPE_A15 0xC0F\r
+#define ARM_CPU_TYPE_A12 0xC0D\r
#define ARM_CPU_TYPE_A9 0xC09\r
+#define ARM_CPU_TYPE_A7 0xC07\r
#define ARM_CPU_TYPE_A5 0xC05\r
\r
#define ARM_CPU_REV_MASK ((0xF << 20) | (0xF) )\r
#\r
-# Copyright (c) 2013-2014, ARM Limited. All rights reserved.\r
+# Copyright (c) 2013-2015, ARM Limited. All rights reserved.\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
[PcdsFixedAtBuild.common]\r
gArmJunoTokenSpaceGuid.PcdSynopsysUsbOhciBaseAddress|0x7FFB0000|UINT32|0x00000004\r
gArmJunoTokenSpaceGuid.PcdSynopsysUsbEhciBaseAddress|0x7FFC0000|UINT32|0x00000005\r
+\r
+ # Juno Device Trees are loaded from NOR Flash\r
+ gArmJunoTokenSpaceGuid.PcdR0FdtDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/juno_r0.dtb"|VOID*|0x00000006\r
+ gArmJunoTokenSpaceGuid.PcdR1FdtDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/juno_r1.dtb"|VOID*|0x00000007\r
#\r
-# Copyright (c) 2013-2014, ARM Limited. All rights reserved.\r
+# Copyright (c) 2013-2015, ARM Limited. All rights reserved.\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf\r
MemoryInitPeiLib|ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf\r
\r
+[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]\r
+ PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+\r
[BuildOptions]\r
*_*_*_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmJunoPkg/Include\r
\r
# List of Device Paths that support BootMonFs\r
gArmPlatformTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)"\r
\r
- #\r
- # Define the device path to the FDT for its installation\r
- #\r
-!ifdef $(JUNO_EMULATOR)\r
- # From DRAM\r
- gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"VenHw(30F57E4A-69CE-4FB7-B7A1-4C7CE49D57A6)/MemoryMapped(0x0,0x88000000,0x88200000)"\r
-!else\r
-!ifdef $(JUNO_MODEL)\r
- # From semi-hosting\r
- gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/juno.dtb"\r
-!else\r
- # From NOR flash\r
- gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/juno.dtb"\r
-!endif\r
-!endif\r
-\r
#\r
# ARM OS Loader\r
#\r
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|1920\r
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|1080\r
\r
+[PcdsDynamicDefault.common]\r
+ #\r
+ # The size of a dynamic PCD of the (VOID*) type can not be increased at run\r
+ # time from its size at build time. Set the "PcdFdtDevicePaths" PCD to a 128\r
+ # character "empty" string, to allow to be able to set FDT text device paths\r
+ # up to 128 characters long.\r
+ #\r
+ gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L" "\r
\r
################################################################################\r
#\r
READ_LOCK_CAP = TRUE\r
READ_LOCK_STATUS = TRUE\r
\r
+ APRIORI DXE {\r
+ INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
+ }\r
+\r
INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
+ INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
\r
#\r
# PI DXE Drivers producing Architectural Protocols (EFI Services)\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_PHYSICAL_ADDRESS HypBase;\r
+ EFI_STATUS Status;\r
+ EFI_PHYSICAL_ADDRESS HypBase;\r
+ CHAR16 *TextDevicePath;\r
+ UINTN TextDevicePathSize;\r
+ VOID *Buffer;\r
+ UINT32 Midr;\r
+ UINT32 CpuType;\r
+ UINT32 CpuRev;\r
\r
Status = PciEmulationEntryPoint ();\r
if (EFI_ERROR (Status)) {\r
DEBUG ((EFI_D_ERROR, "ArmJunoDxe: Failed to install ShellDynCmdRunAxf\n"));\r
}\r
\r
- // Try to install the ACPI Tables\r
- Status = LocateAndInstallAcpiFromFv (&mJunoAcpiTableFile);\r
+ //\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
if (EFI_ERROR (Status)) {\r
+ DEBUG (\r
+ (EFI_D_ERROR,\r
+ "ArmJunoDxe: Setting of FDT device path in PcdFdtDevicePaths failed - %r\n", Status)\r
+ );\r
return Status;\r
}\r
\r
+ // Try to install the ACPI Tables\r
+ Status = LocateAndInstallAcpiFromFv (&mJunoAcpiTableFile);\r
+\r
return Status;\r
}\r
\r
[LibraryClasses]\r
AcpiLib\r
+ ArmLib\r
ArmShellCmdRunAxfLib\r
BaseMemoryLib\r
BdsLib\r
gArmJunoTokenSpaceGuid.PcdSynopsysUsbEhciBaseAddress\r
gArmJunoTokenSpaceGuid.PcdSynopsysUsbOhciBaseAddress\r
\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath\r
+ gArmJunoTokenSpaceGuid.PcdR0FdtDevicePath\r
+ gArmJunoTokenSpaceGuid.PcdR1FdtDevicePath\r
+\r
+[Pcd]\r
+ gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths\r
\r
[Depex]\r
TRUE\r
/** @file\r
*\r
-* Copyright (c) 2013-2014, ARM Limited. All rights reserved.\r
+* Copyright (c) 2013-2015, ARM Limited. All rights reserved.\r
*\r
* This program and the accompanying materials\r
* are licensed and made available under the terms and conditions of the BSD License\r
\r
#include <Uefi.h>\r
\r
+#include <Library/BaseLib.h>\r
+#include <Library/ArmLib.h>\r
+#include <Library/AcpiLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/DxeServicesTableLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r