From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by mx.groups.io with SMTP id smtpd.web10.156.1602605680437243200 for ; Tue, 13 Oct 2020 09:14:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=RLtu0COt; spf=pass (domain: linaro.org, ip: 209.85.160.175, mailfrom: shashi.mallela@linaro.org) Received: by mail-qt1-f175.google.com with SMTP id h19so294022qtq.4 for ; Tue, 13 Oct 2020 09:14:40 -0700 (PDT) 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=EvGEUn0PbkUrA9zf2LnpcdAuUqkscDt0JMVU8slcIxg=; b=RLtu0COtkvp08KVFbroxy1iC8vrct4FifoyydERYcXm96Y9NImhEPZ/sRasDFi+HZV FTGLn5xxR2bRVcdU4aVUQJHb8BpSBtWAHVKmJQeMECEGXsKdjl6GxVJPaKCp3V6pE5bB Wq0nsp4y66Op6xDxO/mHw777NUpHvEMThKTncsgYmqrgLYduChdUJ3G1HIZcjy6Pu4Iz QdkBUA07rjIjf5VhFNiOAF6mlII+ucD9irN5v3lxJHOSiQRvqqBCL18kmAN73Tw+NeKB RheOHIV8ZdWI6YMmRYmjcv0Qt8M/fdMi2jBdbM3qLyyiWcEDoQM2s4HIkkr4mNVO4IXU BVCg== 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=EvGEUn0PbkUrA9zf2LnpcdAuUqkscDt0JMVU8slcIxg=; b=TBeUCqux5uhef8O4i3RzEHcGkivk+Hf3rtw1ZbEP+JykVKDSKCsRTYshMPmxvAUL2Q pNpzV26fTnWUouJkSUujkTVt/1juQrIG6LS0jOv7m+7cTiS16BlbvmmsvPGFwKQRiOV0 RhsP9oNU9XD50Rg58122L5Fc0n5H4FKFeIaNdY0Tb8DBBV4Q65yl/O7n9dp03vgj7PYx CkhXW6YNEcYN3UufRz2SZO1MKELl2R8nzRvoYmF6BO1HiyXVgr1Q9SyYlmeavU4CZRrl Ttf6LChe7K24utUXdR001Rxaqf667t7WHK2oSRMeHCNsvVN2gAMaVG+3wVl2kllMVTOi TMAw== X-Gm-Message-State: AOAM533GqnpJdTIj+y/lnQzF99bTATEGOnO07Qa5oZzxeVz3t5RB1zG9 82OnA9Y8YTKZpcyyaKLiZYiejQ== X-Google-Smtp-Source: ABdhPJy0KKcQNDQ9OyZnpxNFmfKs+5RO6AiXSAHMO3MHX8T37rNHnerRAct0D/M6Cx0/FMu3P84O8g== X-Received: by 2002:ac8:1c39:: with SMTP id a54mr409737qtk.344.1602605679611; Tue, 13 Oct 2020 09:14:39 -0700 (PDT) Return-Path: Received: from master.ht.home ([2607:fea8:e2a0:e950::5917]) by smtp.googlemail.com with ESMTPSA id z13sm134586qkl.2.2020.10.13.09.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 09:14:39 -0700 (PDT) From: "Shashi Mallela" To: leif@nuviainc.com, ard.biesheuvel@arm.com, graeme@nuviainc.com Cc: devel@edk2.groups.io Subject: [PATCH v2 1/1] Silicon/Qemu/Sbsa: Add SBSA-wdt entry to GTDT Date: Tue, 13 Oct 2020 12:14:35 -0400 Message-Id: <20201013161435.33893-2-shashi.mallela@linaro.org> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20201013161435.33893-1-shashi.mallela@linaro.org> References: <20201013161435.33893-1-shashi.mallela@linaro.org> SBSA generic watchdog timer structure entry has been added to GTDT table as per BSAv0.9. This enables acpi detection of wdt in qemu sbsa platform Signed-off-by: Shashi Mallela --- Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc | 53 +++++++++++++++++--- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc b/Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc index d16778e01a5c..2312fd74e26d 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 = { { SBSAQEMU_ACPI_HEADER( - EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_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_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