diff mbox

[edk2,v2,10/24] ArmVirtPkg/VirtFdtDxe: remove timer DT node handling

Message ID 1460108711-12122-11-git-send-email-ard.biesheuvel@linaro.org
State Accepted
Commit 479d5c4175e77f1cd7e61855fa3c9f83c330ef4f
Headers show

Commit Message

Ard Biesheuvel April 8, 2016, 9:44 a.m. UTC
The timer code no longer relies on VirtFdtDxe to set the PCDs, so remove
the handling of the timer node and the references to those PCDs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c   | 39 +-------------------
 ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf |  4 --
 2 files changed, 1 insertion(+), 42 deletions(-)

-- 
2.5.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Laszlo Ersek April 8, 2016, 3:55 p.m. UTC | #1
On 04/08/16 11:44, Ard Biesheuvel wrote:
> The timer code no longer relies on VirtFdtDxe to set the PCDs, so remove

> the handling of the timer node and the references to those PCDs.

> 

> Contributed-under: TianoCore Contribution Agreement 1.0

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c   | 39 +-------------------

>  ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf |  4 --

>  2 files changed, 1 insertion(+), 42 deletions(-)


Reviewed-by: Laszlo Ersek <lersek@redhat.com>


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox

Patch

diff --git a/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c b/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c
index 4a4713cf6ad8..368618956be1 100644
--- a/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c
+++ b/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c
@@ -45,7 +45,6 @@  typedef enum {
   PropertyTypeRtc,
   PropertyTypeVirtio,
   PropertyTypeUart,
-  PropertyTypeTimer,
   PropertyTypeFwCfg,
   PropertyTypePciHost,
   PropertyTypeXen,
@@ -60,20 +59,12 @@  STATIC CONST PROPERTY CompatibleProperties[] = {
   { PropertyTypeRtc,     "arm,pl031"             },
   { PropertyTypeVirtio,  "virtio,mmio"           },
   { PropertyTypeUart,    "arm,pl011"             },
-  { PropertyTypeTimer,   "arm,armv7-timer"       },
-  { PropertyTypeTimer,   "arm,armv8-timer"       },
   { PropertyTypeFwCfg,   "qemu,fw-cfg-mmio"      },
   { PropertyTypePciHost, "pci-host-ecam-generic" },
   { PropertyTypeXen,     "xen,xen"               },
   { PropertyTypeUnknown, ""                      }
 };
 
-typedef struct {
-  UINT32  Type;
-  UINT32  Number;
-  UINT32  Flags;
-} INTERRUPT_PROPERTY;
-
 STATIC
 PROPERTY_TYPE
 GetTypeFromNode (
@@ -288,8 +279,6 @@  InitializeVirtFdtDxe (
   VIRTIO_TRANSPORT_DEVICE_PATH   *DevicePath;
   EFI_HANDLE                     Handle;
   UINT64                         RegBase;
-  CONST INTERRUPT_PROPERTY       *InterruptProp;
-  INT32                          SecIntrNum, IntrNum, VirtIntrNum, HypIntrNum;
   UINT64                         FwCfgSelectorAddress;
   UINT64                         FwCfgSelectorSize;
   UINT64                         FwCfgDataAddress;
@@ -339,7 +328,7 @@  InitializeVirtFdtDxe (
     // TODO use #cells root properties instead
     //
     RegProp = fdt_getprop (DeviceTreeBase, Node, "reg", &Len);
-    ASSERT ((RegProp != NULL) || (PropType == PropertyTypeTimer));
+    ASSERT (RegProp != NULL);
 
     switch (PropType) {
     case PropertyTypePciHost:
@@ -449,32 +438,6 @@  InitializeVirtFdtDxe (
       RtcNode = Node;
       break;
 
-    case PropertyTypeTimer:
-      //
-      // - interrupts : Interrupt list for secure, non-secure, virtual and
-      //  hypervisor timers, in that order.
-      //
-      InterruptProp = fdt_getprop (DeviceTreeBase, Node, "interrupts", &Len);
-      ASSERT (Len == 36 || Len == 48);
-
-      SecIntrNum = fdt32_to_cpu (InterruptProp[0].Number)
-                   + (InterruptProp[0].Type ? 16 : 0);
-      IntrNum = fdt32_to_cpu (InterruptProp[1].Number)
-                + (InterruptProp[1].Type ? 16 : 0);
-      VirtIntrNum = fdt32_to_cpu (InterruptProp[2].Number)
-                    + (InterruptProp[2].Type ? 16 : 0);
-      HypIntrNum = Len < 48 ? 0 : fdt32_to_cpu (InterruptProp[3].Number)
-                                  + (InterruptProp[3].Type ? 16 : 0);
-
-      DEBUG ((EFI_D_INFO, "Found Timer interrupts %d, %d, %d, %d\n",
-        SecIntrNum, IntrNum, VirtIntrNum, HypIntrNum));
-
-      PcdSet32 (PcdArmArchTimerSecIntrNum, SecIntrNum);
-      PcdSet32 (PcdArmArchTimerIntrNum, IntrNum);
-      PcdSet32 (PcdArmArchTimerVirtIntrNum, VirtIntrNum);
-      PcdSet32 (PcdArmArchTimerHypIntrNum, HypIntrNum);
-      break;
-
     case PropertyTypeXen:
       ASSERT (Len == 16);
 
diff --git a/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf b/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf
index 5526fd19250e..c928e826c258 100644
--- a/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf
+++ b/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf
@@ -53,10 +53,6 @@  [Pcd]
   gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress
   gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress
   gArmVirtTokenSpaceGuid.PcdFwCfgDmaAddress
-  gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
-  gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
-  gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
-  gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
   gArmPlatformTokenSpaceGuid.PcdPL031RtcBase
   gArmPlatformTokenSpaceGuid.PcdPciBusMin
   gArmPlatformTokenSpaceGuid.PcdPciBusMax