From nobody Wed May 8 06:57:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+66868+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+66868+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1604335918; cv=none; d=zohomail.com; s=zohoarc; b=moGq5bvrossY6gHHtZ3j6vv1vs7LFCHGprOYB+I38EDBog7IiCkvSUIaeP4Cz505CJyG+V/kyTkqWZcUYpGgsZ2vzmKAEJEdSzlCzmh+Ok3AXTWjDadA1Z72Be6ryHFmmSbOPtGH8G+17maUf45yoDxzRxwYP1qqpX6nBhuTp9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604335918; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=t78z9Al1OVvjrxpF96pgRjqvCuPL++BGf+swUy1Dagk=; b=VF4xaPLl5szMsPOelZsJBvDktOvC4fjJz9HVAO3jvc1+J2Q421DMH26Tltzu9+g1/nsQ3URmB1kokJ09hlqEgeAc73Ucnx7koteaeykl69z8KCvXXvGYG2c8qok2p8QVcfsnQQLvFUKLrhl3UpTHXPrRWH+b4tFgzEno4T3S11Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+66868+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1604335918228320.3934348488783; Mon, 2 Nov 2020 08:51:58 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1etOYY1788612x75DCDMhiTz; Mon, 02 Nov 2020 08:51:57 -0800 X-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 X-Received: by mail-qk1-f196.google.com with SMTP id a65so9815698qkg.13 for ; Mon, 02 Nov 2020 08:51:52 -0800 (PST) X-Gm-Message-State: ckYe3Fg34tmdnysRqaAiedbGx1787277AA= 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) X-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: [edk2-devel] [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> In-Reply-To: <20201102165148.10509-1-shashi.mallela@linaro.org> References: <20201102165148.10509-1-shashi.mallela@linaro.org> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,shashi.mallela@linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604335917; bh=S3tmwUt4Ml/HryohqCjGqe9Wa+LmhOchAhVS1Uul/dw=; h=Cc:Date:From:Reply-To:Subject:To; b=KI6/6uSaXO/W7f4OAC3Bt2bpnFLLn9rNu4aYXh0PbwCtwZ4YwI6q/pI8QYFgewDv4At 1VMV5//UNQ7Rwa6r/orsNH+MAda/9YCRmf4QQEynwE2cW9NrjInxhLlUl+saMDFhO20Yx BAxIqR+mgaxNGNfvm3uzCoEoACn1NKTsAMw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Acked-by: Leif Lindholm Reviewed-by: Graeme Gregory --- 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/Sbsa= Qemu/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 =20 -#define GTDT_TIMER_EDGE_TRIGGERED EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INT= ERRUPT_MODE +#define GTDT_TIMER_EDGE_TRIGGERED EFI_ACPI_6_3_GTDT_TIMER_FLAG_TIMER_INT= ERRUPT_MODE #define GTDT_TIMER_LEVEL_TRIGGERED 0 -#define GTDT_TIMER_ACTIVE_LOW EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INT= ERRUPT_POLARITY +#define GTDT_TIMER_ACTIVE_LOW EFI_ACPI_6_3_GTDT_TIMER_FLAG_TIMER_INT= ERRUPT_POLARITY #define GTDT_TIMER_ACTIVE_HIGH 0 =20 #define GTDT_GTIMER_FLAGS (GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LE= VEL_TRIGGERED) =20 +#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_WATCH= DOG_FLAG_TIMER_INTERRUPT_MODE +#define GTDT_WDTIMER_LEVEL_TRIGGERED 0 +#define GTDT_WDTIMER_ACTIVE_LOW EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCH= DOG_FLAG_TIMER_INTERRUPT_POLARITY +#define GTDT_WDTIMER_ACTIVE_HIGH 0 + +#define GTDT_WDTIMER_FLAGS (GTDT_WDTIMER_ACTIVE_HIGH | GTDT_WDTIM= ER_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) =20 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; =20 #pragma pack () =20 - GENERIC_TIMER_DESCRIPTION_TABLE Gtdt =3D { + GENERIC_TIMER_DESCRIPTION_TABLES Gtdt =3D { { 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 PhysicalAdd= ress 0, // UINT32 Reserved @@ -57,9 +85,18 @@ FixedPcdGet32 (PcdArmArchTimerHypIntrNum), // UINT32 NonSecurePL= 2TimerGSIV GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL= 2TimerFlags 0xFFFFFFFFFFFFFFFF, // UINT64 CntReadBase= PhysicalAddress - 0, // UINT32 PlatformTim= erCount - 0 + SBSA_PLATFORM_TIMER_COUNT, // UINT32 PlatformTim= erCount + sizeof(EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE), + // UINT32 PlatformTim= erOffset + 0, // UINT32 VirtualPL2T= imerGSIV + 0 // UINT32 VirtualPL2T= imerFlags }, + 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 + ) }; =20 // Reference the table being generated to prevent the optimizer from remov= ing the --=20 2.18.4 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#66868): https://edk2.groups.io/g/devel/message/66868 Mute This Topic: https://groups.io/mt/77985821/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-