From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by mx.groups.io with SMTP id smtpd.web08.1197.1604335912242088102 for ; Mon, 02 Nov 2020 08:51:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=JKUcJwNT; spf=pass (domain: linaro.org, ip: 209.85.222.196, mailfrom: shashi.mallela@linaro.org) Received: by mail-qk1-f196.google.com with SMTP id a65so9815698qkg.13 for ; Mon, 02 Nov 2020 08:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QtpHIw8cbHgOeHQHBJQp1UnGUHUCfp0MGLMa4m8S04U=; b=JKUcJwNTeXarxXxjdanlieorhX8VpAZE8Gqi2RmMjo/ihvBJtH1jM0eRRNl6IataeD /niMEQOLZLyb8VMjphmp5lNP/Pozl3vKhZ9O1t0KKA5IYbJS/EmVhlAhCV4U6JM5Owzq f4RBSfNCJMZ0eT/cJb/QgtvApmt8M95TRvNoWHNUhuSVeFLRQYLxAN9adsKlcbfMBLAO PAoZPWj6uTIE+uNinu486cjKTYWoV/K2+TmK/JWwadDKOWidw1zuEGzuqJtUQ6cSb/Sx SeVPwdb2tF5+ADhNi9nP49/Y2zbqos9PawnzsQ/iVZmtTQ6y5mGV4A/LruwAzHYJC90r /LMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QtpHIw8cbHgOeHQHBJQp1UnGUHUCfp0MGLMa4m8S04U=; b=b6mEuRmszkSmsDQfRjVqfVDdQSKZKutB6h5CLcCMsOiEF+2Vu75PIV3gDnbYQ475wM j9U3POx3QE9TEiOXQ3JT/8hd/Va7Dvae8IKbpa3a8DgfVYjsH5Yu7NRUeE86udg/fxmY exxGSta4tSLflMds51ohDVnpBC3qt1G2V9RbHZ53s7Lf9aUL/r/YmXwkJC4XtmS5DRO2 beyiggUIcOrvS4VJkFi5XEjHLNlRGc9WeMddKxbmpeW08inul3z8EUMDQ5vHseULk3eJ A5j1gP6Us/8u15t/Mf9+VpV+y6k91BG6U02efYbXLCegORjJX5TELtIPLM2MpA+BCBZM xJqw== X-Gm-Message-State: AOAM533itfWNkNLii2sUsDaJ793X4ySVilqphtoneZLwZgS1JSWN0S21 I7HHyMrS+LPShZOTYHKa8+IkNw== X-Google-Smtp-Source: ABdhPJx5gLhmKlK6jimqK4vzPnaWgUa/GJ9ZUtysTBIhtnBINUm+ob80mMwP5DhHwHrjYV5lamN48Q== X-Received: by 2002:a37:315:: with SMTP id 21mr15914215qkd.330.1604335911365; Mon, 02 Nov 2020 08:51:51 -0800 (PST) Return-Path: Received: from localhost.localdomain (bras-base-stsvon1503w-grc-22-142-114-143-244.dsl.bell.ca. [142.114.143.244]) by smtp.googlemail.com with ESMTPSA id q3sm8337600qkf.24.2020.11.02.08.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 08:51:50 -0800 (PST) From: "Shashi Mallela" To: leif@nuviainc.com, ard.biesheuvel@arm.com, graeme@nuviainc.com Cc: devel@edk2.groups.io Subject: [PATCH v4 1/1] Silicon/Qemu/Sbsa: Add SBSA-wdt entry to GTDT Date: Mon, 2 Nov 2020 11:51:48 -0500 Message-Id: <20201102165148.10509-2-shashi.mallela@linaro.org> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20201102165148.10509-1-shashi.mallela@linaro.org> References: <20201102165148.10509-1-shashi.mallela@linaro.org> SBSA generic watchdog timer structure entry has been added to GTDT table as per SBSAv6.0. This enables acpi detection of wdt in qemu sbsa platform Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Graeme Gregory Signed-off-by: Shashi Mallela --- Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc | 57 ++++++++++++++++++---- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc b/Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc index d16778e01a5c..a010b908c434 100644 --- a/Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc @@ -24,27 +24,55 @@ #define SYSTEM_TIMER_BASE_ADDRESS 0xFFFFFFFFFFFFFFFF #endif -#define GTDT_TIMER_EDGE_TRIGGERED EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE +#define GTDT_TIMER_EDGE_TRIGGERED EFI_ACPI_6_3_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE #define GTDT_TIMER_LEVEL_TRIGGERED 0 -#define GTDT_TIMER_ACTIVE_LOW EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY +#define GTDT_TIMER_ACTIVE_LOW EFI_ACPI_6_3_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY #define GTDT_TIMER_ACTIVE_HIGH 0 #define GTDT_GTIMER_FLAGS (GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED) +#define SBSA_PLATFORM_WATCHDOG_COUNT 1 +#define SBSA_PLATFORM_TIMER_COUNT (SBSA_PLATFORM_WATCHDOG_COUNT) + +#define SBSAQEMU_WDT_REFRESH_FRAME_BASE 0x50010000 +#define SBSAQEMU_WDT_CONTROL_FRAME_BASE 0x50011000 +#define SBSAQEMU_WDT_IRQ 44 + +#define GTDT_WDTIMER_EDGE_TRIGGERED EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_MODE +#define GTDT_WDTIMER_LEVEL_TRIGGERED 0 +#define GTDT_WDTIMER_ACTIVE_LOW EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_POLARITY +#define GTDT_WDTIMER_ACTIVE_HIGH 0 + +#define GTDT_WDTIMER_FLAGS (GTDT_WDTIMER_ACTIVE_HIGH | GTDT_WDTIMER_LEVEL_TRIGGERED) + +#define EFI_ACPI_6_3_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT( \ + RefreshFramePhysicalAddress, ControlFramePhysicalAddress, \ + WatchdogTimerGSIV, WatchdogTimerFlags) \ + { \ + EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG, \ + sizeof(EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE), \ + EFI_ACPI_RESERVED_WORD, \ + RefreshFramePhysicalAddress, \ + ControlFramePhysicalAddress, \ + WatchdogTimerGSIV, \ + WatchdogTimerFlags \ + } + #pragma pack (1) typedef struct { - EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt; - } GENERIC_TIMER_DESCRIPTION_TABLE; + EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt; + EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE Gwdt; + } GENERIC_TIMER_DESCRIPTION_TABLES; #pragma pack () - GENERIC_TIMER_DESCRIPTION_TABLE Gtdt = { + GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = { { SBSAQEMU_ACPI_HEADER( - EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, - GENERIC_TIMER_DESCRIPTION_TABLE, - EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION + EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, + GENERIC_TIMER_DESCRIPTION_TABLES, + EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION ), SYSTEM_TIMER_BASE_ADDRESS, // UINT64 PhysicalAddress 0, // UINT32 Reserved @@ -57,9 +85,18 @@ FixedPcdGet32 (PcdArmArchTimerHypIntrNum), // UINT32 NonSecurePL2TimerGSIV GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL2TimerFlags 0xFFFFFFFFFFFFFFFF, // UINT64 CntReadBasePhysicalAddress - 0, // UINT32 PlatformTimerCount - 0 + SBSA_PLATFORM_TIMER_COUNT, // UINT32 PlatformTimerCount + sizeof(EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE), + // UINT32 PlatformTimerOffset + 0, // UINT32 VirtualPL2TimerGSIV + 0 // UINT32 VirtualPL2TimerFlags }, + EFI_ACPI_6_3_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT( + SBSAQEMU_WDT_REFRESH_FRAME_BASE, + SBSAQEMU_WDT_CONTROL_FRAME_BASE, + SBSAQEMU_WDT_IRQ, + GTDT_WDTIMER_FLAGS + ) }; // Reference the table being generated to prevent the optimizer from removing the -- 2.18.4