From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::244; helo=mail-io0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CCAE521ED1C71 for ; Wed, 7 Mar 2018 08:04:09 -0800 (PST) Received: by mail-io0-x244.google.com with SMTP id 30so3601552iog.2 for ; Wed, 07 Mar 2018 08:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=M/TgH/XhU3a+RSMENw1pTP0Vy+yW5DTICTyGRNAuRkU=; b=GM2jmtSsfVs0mfS6eOZPLuQkdsbIvLiArsw7PiIkr0W5wlT4PLQzRwvzYxxKVCtw2c vOniURFs4bMlrqXDDdUugVGdX0w0mWk07+oqU4tKJejoLpO7G2Jjkd5pF9oJAh40tGzQ GImke/CHdjg438Q1YH+7QFirJNP+PmzF83LeY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=M/TgH/XhU3a+RSMENw1pTP0Vy+yW5DTICTyGRNAuRkU=; b=jRqBnWP8iieywQfg9TCtTs1UzywHjjxqtouSNTIFAP64eXOpVL+CSz74PKkWhBLqrE W7lugphtorWVYwaSk4HWOJoE41qpgbbEVaMbwW8j68AwsidPdUbM5l2qnEe4+forqzs8 rTAySlYfvBiAieC/ojlp2xP3TfbR+AW9DQi+I6JcXIldPNUjp1byEzrAtk+3G/QcZEOm lhhobLKEOmHrkxhNRBeIJmsZxzTjTPJIn7aLjA8BJe5aHcZ5CJC3ZhQ+SotkVe0LISbF uAktsO9Y00QI8vvUzXC1z7jOz+WlbmlIQmZe2NOMgGp9BkDLfXXySONuX3j8oiXu2i5n 2ykA== X-Gm-Message-State: AElRT7G9P8NlQvEy6PEEUkNNlvE0ehQvzMWTyePa+kAKsFI3O+tTDu+f E8nqgBmwCd7R42bIo808h8ElAH4uFmzVqqlhwQBFrQ== X-Google-Smtp-Source: AG47ELvTXlM3XGifbl17JFJ77dSgX152KyurqdYi0kXwVrlFVgdTEMuX+69CauI7cHYpunn9Q4uceDx7wl+7E51F2Yg= X-Received: by 10.107.56.69 with SMTP id f66mr25426703ioa.170.1520439023818; Wed, 07 Mar 2018 08:10:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.138.209 with HTTP; Wed, 7 Mar 2018 08:10:23 -0800 (PST) In-Reply-To: <1520405747-11023-3-git-send-email-heyi.guo@linaro.org> References: <1520405747-11023-1-git-send-email-heyi.guo@linaro.org> <1520405747-11023-3-git-send-email-heyi.guo@linaro.org> From: Ard Biesheuvel Date: Wed, 7 Mar 2018 16:10:23 +0000 Message-ID: To: Heyi Guo Cc: "edk2-devel@lists.01.org" , Chenhui Sun , Leif Lindholm , Graeme Gregory Subject: Re: [PATCH 3/3] Hisilicon/D05: Support SBSA watchdog X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2018 16:04:10 -0000 Content-Type: text/plain; charset="UTF-8" On 7 March 2018 at 06:55, Heyi Guo wrote: > From: Chenhui Sun > > Add description of SBSA watchdogs to ACPI GTDT on D05. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Chenhui Sun > Signed-off-by: Heyi Guo > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Graeme Gregory > --- > 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 >