From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mx.groups.io with SMTP id smtpd.web09.12619.1576686666477630942 for ; Wed, 18 Dec 2019 08:31:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=C5p1nm6v; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.221.66, mailfrom: pete@akeo.ie) Received: by mail-wr1-f66.google.com with SMTP id w15so2991171wru.4 for ; Wed, 18 Dec 2019 08:31:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=587Z3L9/7O2gGS8sR+K2BWvIELyzSCCCDPpuR5u8MLc=; b=C5p1nm6vDrWCiSqgtH2oTcvHNKTWiKXpiQKjOWecaJ4DloeTYUcDdIrOY1MPOz/6WR 1psFtoRsf3lCuqv1A/aR2l0/EiIF1aJjktKmfvZr3yAA3Fyf0Xx1bGPSMaLqvQ0Zgp1E rPlK6NSr24bhBYDz2rRuNr4GpgjpwHr6Q14nnPPDoaM8THscT++4t5OMPFf6Cc1ZKPga boQrcmCsTCI7NITn4/YKD3yhxyATxWn8ld0o80CGFnQCJHU2VKvR6Bg5l5bfEcA1wwok NYCK+B3o02Fz2B94VeNGkhsDSYr3tWGNhs2d91TqNZXosE7ZO2RYXS2yXFkRC7bUu22R 7a4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=587Z3L9/7O2gGS8sR+K2BWvIELyzSCCCDPpuR5u8MLc=; b=KbIDlaspG3K43nDokkrN8Xvy1u34gzm9nY4Z1t+7+FvU8v+N2TjtgY+LMXpLayOwvU JXOObsyD1HO9l2oplhEh+P2iFtk5iPEgILWtUK5uukdQ5irPMGULNFz1GVYak4Qu+1ez eS2riqBm5Y/aHJnvUo4FHeyu2LWZFhokt66cmqvDeTZSWDTQbLxo7A/dqyxhnzoQhhHA ZEM+Ygw42e3AVfM2jtoMZhL/ZkheLG1hudzBaiM2ipYl8yqWgDFPvHMjQ/teT6L/cdm8 Si5uZLLw5YJkhsadpr50bHu/u5yU7JKe9CDNuTOX8+uBaOSuF106HYhUBx3DB+PiT1dx d4AQ== X-Gm-Message-State: APjAAAUPEaBYP9komEFisBJ4jT4Xyn3IlH2hQcNC6i/Oc8BxNPwTJf8o 0f1TI0d0GC5tmS0GblnZ5Pu+MQ== X-Google-Smtp-Source: APXvYqwEvAuSVMBAmJX8BTg8Q3E7FHdSaz7GUUGzPmsToWvSo8hrD4y75MKnE9YuAJp6S8eJPFfoLw== X-Received: by 2002:a5d:43c7:: with SMTP id v7mr3629863wrr.32.1576686664761; Wed, 18 Dec 2019 08:31:04 -0800 (PST) Return-Path: Received: from [10.0.0.122] ([84.203.77.210]) by smtp.googlemail.com with ESMTPSA id l7sm3075985wrq.61.2019.12.18.08.31.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Dec 2019 08:31:03 -0800 (PST) Subject: Re: [edk2-platforms][PATCH 2/6] Platform/RPi4: Improve FADT ACPI table generation To: Ard Biesheuvel Cc: edk2-devel-groups-io , Leif Lindholm , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= References: <20191218114156.9036-1-pete@akeo.ie> <20191218114156.9036-3-pete@akeo.ie> From: "Pete Batard" Message-ID: Date: Wed, 18 Dec 2019 16:31:02 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Hi Ard, On 2019.12.18 14:46, Ard Biesheuvel wrote: > Hi Pete, > > On Wed, 18 Dec 2019 at 13:42, Pete Batard wrote: >> >> Use a proper aslc source to build the table. >> >> Note that we use ACPI 5.1 for this table to match the MADT >> constraints. >> >> Signed-off-by: Pete Batard >> --- >> Platform/RaspberryPi/RPi4/AcpiTables/Fadt.aslc | 104 ++++++++++++++------ >> 1 file changed, 76 insertions(+), 28 deletions(-) >> >> diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Fadt.aslc b/Platform/RaspberryPi/RPi4/AcpiTables/Fadt.aslc >> index 3ef877fde5f4..2d851794b989 100644 >> --- a/Platform/RaspberryPi/RPi4/AcpiTables/Fadt.aslc >> +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Fadt.aslc >> @@ -2,6 +2,7 @@ >> * >> * Fixed ACPI Description Table (FADT) >> * >> + * Copyright (c) 2019, Pete Batard >> * Copyright (c) 2018, Andrey Warkentin >> * Copyright (c) Microsoft Corporation. All rights reserved. >> * >> @@ -9,34 +10,81 @@ >> * >> **/ >> >> -UINT8 Fadt[268] = { >> - 0x46, 0x41, 0x43, 0x50, 0x0C, 0x01, 0x00, 0x00, 0x05, 0x00, /* 0 */ >> - 0x42, 0x43, 0x32, 0x38, 0x33, 0x36, 0x45, 0x44, 0x4B, 0x32, /* 10 */ >> - 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, 0x4D, 0x53, /* 20 */ >> - 0x46, 0x54, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 30 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* 40 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 50 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 60 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 70 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 80 */ >> - 0x00, 0x04, 0x00, 0x00, 0x00, 0xE3, 0x00, 0x00, 0x00, 0x00, /* 90 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, /* 100 */ >> - 0x00, 0x00, 0x21, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, /* 110 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 120 */ >> - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 130 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 140 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 150 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 160 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 170 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 180 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 190 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 200 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 210 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 220 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 230 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 240 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 250 */ >> - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 268 */ >> +#include >> +#include >> +#include >> + >> +#include "AcpiTables.h" >> + >> +#define RPI_DSDT_BASE_ADDRESS 0x33CD0000 > > DSDTs have no compile time base addresses - they end up wherever the > AcpiPlatformDxe driver puts them. Makes sense. I was a bit too blind in trying to match the output of acpiview. >> +#define RPI_PM_TIMER_BLOCK_LEN 0x04 >> +#define RPI_CST_VALUE 0xE3 > > Any idea what these mean? Not really. I just picked those values from the acpiview output in the Shell with the assumption that these and the IaPcBootArch flags (such as lack of CMOS RTC which I'm hoping Microsoft can pick through different means on ARM) were static values that needed to be preserved especially as the blobs we are replacing here came from Microsoft. I'll validate that it works with zero/default as you suggest below and submit a v2. Regards, /Pete > >> + >> +/* >> + * Note: Use ACPI 5.1 since we need to match MADT ACPI requirements >> + */ >> +EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE Fadt = { >> + ACPI_HEADER ( >> + EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, >> + EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE, >> + EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE_REVISION >> + ), >> + 0, // UINT32 FirmwareCtrl >> + RPI_DSDT_BASE_ADDRESS, // UINT32 Dsdt > > Just put 0 here > >> + EFI_ACPI_RESERVED_BYTE, // UINT8 Reserved0 >> + EFI_ACPI_5_1_PM_PROFILE_APPLIANCE_PC, // UINT8 PreferredPmProfile >> + 0, // UINT16 SciInt >> + 0, // UINT32 SmiCmd >> + 0, // UINT8 AcpiEnable >> + 0, // UINT8 AcpiDisable >> + 0, // UINT8 S4BiosReq >> + 0, // UINT8 PstateCnt >> + 0, // UINT32 Pm1aEvtBlk >> + 0, // UINT32 Pm1bEvtBlk >> + 0, // UINT32 Pm1aCntBlk >> + 0, // UINT32 Pm1bCntBlk >> + 0, // UINT32 Pm2CntBlk >> + 0, // UINT32 PmTmrBlk >> + 0, // UINT32 Gpe0Blk >> + 0, // UINT32 Gpe1Blk >> + 0, // UINT8 Pm1EvtLen >> + 0, // UINT8 Pm1CntLen >> + 0, // UINT8 Pm2CntLen >> + RPI_PM_TIMER_BLOCK_LEN, // UINT8 PmTmrLen > > and here > >> + 0, // UINT8 Gpe0BlkLen >> + 0, // UINT8 Gpe1BlkLen >> + 0, // UINT8 Gpe1Base >> + RPI_CST_VALUE, // UINT8 CstCnt > > and here > >> + 0, // UINT16 PLvl2Lat >> + 0, // UINT16 PLvl3Lat >> + 0, // UINT16 FlushSize >> + 0, // UINT16 FlushStride >> + 0, // UINT8 DutyOffset >> + 0, // UINT8 DutyWidth >> + 0, // UINT8 DayAlrm >> + 0, // UINT8 MonAlrm >> + 0, // UINT8 Century >> + EFI_ACPI_5_1_VGA_NOT_PRESENT | EFI_ACPI_5_1_MSI_NOT_SUPPORTED | // UINT16 IaPcBootArch >> + EFI_ACPI_5_1_PCIE_ASPM_CONTROLS | EFI_ACPI_5_1_CMOS_RTC_NOT_PRESENT, > > IaPcBootArch is RES0 on ARM, so put 0 here as well please > >> + EFI_ACPI_RESERVED_BYTE, // UINT8 Reserved1 >> + EFI_ACPI_5_1_WBINVD | EFI_ACPI_5_1_SLP_BUTTON | // UINT32 Flags >> + EFI_ACPI_5_1_HW_REDUCED_ACPI, >> + NULL_GAS, // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE ResetReg >> + 0, // UINT8 ResetValue >> + EFI_ACPI_5_1_ARM_PSCI_COMPLIANT, // UINT16 ArmBootArchFlags >> + EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION, // UINT8 MinorRevision >> + 0, // UINT64 XFirmwareCtrl >> + RPI_DSDT_BASE_ADDRESS, // UINT64 XDsdt > > Put 0 here > >> + NULL_GAS, // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk >> + NULL_GAS, // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk >> + NULL_GAS, // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk >> + NULL_GAS, // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk >> + NULL_GAS, // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk >> + NULL_GAS, // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk >> + NULL_GAS, // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE XGpe0Blk >> + NULL_GAS, // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE XGpe1Blk >> + NULL_GAS, // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE SleepControlReg >> + NULL_GAS // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE SleepStatusReg >> }; >> >> // >> -- >> 2.21.0.windows.1 >>