public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: evan.lloyd@arm.com
To: edk2-devel@lists.01.org
Cc: "ard.biesheuvel@linaro.org"@arm.com,
	"leif.lindholm@linaro.org"@arm.com,
	"Matteo.Carlini@arm.com"@arm.com, "nd@arm.com"@arm.com,
	"Arvind.Chauhan@arm.com"@arm.com,
	"Daniil.Egranov@arm.com"@arm.com,
	"thomas.abraham@arm.com"@arm.com
Subject: [PATCH v2 2/2] [edk2-platforms] Platforms/ARM: SBSA Watchdog PCD and build option
Date: Thu, 21 Sep 2017 22:01:42 +0100	[thread overview]
Message-ID: <20170921210142.6932-3-evan.lloyd@arm.com> (raw)
In-Reply-To: <20170921210142.6932-1-evan.lloyd@arm.com>

From: Sami Mujawar <sami.mujawar@arm.com>

Added PcdWatchdogCount to specify the number of Watchdog timers
that are available on Juno and FVP platform.

Also added DISABLE_SBSA_WATCHDOG option to disable the watchdog
timers if required for testing.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
---

Notes:
    162_WDpcd_v2:
    - Moved JUNO_WATCHDOG_COUNT [Thomas Panakamattam Abraham]

 Platform/ARM/JunoPkg/ArmJuno.dsc                     |  7 ++++++-
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc |  7 ++++++-
 Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf       |  4 +++-
 Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf   |  4 +++-
 Platform/ARM/JunoPkg/AcpiTables/Gtdt.aslc            |  9 ++++++++-
 Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc        | 14 +++++++++++---
 6 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index 72eab8b5be22a5516b243b2b5e70f6b919854707..54158d709ae836202254eef8b2e0eac8209ca9cc 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2013-2015, ARM Limited. All rights reserved.
+#  Copyright (c) 2013-2017, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -131,6 +131,11 @@ [PcdsFixedAtBuild.common]
   ## PL031 RealTimeClock
   gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C170000
 
+  ## SBSA Watchdog Count
+!ifndef DISABLE_SBSA_WATCHDOG
+  gArmPlatformTokenSpaceGuid.PcdWatchdogCount|2
+!endif
+
   # LAN9118 Ethernet Driver
   gEmbeddedTokenSpaceGuid.PcdLan9118DxeBaseAddress|0x18000000
   gEmbeddedTokenSpaceGuid.PcdLan9118DefaultMacAddress|0x1215161822242628
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index e9f954d926ac25a2abd2f97a4141267927dfc0a3..51f0529db2516285641a8b6a49473db9d3d9224a 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
+#  Copyright (c) 2011-2017, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -135,6 +135,11 @@ [PcdsFixedAtBuild.common]
   ## PL031 RealTimeClock
   gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C170000
 
+  ## SBSA Watchdog Count
+!ifndef DISABLE_SBSA_WATCHDOG
+  gArmPlatformTokenSpaceGuid.PcdWatchdogCount|1
+!endif
+
 !ifdef EDK2_ENABLE_PL111
   ## PL111 Versatile Express Motherboard controller
   gArmPlatformTokenSpaceGuid.PcdPL111LcdBase|0x1C1F0000
diff --git a/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf b/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
index e099c02f39dad4bb19692c87a12d8d3d6f1da4b6..741ea191be3672db225b82dc0e182fceddec83f2 100644
--- a/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
+++ b/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
@@ -2,7 +2,7 @@
 #
 #  ACPI table data and ASL sources required to boot the platform.
 #
-#  Copyright (c) 2014-2016, ARM Ltd. All rights reserved.
+#  Copyright (c) 2014-2017, ARM Ltd. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -61,3 +61,5 @@ [FixedPcd]
   gArmPlatformTokenSpaceGuid.PL011UartInterrupt
 
   gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
+
+  gArmPlatformTokenSpaceGuid.PcdWatchdogCount
diff --git a/Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf b/Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf
index 59d323840a3a5e32a1a870f2098bdb2588ae91e1..cc0f06f533236b3bf68bfc6eefc745b776fdad16 100644
--- a/Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf
+++ b/Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf
@@ -2,7 +2,7 @@
 #
 #  ACPI table data and ASL sources required to boot the platform.
 #
-#  Copyright (c) 2014-2016, ARM Ltd. All rights reserved.
+#  Copyright (c) 2014-2017, ARM Ltd. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -41,3 +41,5 @@ [FixedPcd]
   gArmTokenSpaceGuid.PcdGicDistributorBase
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
   gArmTokenSpaceGuid.PcdGicRedistributorsBase
+
+  gArmPlatformTokenSpaceGuid.PcdWatchdogCount
diff --git a/Platform/ARM/JunoPkg/AcpiTables/Gtdt.aslc b/Platform/ARM/JunoPkg/AcpiTables/Gtdt.aslc
index 5e83802d576b11178a7fdb556086dea41ee0859f..9d1296fdf29e9c233557cc8fb502fbbe932bc2db 100644
--- a/Platform/ARM/JunoPkg/AcpiTables/Gtdt.aslc
+++ b/Platform/ARM/JunoPkg/AcpiTables/Gtdt.aslc
@@ -1,7 +1,7 @@
 /** @file
 *  Generic Timer Description Table (GTDT)
 *
-*  Copyright (c) 2012 - 2016, ARM Limited. All rights reserved.
+*  Copyright (c) 2012 - 2017, ARM Limited. All rights reserved.
 *
 *  This program and the accompanying materials
 *  are licensed and made available under the terms and conditions of the BSD License
@@ -38,6 +38,9 @@
 
 #define GTDT_GTIMER_FLAGS           (GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED)
 
+#define JUNO_WATCHDOG_COUNT         FixedPcdGet32 (PcdWatchdogCount)
+
+
 #ifdef ARM_JUNO_ACPI_5_0
   EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt = {
     ARM_ACPI_HEADER(
@@ -87,7 +90,11 @@
       GTDT_GTIMER_FLAGS,                            // UINT32  NonSecurePL2TimerFlags
       0xFFFFFFFFFFFFFFFF,                           // UINT64  CntReadBasePhysicalAddress
       JUNO_WATCHDOG_COUNT,                          // UINT32  PlatformTimerCount
+#if (JUNO_WATCHDOG_COUNT != 0)
       sizeof (EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE) // UINT32 PlatfromTimerOffset
+#else
+      0
+#endif
     },
 #if (JUNO_WATCHDOG_COUNT != 0)
     {
diff --git a/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc b/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc
index fc8f91f8b7ad8a066fb5fe4e3f98b1d5e9a3158c..ae570574b298094ff468f30b78fbd8c98db506c5 100644
--- a/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc
+++ b/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc
@@ -1,7 +1,7 @@
 /** @file
 *  Generic Timer Description Table (GTDT)
 *
-*  Copyright (c) 2012 - 2014, ARM Limited. All rights reserved.
+*  Copyright (c) 2012 - 2017, ARM Limited. All rights reserved.
 *  Copyright (c) 2016, Linaro Ltd. All rights reserved
 *
 *  This program and the accompanying materials
@@ -36,9 +36,9 @@
 
 #define FVP_GTDT_GTIMER_FLAGS       (GTDT_TIMER_LOSE_CONTEXT | GTDT_TIMER_ACTIVE_HIGH | GTDT_TIMER_EDGE_TRIGGERED)
 
-#define FVP_PLATFORM_TIMER_COUNT    2
+#define FVP_WATCHDOG_COUNT          FixedPcdGet32 (PcdWatchdogCount)
+#define FVP_PLATFORM_TIMER_COUNT    (FVP_WATCHDOG_COUNT + 1)
 #define FVP_TIMER_FRAMES_COUNT      2
-#define FVP_WATCHDOG_COUNT          1
 
 #define FVP_GT_BLOCK_CTL_BASE           0x000000002A810000
 #define FVP_GT_BLOCK_FRAME0_CTL_BASE    0x000000002A820000
@@ -82,7 +82,9 @@ typedef struct {
   EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLE          Gtdt;
   EFI_ACPI_6_1_GTDT_GT_BLOCK_STRUCTURE                  GtBlock;
   EFI_ACPI_6_1_GTDT_GT_BLOCK_TIMER_STRUCTURE            Frames[FVP_TIMER_FRAMES_COUNT];
+#if (FVP_WATCHDOG_COUNT != 0)
   EFI_ACPI_6_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE     Watchdogs[FVP_WATCHDOG_COUNT];
+#endif
 } FVP_GENERIC_TIMER_DESCRIPTION_TABLES;
 
 #pragma pack ()
@@ -106,7 +108,11 @@ FVP_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = {
     FVP_GTDT_GTIMER_FLAGS,                                // UINT32  NonSecurePL2TimerFlags
     FVP_CNT_READ_BASE_ADDRESS,                            // UINT64  CntReadBasePhysicalAddress
     FVP_PLATFORM_TIMER_COUNT,                             // UINT32  PlatformTimerCount
+#if (FVP_WATCHDOG_COUNT != 0)
     sizeof (EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLE) // UINT32  PlatfromTimerOffset
+#else
+    0
+#endif
   },
   {
     EFI_ACPI_6_1_GTDT_GT_BLOCK,                           // UINT8 Type
@@ -146,6 +152,7 @@ FVP_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = {
       FVP_GTX_COMMON_FLAGS                                  // UINT32 GTxCommonFlags
     }
   },
+#if (FVP_WATCHDOG_COUNT != 0)
   {
     {
       EFI_ACPI_6_1_GTDT_SBSA_GENERIC_WATCHDOG,                // UINT8 Type
@@ -157,6 +164,7 @@ FVP_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = {
       FVP_SBSA_WATCHDOG_FLAGS                                 // UINT32 WatchdogTimerFlags
     }
   }
+#endif
 };
 
 //
-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")



  parent reply	other threads:[~2017-09-21 20:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21 21:01 [PATCH v2 0/2] Use PCD for Watchdog count evan.lloyd
2017-09-21 21:01 ` [PATCH v2 1/2] ArmPlatformPkg: Add PCD for SBSA Watchdog Count evan.lloyd
2017-09-21 21:01 ` evan.lloyd [this message]
2017-10-06 14:18 ` [PATCH v2 0/2] Use PCD for Watchdog count Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170921210142.6932-3-evan.lloyd@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox