public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag
@ 2018-03-07  6:55 Heyi Guo
  2018-03-07  6:55 ` [PATCH 2/3] Hisilicon: disable GICv3 legacy mode Heyi Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Heyi Guo @ 2018-03-07  6:55 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] 8+ messages in thread

* [PATCH 2/3] Hisilicon: disable GICv3 legacy mode
  2018-03-07  6:55 [PATCH 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag Heyi Guo
@ 2018-03-07  6:55 ` Heyi Guo
  2018-03-07  6:55 ` [PATCH 3/3] Hisilicon/D05: Support SBSA watchdog Heyi Guo
  2018-03-07  9:36 ` [PATCH 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag Laszlo Ersek
  2 siblings, 0 replies; 8+ messages in thread
From: Heyi Guo @ 2018-03-07  6:55 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] 8+ messages in thread

* [PATCH 3/3] Hisilicon/D05: Support SBSA watchdog
  2018-03-07  6:55 [PATCH 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag Heyi Guo
  2018-03-07  6:55 ` [PATCH 2/3] Hisilicon: disable GICv3 legacy mode Heyi Guo
@ 2018-03-07  6:55 ` Heyi Guo
  2018-03-07 16:10   ` Ard Biesheuvel
  2018-03-07  9:36 ` [PATCH 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag Laszlo Ersek
  2 siblings, 1 reply; 8+ messages in thread
From: Heyi Guo @ 2018-03-07  6:55 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>
---
 Platform/Hisilicon/D05/D05.dsc                              |  4 ++++
 Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf |  2 ++
 Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc            | 19 +++++++------------
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
index 0792b0814ea1..22eaf356224d 100644
--- a/Platform/Hisilicon/D05/D05.dsc
+++ b/Platform/Hisilicon/D05/D05.dsc
@@ -418,6 +418,10 @@ [PcdsFixedAtBuild.common]
 
   gHisiTokenSpaceGuid.Pcdsoctype|0x1610
 
+  # SBSA watchdog on Hi1616
+  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase|0x40500000
+  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase|0x40600000
+
 ################################################################################
 #
 # Components Section - list of all EDK II Modules needed by this Platform
diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf b/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
index bb279c8e428e..6955e6145c30 100644
--- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
+++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
@@ -55,5 +55,7 @@ [FixedPcd]
   gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
   gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
   gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
+  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
 
diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
index 2a9d209c00f0..6bc1bde2a490 100644
--- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
+++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
@@ -29,6 +29,7 @@
 #define GTDT_TIMER_ALWAYS_ON_CAPABILITY EFI_ACPI_6_1_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY
 
 #define GTDT_GTIMER_FLAGS           (GTDT_TIMER_ALWAYS_ON_CAPABILITY | GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED)
+#define WATCHDOG_SPAN  0x20000000
 
 #pragma pack (1)
 
@@ -57,22 +58,16 @@ 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(
+      FixedPcdGet32 (PcdGenericWatchdogRefreshBase), FixedPcdGet32 (PcdGenericWatchdogControlBase), 400, 0),
+    EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(
+      FixedPcdGet32 (PcdGenericWatchdogRefreshBase) + WATCHDOG_SPAN, FixedPcdGet32 (PcdGenericWatchdogControlBase) + WATCHDOG_SPAN, 496, 0)
+
   }
-#else /* !notyet */
-  0, 0
-  }
-#endif
   };
 
 //
-- 
2.7.4



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

* Re: [PATCH 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag
  2018-03-07  6:55 [PATCH 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag Heyi Guo
  2018-03-07  6:55 ` [PATCH 2/3] Hisilicon: disable GICv3 legacy mode Heyi Guo
  2018-03-07  6:55 ` [PATCH 3/3] Hisilicon/D05: Support SBSA watchdog Heyi Guo
@ 2018-03-07  9:36 ` Laszlo Ersek
  2018-03-08  1:15   ` Guo Heyi
  2 siblings, 1 reply; 8+ messages in thread
From: Laszlo Ersek @ 2018-03-07  9:36 UTC (permalink / raw)
  To: Heyi Guo, edk2-devel; +Cc: Leif Lindholm, Jason Zhang, Ard Biesheuvel

Hello Heyi,

On 03/07/18 07:55, Heyi Guo wrote:
> 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(-)

this is for edk2-platforms, isn't it?

If so, next time please add "edk2-platforms" to the subject prefix, as in:

  [PATCH edk2-platforms]

or

  [edk2-platforms PATCH]

Thanks!
Laszlo


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

* Re: [PATCH 3/3] Hisilicon/D05: Support SBSA watchdog
  2018-03-07  6:55 ` [PATCH 3/3] Hisilicon/D05: Support SBSA watchdog Heyi Guo
@ 2018-03-07 16:10   ` Ard Biesheuvel
  2018-03-07 16:11     ` Ard Biesheuvel
  2018-03-12  1:53     ` Guo Heyi
  0 siblings, 2 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2018-03-07 16:10 UTC (permalink / raw)
  To: Heyi Guo
  Cc: edk2-devel@lists.01.org, Chenhui Sun, Leif Lindholm,
	Graeme Gregory

On 7 March 2018 at 06:55, Heyi Guo <heyi.guo@linaro.org> wrote:
> 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>
> ---
>  Platform/Hisilicon/D05/D05.dsc                              |  4 ++++
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf |  2 ++
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc            | 19 +++++++------------
>  3 files changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
> index 0792b0814ea1..22eaf356224d 100644
> --- a/Platform/Hisilicon/D05/D05.dsc
> +++ b/Platform/Hisilicon/D05/D05.dsc
> @@ -418,6 +418,10 @@ [PcdsFixedAtBuild.common]
>
>    gHisiTokenSpaceGuid.Pcdsoctype|0x1610
>
> +  # SBSA watchdog on Hi1616
> +  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase|0x40500000
> +  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase|0x40600000
> +
>  ################################################################################
>  #
>  # Components Section - list of all EDK II Modules needed by this Platform
> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf b/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> index bb279c8e428e..6955e6145c30 100644
> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> @@ -55,5 +55,7 @@ [FixedPcd]
>    gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
>    gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
>    gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
> +  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
> +  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
>    gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
>
> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
> index 2a9d209c00f0..6bc1bde2a490 100644
> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
> @@ -29,6 +29,7 @@
>  #define GTDT_TIMER_ALWAYS_ON_CAPABILITY EFI_ACPI_6_1_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY
>
>  #define GTDT_GTIMER_FLAGS           (GTDT_TIMER_ALWAYS_ON_CAPABILITY | GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED)
> +#define WATCHDOG_SPAN  0x20000000
>

Please don't use

gArmTokenSpaceGuid.PcdGenericWatchdogXXXBase

to describe two different instances of the IP that are %!@ MB apart.

Instead, you could introduce your own PCDs in the HiSilicon token
space, but I am also fine with creating local #defines in this file if
the watchdog is not used anywhere else.


>  #pragma pack (1)
>
> @@ -57,22 +58,16 @@ 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(
> +      FixedPcdGet32 (PcdGenericWatchdogRefreshBase), FixedPcdGet32 (PcdGenericWatchdogControlBase), 400, 0),
> +    EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(
> +      FixedPcdGet32 (PcdGenericWatchdogRefreshBase) + WATCHDOG_SPAN, FixedPcdGet32 (PcdGenericWatchdogControlBase) + WATCHDOG_SPAN, 496, 0)
> +
>    }
> -#else /* !notyet */
> -  0, 0
> -  }
> -#endif
>    };
>
>  //
> --
> 2.7.4
>


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

* Re: [PATCH 3/3] Hisilicon/D05: Support SBSA watchdog
  2018-03-07 16:10   ` Ard Biesheuvel
@ 2018-03-07 16:11     ` Ard Biesheuvel
  2018-03-12  1:53     ` Guo Heyi
  1 sibling, 0 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2018-03-07 16:11 UTC (permalink / raw)
  To: Heyi Guo; +Cc: edk2-devel@lists.01.org, Leif Lindholm, Graeme Gregory

On 7 March 2018 at 16:10, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> On 7 March 2018 at 06:55, Heyi Guo <heyi.guo@linaro.org> wrote:
>> 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>
>> ---
>>  Platform/Hisilicon/D05/D05.dsc                              |  4 ++++
>>  Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf |  2 ++
>>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc            | 19 +++++++------------
>>  3 files changed, 13 insertions(+), 12 deletions(-)
>>
>> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
>> index 0792b0814ea1..22eaf356224d 100644
>> --- a/Platform/Hisilicon/D05/D05.dsc
>> +++ b/Platform/Hisilicon/D05/D05.dsc
>> @@ -418,6 +418,10 @@ [PcdsFixedAtBuild.common]
>>
>>    gHisiTokenSpaceGuid.Pcdsoctype|0x1610
>>
>> +  # SBSA watchdog on Hi1616
>> +  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase|0x40500000
>> +  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase|0x40600000
>> +
>>  ################################################################################
>>  #
>>  # Components Section - list of all EDK II Modules needed by this Platform
>> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf b/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
>> index bb279c8e428e..6955e6145c30 100644
>> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
>> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
>> @@ -55,5 +55,7 @@ [FixedPcd]
>>    gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
>>    gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
>>    gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
>> +  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
>> +  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
>>
>> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
>> index 2a9d209c00f0..6bc1bde2a490 100644
>> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
>> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
>> @@ -29,6 +29,7 @@
>>  #define GTDT_TIMER_ALWAYS_ON_CAPABILITY EFI_ACPI_6_1_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY
>>
>>  #define GTDT_GTIMER_FLAGS           (GTDT_TIMER_ALWAYS_ON_CAPABILITY | GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED)
>> +#define WATCHDOG_SPAN  0x20000000
>>
>
> Please don't use
>
> gArmTokenSpaceGuid.PcdGenericWatchdogXXXBase
>
> to describe two different instances of the IP that are %!@ MB apart.
>

I don't know what happened there :-) That should be 512 MB, obviously.

> Instead, you could introduce your own PCDs in the HiSilicon token
> space, but I am also fine with creating local #defines in this file if
> the watchdog is not used anywhere else.
>
>
>>  #pragma pack (1)
>>
>> @@ -57,22 +58,16 @@ 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(
>> +      FixedPcdGet32 (PcdGenericWatchdogRefreshBase), FixedPcdGet32 (PcdGenericWatchdogControlBase), 400, 0),
>> +    EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(
>> +      FixedPcdGet32 (PcdGenericWatchdogRefreshBase) + WATCHDOG_SPAN, FixedPcdGet32 (PcdGenericWatchdogControlBase) + WATCHDOG_SPAN, 496, 0)
>> +
>>    }
>> -#else /* !notyet */
>> -  0, 0
>> -  }
>> -#endif
>>    };
>>
>>  //
>> --
>> 2.7.4
>>


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

* Re: [PATCH 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag
  2018-03-07  9:36 ` [PATCH 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag Laszlo Ersek
@ 2018-03-08  1:15   ` Guo Heyi
  0 siblings, 0 replies; 8+ messages in thread
From: Guo Heyi @ 2018-03-08  1:15 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: Heyi Guo, edk2-devel, Leif Lindholm, Jason Zhang, Ard Biesheuvel

Yes it is. Sorry for missing to do that. Will keep in mind next time :)

Thanks,
Heyi


On Wed, Mar 07, 2018 at 10:36:48AM +0100, Laszlo Ersek wrote:
> Hello Heyi,
> 
> On 03/07/18 07:55, Heyi Guo wrote:
> > 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(-)
> 
> this is for edk2-platforms, isn't it?
> 
> If so, next time please add "edk2-platforms" to the subject prefix, as in:
> 
>   [PATCH edk2-platforms]
> 
> or
> 
>   [edk2-platforms PATCH]
> 
> Thanks!
> Laszlo


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

* Re: [PATCH 3/3] Hisilicon/D05: Support SBSA watchdog
  2018-03-07 16:10   ` Ard Biesheuvel
  2018-03-07 16:11     ` Ard Biesheuvel
@ 2018-03-12  1:53     ` Guo Heyi
  1 sibling, 0 replies; 8+ messages in thread
From: Guo Heyi @ 2018-03-12  1:53 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Heyi Guo, edk2-devel@lists.01.org, Chenhui Sun, Leif Lindholm,
	Graeme Gregory

On Wed, Mar 07, 2018 at 04:10:23PM +0000, Ard Biesheuvel wrote:
> On 7 March 2018 at 06:55, Heyi Guo <heyi.guo@linaro.org> wrote:
> > 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>
> > ---
> >  Platform/Hisilicon/D05/D05.dsc                              |  4 ++++
> >  Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf |  2 ++
> >  Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc            | 19 +++++++------------
> >  3 files changed, 13 insertions(+), 12 deletions(-)
> >
> > diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
> > index 0792b0814ea1..22eaf356224d 100644
> > --- a/Platform/Hisilicon/D05/D05.dsc
> > +++ b/Platform/Hisilicon/D05/D05.dsc
> > @@ -418,6 +418,10 @@ [PcdsFixedAtBuild.common]
> >
> >    gHisiTokenSpaceGuid.Pcdsoctype|0x1610
> >
> > +  # SBSA watchdog on Hi1616
> > +  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase|0x40500000
> > +  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase|0x40600000
> > +
> >  ################################################################################
> >  #
> >  # Components Section - list of all EDK II Modules needed by this Platform
> > diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf b/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> > index bb279c8e428e..6955e6145c30 100644
> > --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> > +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616.inf
> > @@ -55,5 +55,7 @@ [FixedPcd]
> >    gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
> >    gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
> >    gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
> > +  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
> > +  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
> >    gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
> >
> > diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
> > index 2a9d209c00f0..6bc1bde2a490 100644
> > --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
> > +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Gtdt.aslc
> > @@ -29,6 +29,7 @@
> >  #define GTDT_TIMER_ALWAYS_ON_CAPABILITY EFI_ACPI_6_1_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY
> >
> >  #define GTDT_GTIMER_FLAGS           (GTDT_TIMER_ALWAYS_ON_CAPABILITY | GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED)
> > +#define WATCHDOG_SPAN  0x20000000
> >
> 
> Please don't use
> 
> gArmTokenSpaceGuid.PcdGenericWatchdogXXXBase
> 
> to describe two different instances of the IP that are %!@ MB apart.
> 
> Instead, you could introduce your own PCDs in the HiSilicon token
> space, but I am also fine with creating local #defines in this file if
> the watchdog is not used anywhere else.

Yes they are not used anywhere else, and the number of SBSA watchdogs is SoC
related, so I will use local #defines. And I think we can simply change the
content of the macros when things change in the future.

Thanks,
Heyi

> 
> 
> >  #pragma pack (1)
> >
> > @@ -57,22 +58,16 @@ 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(
> > +      FixedPcdGet32 (PcdGenericWatchdogRefreshBase), FixedPcdGet32 (PcdGenericWatchdogControlBase), 400, 0),
> > +    EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(
> > +      FixedPcdGet32 (PcdGenericWatchdogRefreshBase) + WATCHDOG_SPAN, FixedPcdGet32 (PcdGenericWatchdogControlBase) + WATCHDOG_SPAN, 496, 0)
> > +
> >    }
> > -#else /* !notyet */
> > -  0, 0
> > -  }
> > -#endif
> >    };
> >
> >  //
> > --
> > 2.7.4
> >


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

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

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-07  6:55 [PATCH 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag Heyi Guo
2018-03-07  6:55 ` [PATCH 2/3] Hisilicon: disable GICv3 legacy mode Heyi Guo
2018-03-07  6:55 ` [PATCH 3/3] Hisilicon/D05: Support SBSA watchdog Heyi Guo
2018-03-07 16:10   ` Ard Biesheuvel
2018-03-07 16:11     ` Ard Biesheuvel
2018-03-12  1:53     ` Guo Heyi
2018-03-07  9:36 ` [PATCH 1/3] Hisilicon/D0x: Set ACPI GTDT always-on flag Laszlo Ersek
2018-03-08  1:15   ` Guo Heyi

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