From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by mx.groups.io with SMTP id smtpd.web10.35028.1585223619196593355 for ; Thu, 26 Mar 2020 04:53:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=JKQJtR95; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.208.67, mailfrom: pete@akeo.ie) Received: by mail-ed1-f67.google.com with SMTP id cw6so5741514edb.9 for ; Thu, 26 Mar 2020 04:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vkPPixQp+PTh0istM8zD61oezahzIvWXlT83jQyIRnA=; b=JKQJtR95MDRbG8KmL++gvreVGn7XOjI9MFviPvSGFhgpi8vgrZEP8f4C3OzH0bxIiU cyFY/Zr8J50M2IsK56Zk8rqYlbMEL4MCYJ7rxDB3LpFwvbEPyLq/td6KhVKCBcW63824 W2Vpe/E75Yuomt/O84uijetjBUuMxDlXGSX6snoXobFncXp7ELyhgVZj1mL/dB6sgymz i1YAudL4EYjQxSOaJHIsXW5aPPbe8/N+4KU7hjnb0Ko2WX+qBHCdlreJg+qfCOpkdC/k wMri0HsdEK1KG/v09luJs0BgnpsYTOLscopmOFIKI03c8oh6091a8t2os0FxNCe7euwL xKzQ== 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:mime-version:content-transfer-encoding; bh=vkPPixQp+PTh0istM8zD61oezahzIvWXlT83jQyIRnA=; b=hGRBc0ylz71vfni83B13Z9CrzEQGAxqnCUz5xQhbF9iOu3y14xNwft1i7k+Mblcru8 lInC9Zc/AOyWd6a7tE0oLbHFDVA0SBSQXZRNQ3SF0qXs9SJ8oQw8l/pCRDPvMDLbpLfe WoGahzILk41w5n/0yLgTCbvQH+4adpd07xcjsycQPPsbI/IH8IiN2A2tFOjSxxcr0VmT Eo6G0GLLaPvZNbjtHdNCcfAHmgqMRtPIEI+9O3KPkwsVdrNav6Uq8fC4Wx0dihHV/8pb 8IEyVpwxcfiYTxMu7QB/+QMmW9Rywwayv6na5K/lxEW97V8EPyDPKTHXxfCeOYvpAHI/ Klvw== X-Gm-Message-State: ANhLgQ2jWrE9P7+vFQCLPCRE2IZ25bQ+aBhXxFm6SRvPXGn0KeV8z1Vv X1CLLX+2AqCh0FGRd1VSsp2aKgV2yVPeHQ== X-Google-Smtp-Source: ADFU+vsNcYGvmcUQWeLbdFLgzJYKFrga4pTF409CcakZyTir062pfss+k/miPnsgE/eh6L9PTkvLhg== X-Received: by 2002:a17:906:dbd7:: with SMTP id yc23mr7424330ejb.97.1585223617443; Thu, 26 Mar 2020 04:53:37 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([84.203.78.33]) by smtp.gmail.com with ESMTPSA id bs8sm240534ejb.92.2020.03.26.04.53.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 04:53:37 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-platforms][PATCH 3/6] Platform/RPi/AcpiTables: Use PCDs in MADT Date: Thu, 26 Mar 2020 11:53:19 +0000 Message-Id: <20200326115322.2880-4-pete@akeo.ie> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200326115322.2880-1-pete@akeo.ie> References: <20200326115322.2880-1-pete@akeo.ie> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Instead of going through a model #ifdef, the call to EFI_ACPI_5_1_GICC_STRUCTURE_INIT () is factorized by setting up a new set of PCDs. Signed-off-by: Pete Batard --- Platform/RaspberryPi/AcpiTables/AcpiTables.inf | 8 +++++ Platform/RaspberryPi/AcpiTables/Madt.aslc | 31 ++++++++------------ Platform/RaspberryPi/RPi3/RPi3.dsc | 9 ++++++ Platform/RaspberryPi/RPi4/RPi4.dsc | 7 +++++ Platform/RaspberryPi/RaspberryPi.dec | 7 +++++ 5 files changed, 43 insertions(+), 19 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf index 9ad5246d6bb6..6642541d6a0a 100644 --- a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf +++ b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ [Packages] EmbeddedPkg/EmbeddedPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + Platform/RaspberryPi/RaspberryPi.dec Silicon/Broadcom/Bcm27xx/Bcm27xx.dec Silicon/Broadcom/Bcm283x/Bcm283x.dec Silicon/Broadcom/Drivers/Net/BcmNet.dec @@ -56,6 +57,13 @@ [FixedPcd] gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress + gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceHBase + gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceVBase + gRaspberryPiTokenSpaceGuid.PcdGicGsivId + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq0 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq1 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq2 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq3 [BuildOptions] GCC:*_*_*_ASL_FLAGS = -vw3133 -vw3150 diff --git a/Platform/RaspberryPi/AcpiTables/Madt.aslc b/Platform/RaspberryPi/AcpiTables/Madt.aslc index 4029cd191ab5..faf461814536 100644 --- a/Platform/RaspberryPi/AcpiTables/Madt.aslc +++ b/Platform/RaspberryPi/AcpiTables/Madt.aslc @@ -44,29 +44,22 @@ PI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = { 0, // Flags }, { -#if (RPI_MODEL == 3) EFI_ACPI_5_1_GICC_STRUCTURE_INIT( - 0, 0, GET_MPID(0, 0), EFI_ACPI_5_1_GIC_ENABLED, 0x09, 0x40000000, 0, 0, 0, 0), + 0, 0, GET_MPID(0, 0), EFI_ACPI_5_1_GIC_ENABLED, FixedPcdGet32 (PcdGicPmuIrq0), + FixedPcdGet64 (PcdGicInterruptInterfaceBase), FixedPcdGet64 (PcdGicInterruptInterfaceVBase), + FixedPcdGet64 (PcdGicInterruptInterfaceHBase), FixedPcdGet32 (PcdGicGsivId), 0), EFI_ACPI_5_1_GICC_STRUCTURE_INIT( - 1, 1, GET_MPID(0, 1), EFI_ACPI_5_1_GIC_ENABLED, 0x09, 0x40000000, 0, 0, 0, 0), + 1, 1, GET_MPID(0, 1), EFI_ACPI_5_1_GIC_ENABLED, FixedPcdGet32 (PcdGicPmuIrq1), + FixedPcdGet64 (PcdGicInterruptInterfaceBase), FixedPcdGet64 (PcdGicInterruptInterfaceVBase), + FixedPcdGet64 (PcdGicInterruptInterfaceHBase), FixedPcdGet32 (PcdGicGsivId), 0), EFI_ACPI_5_1_GICC_STRUCTURE_INIT( - 2, 2, GET_MPID(0, 2), EFI_ACPI_5_1_GIC_ENABLED, 0x09, 0x40000000, 0, 0, 0, 0), + 2, 2, GET_MPID(0, 2), EFI_ACPI_5_1_GIC_ENABLED, FixedPcdGet32 (PcdGicPmuIrq2), + FixedPcdGet64 (PcdGicInterruptInterfaceBase), FixedPcdGet64 (PcdGicInterruptInterfaceVBase), + FixedPcdGet64 (PcdGicInterruptInterfaceHBase), FixedPcdGet32 (PcdGicGsivId), 0), EFI_ACPI_5_1_GICC_STRUCTURE_INIT( - 3, 3, GET_MPID(0, 3), EFI_ACPI_5_1_GIC_ENABLED, 0x09, 0x40000000, 0, 0, 0, 0), -#elif (RPI_MODEL == 4) - EFI_ACPI_5_1_GICC_STRUCTURE_INIT( - 0, 0, GET_MPID(0, 0), EFI_ACPI_5_1_GIC_ENABLED, 48, FixedPcdGet64 (PcdGicInterruptInterfaceBase), - 0xFF846000, 0xFF844000, 0x19, 0), - EFI_ACPI_5_1_GICC_STRUCTURE_INIT( - 1, 1, GET_MPID(0, 1), EFI_ACPI_5_1_GIC_ENABLED, 49, FixedPcdGet64 (PcdGicInterruptInterfaceBase), - 0xFF846000, 0xFF844000, 0x19, 0), - EFI_ACPI_5_1_GICC_STRUCTURE_INIT( - 2, 2, GET_MPID(0, 2), EFI_ACPI_5_1_GIC_ENABLED, 50, FixedPcdGet64 (PcdGicInterruptInterfaceBase), - 0xFF846000, 0xFF844000, 0x19, 0), - EFI_ACPI_5_1_GICC_STRUCTURE_INIT( - 3, 3, GET_MPID(0, 3), EFI_ACPI_5_1_GIC_ENABLED, 51, FixedPcdGet64 (PcdGicInterruptInterfaceBase), - 0xFF846000, 0xFF844000, 0x19, 0), -#endif + 3, 3, GET_MPID(0, 3), EFI_ACPI_5_1_GIC_ENABLED, FixedPcdGet32 (PcdGicPmuIrq3), + FixedPcdGet64 (PcdGicInterruptInterfaceBase), FixedPcdGet64 (PcdGicInterruptInterfaceVBase), + FixedPcdGet64 (PcdGicInterruptInterfaceHBase), FixedPcdGet32 (PcdGicGsivId), 0), }, #if (RPI_MODEL != 3) EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet64 (PcdGicDistributorBase), 0) diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3/RPi3.dsc index 7fb9a41f3d9a..1651def87ce1 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -403,6 +403,15 @@ [PcdsFixedAtBuild.common] gRaspberryPiTokenSpaceGuid.PcdCpuDefSpeedMHz|1200 gRaspberryPiTokenSpaceGuid.PcdCpuMaxSpeedMHz|1500 + # + # ARM General Interrupt Controller + # + gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x40000000 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq0|0x09 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq1|0x09 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq2|0x09 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq3|0x09 + ## Default Terminal Type ## 0-PCANSI, 1-VT100, 2-VT00+, 3-UTF8, 4-TTYTERM gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4 diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4/RPi4.dsc index 1abb010469f5..4fe4d810a0bc 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -431,6 +431,13 @@ [PcdsFixedAtBuild.common] # gArmTokenSpaceGuid.PcdGicDistributorBase|0xFF841000 gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0xFF842000 + gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceHBase|0xFF844000 + gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceVBase|0xFF846000 + gRaspberryPiTokenSpaceGuid.PcdGicGsivId|0x19 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq0|0x30 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq1|0x31 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq2|0x32 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq3|0x33 # # Fixed CPU settings. diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/RaspberryPi.dec index dc37541f3732..d59b548185e3 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -47,6 +47,13 @@ [PcdsFixedAtBuild.common] gRaspberryPiTokenSpaceGuid.PcdCpuLowSpeedMHz|600|UINT32|0x0000000a gRaspberryPiTokenSpaceGuid.PcdCpuDefSpeedMHz|800|UINT32|0x0000000b gRaspberryPiTokenSpaceGuid.PcdCpuMaxSpeedMHz|1000|UINT32|0x0000000c + gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceHBase|0x0|UINT64|0x00000030 + gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceVBase|0x0|UINT64|0x00000031 + gRaspberryPiTokenSpaceGuid.PcdGicGsivId|0x0|UINT32|0x00000032 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq0|0x0|UINT32|0x00000033 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq1|0x0|UINT32|0x00000034 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq2|0x0|UINT32|0x00000035 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq3|0x0|UINT32|0x00000036 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] gRaspberryPiTokenSpaceGuid.PcdCpuClock|0|UINT32|0x0000000d -- 2.21.0.windows.1