]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/ArmJunoPkg/Library/ArmJunoLib/ArmJunoMem.c
ArmPlatformPkg/ArmJunoPkg: Enable PCI and SATA support
[mirror_edk2.git] / ArmPlatformPkg / ArmJunoPkg / Library / ArmJunoLib / ArmJunoMem.c
index bc725df16560f8a2b75d6309b9bccd756b3f7ea9..41731c1ebdb8d7d8c7e6544b6e670b9f170706be 100644 (file)
@@ -1,6 +1,6 @@
 /** @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
@@ -22,7 +22,7 @@
 #include <ArmPlatform.h>\r
 \r
 // The total number of descriptors, including the final "end-of-table" descriptor.\r
-#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 12\r
+#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 16\r
 \r
 // DDR attributes\r
 #define DDR_ATTRIBUTES_CACHED           ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK\r
@@ -114,6 +114,36 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[Index].Length          = ARM_JUNO_NON_SECURE_SRAM_SZ;\r
   VirtualMemoryTable[Index].Attributes      = CacheAttributes;\r
 \r
+  // PCI Root Complex\r
+  VirtualMemoryTable[++Index].PhysicalBase  = PcdGet64 (PcdPcieControlBaseAddress);\r
+  VirtualMemoryTable[Index].VirtualBase     = PcdGet64 (PcdPcieControlBaseAddress);\r
+  VirtualMemoryTable[Index].Length          = SIZE_128KB;\r
+  VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;\r
+\r
+  //\r
+  // PCI Configuration Space\r
+  //\r
+  VirtualMemoryTable[++Index].PhysicalBase  = PcdGet64 (PcdPciConfigurationSpaceBaseAddress);\r
+  VirtualMemoryTable[Index].VirtualBase     = PcdGet64 (PcdPciConfigurationSpaceBaseAddress);\r
+  VirtualMemoryTable[Index].Length          = PcdGet64 (PcdPciConfigurationSpaceSize);\r
+  VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;\r
+\r
+  //\r
+  // PCI Memory Space\r
+  //\r
+  VirtualMemoryTable[++Index].PhysicalBase  = PcdGet32 (PcdPciMmio32Base);\r
+  VirtualMemoryTable[Index].VirtualBase     = PcdGet32 (PcdPciMmio32Base);\r
+  VirtualMemoryTable[Index].Length          = PcdGet32 (PcdPciMmio32Size);\r
+  VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;\r
+\r
+  //\r
+  // 64-bit PCI Memory Space\r
+  //\r
+  VirtualMemoryTable[++Index].PhysicalBase  = PcdGet64 (PcdPciMmio64Base);\r
+  VirtualMemoryTable[Index].VirtualBase     = PcdGet64 (PcdPciMmio64Base);\r
+  VirtualMemoryTable[Index].Length          = PcdGet64 (PcdPciMmio64Size);\r
+  VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;\r
+\r
   // Juno SOC peripherals\r
   VirtualMemoryTable[++Index].PhysicalBase  = ARM_JUNO_SOC_PERIPHERALS_BASE;\r
   VirtualMemoryTable[Index].VirtualBase     = ARM_JUNO_SOC_PERIPHERALS_BASE;\r