public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms PATCH v2 0/3] Fix SBSA test failures on D05
@ 2018-03-12  8:16 Heyi Guo
  2018-03-12  8:16 ` [edk2-platforms PATCH v2 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag Heyi Guo
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Heyi Guo @ 2018-03-12  8:16 UTC (permalink / raw)
  To: edk2-devel
  Cc: Heyi Guo, Ard Biesheuvel, Leif Lindholm, Graeme Gregory,
	Haojian Zhuang

These 3 patches are to fix SBSA-ACS test failures for system timer and watch dog
timer on Hisilicon/D05.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Graeme Gregory <graeme.gregory@linaro.org>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>

v2:
- Modify patch [3/3] according to Ard's comments.

Chenhui Sun (1):
  Hisilicon/D05: Support SBSA watchdog

Jason Zhang (1):
  Hisilicon/D0x: Set ACPI GTDT always-on flag

gongchengya (1):
  Hisilicon: disable GICv3 legacy mode

 Silicon/Hisilicon/Hisilicon.dsc.inc                 |  2 +-
 Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/Gtdt.aslc |  3 ++-
 Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc    | 27 ++++++++++----------
 3 files changed, 17 insertions(+), 15 deletions(-)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [edk2-platforms PATCH v2 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag
  2018-03-12  8:16 [edk2-platforms PATCH v2 0/3] Fix SBSA test failures on D05 Heyi Guo
@ 2018-03-12  8:16 ` Heyi Guo
  2018-03-12  8:16 ` [edk2-platforms PATCH v2 2/3] Hisilicon: disable GICv3 legacy mode Heyi Guo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Heyi Guo @ 2018-03-12  8:16 UTC (permalink / raw)
  To: edk2-devel
  Cc: Jason Zhang, Heyi Guo, Ard Biesheuvel, Leif Lindholm,
	Graeme Gregory

From: Jason Zhang <zhangjinsong2@huawei.com>

Timer is always working on Hisilicon D0x, even system enters WFI/WFE,
and there is no other low power status, so we set "always-on" flag in
ACPI GTDT.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jason Zhang <zhangjinsong2@huawei.com>
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Graeme Gregory <graeme.gregory@linaro.org>
---
 Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/Gtdt.aslc | 3 ++-
 Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc    | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/Gtdt.aslc b/Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/Gtdt.aslc
index 4c1050ae83b9..3feb99e88c88 100644
--- a/Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/Gtdt.aslc
+++ b/Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/Gtdt.aslc
@@ -40,8 +40,9 @@
 #define GTDT_TIMER_LEVEL_TRIGGERED  0
 #define GTDT_TIMER_ACTIVE_LOW       EFI_ACPI_6_1_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY
 #define GTDT_TIMER_ACTIVE_HIGH      0
+#define GTDT_TIMER_ALWAYS_ON_CAPABILITY EFI_ACPI_6_1_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY
 
-#define GTDT_GTIMER_FLAGS           (GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED)
+#define GTDT_GTIMER_FLAGS           (GTDT_TIMER_ALWAYS_ON_CAPABILITY | GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED)
 
 #pragma pack (1)
 
diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
index 16e2c6a972ba..2a9d209c00f0 100644
--- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
+++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
@@ -28,7 +28,7 @@
 #define GTDT_TIMER_ACTIVE_HIGH      0
 #define GTDT_TIMER_ALWAYS_ON_CAPABILITY EFI_ACPI_6_1_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY
 
-#define GTDT_GTIMER_FLAGS           (GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED)
+#define GTDT_GTIMER_FLAGS           (GTDT_TIMER_ALWAYS_ON_CAPABILITY | GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED)
 
 #pragma pack (1)
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [edk2-platforms PATCH v2 2/3] Hisilicon: disable GICv3 legacy mode
  2018-03-12  8:16 [edk2-platforms PATCH v2 0/3] Fix SBSA test failures on D05 Heyi Guo
  2018-03-12  8:16 ` [edk2-platforms PATCH v2 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag Heyi Guo
@ 2018-03-12  8:16 ` Heyi Guo
  2018-03-12  8:16 ` [edk2-platforms PATCH v2 3/3] Hisilicon/D05: Support SBSA watchdog Heyi Guo
  2018-03-12 11:42 ` [edk2-platforms PATCH v2 0/3] Fix SBSA test failures on D05 Ard Biesheuvel
  3 siblings, 0 replies; 5+ messages in thread
From: Heyi Guo @ 2018-03-12  8:16 UTC (permalink / raw)
  To: edk2-devel
  Cc: gongchengya, Heyi Guo, Ard Biesheuvel, Leif Lindholm,
	Haojian Zhuang

From: gongchengya <gongchengya1@huawei.com>

Hi1616 GIC does not fully support GICv2 legacy mode, and SBSA watchdog
interrupts 400 and 496 cannot be signaled to CPU, so we switch to pure
GICv3 mode.

For other Hisilicon platforms, we suppose they don't need V2 legacy
mode either if they have GICv3. D03 also works for this patch. If the
platforms only have GICv2, this change will have no impact on them.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: gongchengya <gongchengya1@huawei.com>
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
---
 Silicon/Hisilicon/Hisilicon.dsc.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Hisilicon/Hisilicon.dsc.inc b/Silicon/Hisilicon/Hisilicon.dsc.inc
index b196322a20e2..f8d5f0b270b3 100644
--- a/Silicon/Hisilicon/Hisilicon.dsc.inc
+++ b/Silicon/Hisilicon/Hisilicon.dsc.inc
@@ -249,7 +249,7 @@ [PcdsFeatureFlag.common]
 
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 
-  gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|TRUE
+  gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|FALSE
 
 [PcdsFixedAtBuild.common]
   gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|44
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [edk2-platforms PATCH v2 3/3] Hisilicon/D05: Support SBSA watchdog
  2018-03-12  8:16 [edk2-platforms PATCH v2 0/3] Fix SBSA test failures on D05 Heyi Guo
  2018-03-12  8:16 ` [edk2-platforms PATCH v2 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag Heyi Guo
  2018-03-12  8:16 ` [edk2-platforms PATCH v2 2/3] Hisilicon: disable GICv3 legacy mode Heyi Guo
@ 2018-03-12  8:16 ` Heyi Guo
  2018-03-12 11:42 ` [edk2-platforms PATCH v2 0/3] Fix SBSA test failures on D05 Ard Biesheuvel
  3 siblings, 0 replies; 5+ messages in thread
From: Heyi Guo @ 2018-03-12  8:16 UTC (permalink / raw)
  To: edk2-devel
  Cc: Chenhui Sun, Heyi Guo, Ard Biesheuvel, Leif Lindholm,
	Graeme Gregory

From: Chenhui Sun <sunchenhui@huawei.com>

Add description of SBSA watchdogs to ACPI GTDT on D05.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chenhui Sun <sunchenhui@huawei.com>
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Graeme Gregory <graeme.gregory@linaro.org>
---

Notes:
    v2:
    - Use local defines instead of PCD+define for watchdog base address
      [Ard]

 Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc | 25 ++++++++++----------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
index 2a9d209c00f0..9f27696cf022 100644
--- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
+++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
@@ -30,6 +30,14 @@
 
 #define GTDT_GTIMER_FLAGS           (GTDT_TIMER_ALWAYS_ON_CAPABILITY | GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED)
 
+// Generic watchdog address for SCCL (Super CPU cluster) A and SCCL B on Hi1616.
+// Watchdogs on socket 1 are not mapped to SPI interrupts so we can't describe
+// them in GTDT.
+#define GENERIC_WATCHDOG_CONTROL_BASE_SCCL_A 0x40500000
+#define GENERIC_WATCHDOG_REFRESH_BASE_SCCL_A 0x40600000
+#define GENERIC_WATCHDOG_CONTROL_BASE_SCCL_B 0x60500000
+#define GENERIC_WATCHDOG_REFRESH_BASE_SCCL_B 0x60600000
+
 #pragma pack (1)
 
 typedef struct {
@@ -57,22 +65,15 @@ EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = {
     FixedPcdGet32 (PcdArmArchTimerHypIntrNum),    // UINT32  NonSecurePL2TimerGSIV
     GTDT_GTIMER_FLAGS,                            // UINT32  NonSecurePL2TimerFlags
     0xFFFFFFFFFFFFFFFF,                           // UINT64  CntReadBasePhysicalAddress
-#ifdef notyet
-    PV660_WATCHDOG_COUNT,                          // UINT32  PlatformTimerCount
+    HI1616_WATCHDOG_COUNT,                        // UINT32  PlatformTimerCount
     sizeof (EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLE) // UINT32 PlatfromTimerOffset
   },
   {
-    EFI_ACPI_6_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(
-        //FixedPcdGet32 (PcdGenericWatchdogRefreshBase), FixedPcdGet32 (PcdGenericWatchdogControlBase), 93, 0),
-        0, 0, 0, 0),
-    EFI_ACPI_6_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(
-        //FixedPcdGet32 (PcdGenericWatchdogRefreshBase), FixedPcdGet32 (PcdGenericWatchdogControlBase), 94, EFI_ACPI_6_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER)
-        0, 0, 0, 0)
+    EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(
+      GENERIC_WATCHDOG_REFRESH_BASE_SCCL_A, GENERIC_WATCHDOG_CONTROL_BASE_SCCL_A, 400, 0),
+    EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(
+      GENERIC_WATCHDOG_REFRESH_BASE_SCCL_B, GENERIC_WATCHDOG_CONTROL_BASE_SCCL_B, 496, 0)
   }
-#else /* !notyet */
-  0, 0
-  }
-#endif
   };
 
 //
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [edk2-platforms PATCH v2 0/3] Fix SBSA test failures on D05
  2018-03-12  8:16 [edk2-platforms PATCH v2 0/3] Fix SBSA test failures on D05 Heyi Guo
                   ` (2 preceding siblings ...)
  2018-03-12  8:16 ` [edk2-platforms PATCH v2 3/3] Hisilicon/D05: Support SBSA watchdog Heyi Guo
@ 2018-03-12 11:42 ` Ard Biesheuvel
  3 siblings, 0 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2018-03-12 11:42 UTC (permalink / raw)
  To: Heyi Guo
  Cc: edk2-devel@lists.01.org, Leif Lindholm, Graeme Gregory,
	Haojian Zhuang

On 12 March 2018 at 08:16, Heyi Guo <heyi.guo@linaro.org> wrote:
> These 3 patches are to fix SBSA-ACS test failures for system timer and watch dog
> timer on Hisilicon/D05.
>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Graeme Gregory <graeme.gregory@linaro.org>
> Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
>
> v2:
> - Modify patch [3/3] according to Ard's comments.
>

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

Pushed as 9422cb8c75b3..d9c87c711412

Thanks,

> Chenhui Sun (1):
>   Hisilicon/D05: Support SBSA watchdog
>
> Jason Zhang (1):
>   Hisilicon/D0x: Set ACPI GTDT always-on flag
>
> gongchengya (1):
>   Hisilicon: disable GICv3 legacy mode
>
>  Silicon/Hisilicon/Hisilicon.dsc.inc                 |  2 +-
>  Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/Gtdt.aslc |  3 ++-
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc    | 27 ++++++++++----------
>  3 files changed, 17 insertions(+), 15 deletions(-)
>
> --
> 2.7.4
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-12 11:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-12  8:16 [edk2-platforms PATCH v2 0/3] Fix SBSA test failures on D05 Heyi Guo
2018-03-12  8:16 ` [edk2-platforms PATCH v2 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag Heyi Guo
2018-03-12  8:16 ` [edk2-platforms PATCH v2 2/3] Hisilicon: disable GICv3 legacy mode Heyi Guo
2018-03-12  8:16 ` [edk2-platforms PATCH v2 3/3] Hisilicon/D05: Support SBSA watchdog Heyi Guo
2018-03-12 11:42 ` [edk2-platforms PATCH v2 0/3] Fix SBSA test failures on D05 Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox