From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55064+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55064+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886353; cv=none; d=zohomail.com; s=zohoarc; b=A+WUqwNPr/larqP5CQ4gTGrqcfN98yX4CgoqiXyuZGshcdXOcAq3vbX4MH0hkwuJt+IiP6INIcCA7FnVXjz2y3D9eVQpjNrJ9bBJCNiRaLfocO6C8OTIxoXvnH79pNpnzjuheFOSkpO+U2GSYNPn9wPs5RMtg96UOk6nNZGiKU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886353; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=YRKY6lWEKkLO4JVXXEDGx4gl0/pAJo2WUX0lfEzvUVQ=; b=HyxabTS7/HpEIUvkdDIOK/XsRd1XpdKyIx7/64nKFi7ospQuIrdjkTTeQkJ0FDE6z2PoG2MClbQ61AjwEh+ignOtLO8L+zV5VL79OYTINQX7zHRwL3+Gz/XeluxmJpbj+kkb0+JzAyHFbrDvEl5KgFCK1g0YXv12oSeu9ew8B2c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55064+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886353125308.52924484142886; Fri, 28 Feb 2020 02:39:13 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id LUF8YY1788612xvi6yUhNAUR; Fri, 28 Feb 2020 02:39:12 -0800 X-Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web12.12399.1582886350506768789 for ; Fri, 28 Feb 2020 02:39:11 -0800 X-Received: by mail-wm1-f65.google.com with SMTP id c84so2610900wme.4 for ; Fri, 28 Feb 2020 02:39:10 -0800 (PST) X-Gm-Message-State: vqjd6l9flF1F8k3X6o3eDNIgx1787277AA= X-Google-Smtp-Source: APXvYqyH2p/ZuvZhMwudi9118SXVMIysf0RflgmS2DFdmkTz0QVZgA5Ui8bF5ae3KAtvZsNpnaZ56w== X-Received: by 2002:a1c:208a:: with SMTP id g132mr3958823wmg.143.1582886348768; Fri, 28 Feb 2020 02:39:08 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:08 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 01/15] Platform/RPi: Move DW USB base address to Silicon Date: Fri, 28 Feb 2020 10:38:41 +0000 Message-Id: <20200228103855.11352-2-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886352; bh=GbYG62v0CERgqYrr6VGLUYFr8TuCtnhLFRTTb0r/ISg=; h=Cc:Date:From:Reply-To:Subject:To; b=JV4hNog81G+fsrI0AT83k5xkCYGnBIXsTQHWHCaP17J24SQwmq0ZgFduEpMbIanQ0nR Q6bihFSuZU5MtaIkYJ3Ia+7P56lUCLntIDQ3bL3yj/PeG69BwEDttdB63YWXZtVwbnceQ fnBuyliOkH45kWUQEQFDowsSM2lw8fA7RVM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The official BCM2835 ARM Peripherals guide lists the DW USB controller as standard SoC device. Treat is as such by adding its base address to Silicon. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel Reviewed-by: Philippe Mathieu-Daude --- Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.c | 3 ++- Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h | 6 +----- Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 5 +++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.c b/Pla= tform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.c index 37ebf503fd60..4f6f60b1eb5f 100644 --- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.c +++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.c @@ -7,6 +7,7 @@ * **/ =20 +#include #include "DwUsbHostDxe.h" #include "DwcHw.h" =20 @@ -1548,7 +1549,7 @@ CreateDwUsbHc ( DwHc->DwUsbOtgHc.ClearRootHubPortFeature =3D DwHcClearRootHubPort= Feature; DwHc->DwUsbOtgHc.MajorRevision =3D 0x02; DwHc->DwUsbOtgHc.MinorRevision =3D 0x00; - DwHc->DwUsbBase =3D DW2_USB_BASE_ADDRESS; + DwHc->DwUsbBase =3D BCM2836_USB_BASE_ADD= RESS; =20 Pages =3D EFI_SIZE_TO_PAGES (DWC2_STATUS_BUF_SIZE); DwHc->StatusBuffer =3D AllocatePages (Pages); diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h b/Platform/R= aspberryPi/Drivers/DwUsbHostDxe/DwcHw.h index ddbf69a1d608..12fbde9ff6f2 100644 --- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h +++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h @@ -10,11 +10,7 @@ #ifndef __DWCHW_H__ #define __DWCHW_H__ =20 -#define DW2_USB_OFFSET 0x00980000 -#define DW2_USB_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegister= sAddress) \ - + DW2_USB_OFFSET) - -#define HSOTG_REG(x) (x) +#define HSOTG_REG(x) (x) =20 #define HCCHAR(_ch) HSOTG_REG(0x0500 + 0x20 * (_ch)) #define HCSPLT(_ch) HSOTG_REG(0x0504 + 0x20 * (_ch)) diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h b/= Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h index 7ba4877337a8..cee5fb6a4e15 100644 --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h @@ -70,6 +70,11 @@ #define BCM2836_INTC_TIMER_CONTROL_OFFSET 0x00000040 #define BCM2836_INTC_TIMER_PENDING_OFFSET 0x00000060 =20 +/* usb constants */ +#define BCM2836_USB_OFFSET 0x00980000 +#define BCM2836_USB_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_USB_OFFSET) +#define BCM2836_USB_LENGTH 0x00010000 + /* uart constants */ #define BCM2836_PL011_UART_OFFSET 0x00201000 #define BCM2836_PL011_UART_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_PL011_UART_OFFSET) --=20 2.21.0.windows.1 -=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 (#55064): https://edk2.groups.io/g/devel/message/55064 Mute This Topic: https://groups.io/mt/71605839/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55066+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55066+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886355; cv=none; d=zohomail.com; s=zohoarc; b=CT0OKzGB0Or36EX8vrgf+IjpjMTbbhKtbraCzUATVUpont4Ow+b4LRtB9cNiOfIWgFpkwSoX/Zib0m/DENECBTpKUV5IusBuYtEIgQ+cENOZcHmDSovBLWgmLdr6ivw/0Bwtv2ifNcLeTyZbbIGrf1M4Vjvbg6lCr3RvLutu9x8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886355; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=vDTMYM4BBKFGsF7gWc7C9XTrbo5NXvLEUw8D+nglZGA=; b=jRbgmzfJYyBRRCGJhO8LfHef8B+67IsnMdsMWwXmSiPVdvPxBO48fRbspQ9dxoItS0gjjj6ciPaj0v2Y67qaS3t3UcPoY3CvDpXi90SOrjNvg1LdSXUwfkhG3OEwqdMpKTBH+JfnAKTclxxZpQpQd1v8/V9+c5yGk4bMlXrRI0Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55066+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15828863559891020.2622490988706; Fri, 28 Feb 2020 02:39:15 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id g3qoYY1788612xFB27j7WUs4; Fri, 28 Feb 2020 02:39:14 -0800 X-Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.web10.12436.1582886353895768594 for ; Fri, 28 Feb 2020 02:39:14 -0800 X-Received: by mail-wm1-f51.google.com with SMTP id q9so2635769wmj.5 for ; Fri, 28 Feb 2020 02:39:13 -0800 (PST) X-Gm-Message-State: WV7UHUHGJ8T4bNPIuW8Vu7dAx1787277AA= X-Google-Smtp-Source: APXvYqxV6rxxbqg4NGyQZ/nXjOkIyrwFbFVHYx3LSeehVUY26x0er6IZxNXplEfTFcjmjkIF9nR9Aw== X-Received: by 2002:a7b:cbcf:: with SMTP id n15mr4205670wmi.21.1582886350169; Fri, 28 Feb 2020 02:39:10 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:09 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 02/15] Silicon/Bcm283x: Add missing peripherals constants Date: Fri, 28 Feb 2020 10:38:42 +0000 Message-Id: <20200228103855.11352-3-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886354; bh=P4OJk+9Gjy9Hc1vSNH2KoiQ4rNrq/zMrxTWfilMrGrI=; h=Cc:Date:From:Reply-To:Subject:To; b=Vr34MNbzKq2UNp+OZq++uAup9qGibYJ/hi/8y9UmVEtOGzlYAvBWco8wqy7n0Pzv1m9 pGsKRyGCVbOGqWHJTn5/OayRHnEMMeyMDaOFrUKEvp3NgUqQ/pJeMFwwRU0qZ4BVPq0FR OJSaUiBAkdub8KJxwtBFxUiZuJ4AiiMKTTk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" In order to be able to reference them in ACPI tables and elsewhere we add some missing constants to be the Bcm283x headers. These include: * I2C, SPI and DMA constants * Length of the peripherals register space We also take this opportunity to clean up and harmonize the headers. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 39 +++= +++++++++++++- Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Gpio.h | 6 ++- Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836SdHost.h | 6 ++- Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Sdio.h | 44 +++= +++++++---------- 4 files changed, 71 insertions(+), 24 deletions(-) diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h b/= Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h index cee5fb6a4e15..0b402e9ac56e 100644 --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h @@ -56,6 +56,7 @@ /* mailbox interface constants */ #define BCM2836_MBOX_OFFSET 0x0000b880 #define BCM2836_MBOX_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_MBOX_OFFSET) +#define BCM2836_MBOX_LENGTH 0x00000024 #define BCM2836_MBOX_READ_OFFSET 0x00000000 #define BCM2836_MBOX_STATUS_OFFSET 0x00000018 #define BCM2836_MBOX_CONFIG_OFFSET 0x0000001c @@ -75,7 +76,7 @@ #define BCM2836_USB_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_USB_OFFSET) #define BCM2836_USB_LENGTH 0x00010000 =20 -/* uart constants */ +/* serial based protocol constants */ #define BCM2836_PL011_UART_OFFSET 0x00201000 #define BCM2836_PL011_UART_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_PL011_UART_OFFSET) #define BCM2836_PL011_UART_LENGTH 0x00001000 @@ -86,4 +87,40 @@ #define BCM2836_MINI_UART_LENGTH 0x00000070 #define BCM2836_MINI_UART_INTERRUPT 0x7D =20 +#define BCM2836_I2C0_OFFSET 0x00205000 +#define BCM2836_I2C0_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_I2C0_OFFSET) +#define BCM2836_I2C0_LENGTH 0x00000020 + +#define BCM2836_I2C1_OFFSET 0x00804000 +#define BCM2836_I2C1_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_I2C1_OFFSET) +#define BCM2836_I2C1_LENGTH 0x00000020 + +#define BCM2836_I2C2_OFFSET 0x00805000 +#define BCM2836_I2C2_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_I2C2_OFFSET) +#define BCM2836_I2C2_LENGTH 0x00000020 + +#define BCM2836_SPI0_OFFSET 0x00204000 +#define BCM2836_SPI0_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_SPI0_OFFSET) +#define BCM2836_SPI0_LENGTH 0x00000020 + +#define BCM2836_SPI1_OFFSET 0x00215080 +#define BCM2836_SPI1_LENGTH 0x00000040 +#define BCM2836_SPI1_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_SPI1_OFFSET) + +#define BCM2836_SPI2_OFFSET 0x002150C0 +#define BCM2836_SPI2_LENGTH 0x00000040 +#define BCM2836_SPI2_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_SPI2_OFFSET) + +/* dma constants */ +#define BCM2836_DMA0_OFFSET 0x00007000 +#define BCM2836_DMA0_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_DMA0_OFFSET) + +#define BCM2836_DMA15_OFFSET 0x00E05000 +#define BCM2836_DMA15_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_DMA15_OFFSET) + +#define BCM2836_DMA_CTRL_OFFSET 0x00007FE0 +#define BCM2836_DMA_CTRL_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_DMA_CTRL_OFFSET) + +#define BCM2836_DMA_CHANNEL_LENGTH 0x00000100 + #endif /*__BCM2836_H__ */ diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Gpio.= h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Gpio.h index 123de2c2d1ad..e65cc5c3bbb4 100644 --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Gpio.h +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Gpio.h @@ -7,10 +7,14 @@ * **/ =20 +#include + #ifndef __BCM2836_GPIO_H__ #define __BCM2836_GPIO_H__ =20 -#define GPIO_BASE_ADDRESS (BCM2836_SOC_REGISTERS + 0x00200000) +#define GPIO_OFFSET 0x00200000 +#define GPIO_BASE_ADDRESS (BCM2836_SOC_REGISTERS + GPIO_OFFSET) +#define GPIO_LENGTH 0x000000B4 =20 #define GPIO_GPFSEL0 (GPIO_BASE_ADDRESS + 0x00) #define GPIO_GPFSEL1 (GPIO_BASE_ADDRESS + 0x04) diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836SdHos= t.h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836SdHost.h index d0492a4ff43d..83fbeb99cb35 100644 --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836SdHost.h +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836SdHost.h @@ -7,10 +7,14 @@ * **/ =20 +#include + #ifndef __BCM2836_SDHOST_H__ #define __BCM2836_SDHOST_H__ =20 -#define SDHOST_BASE_ADDRESS (BCM2836_SOC_REGISTERS + 0x00202000) +#define SDHOST_OFFSET 0x00202000 +#define SDHOST_BASE_ADDRESS (BCM2836_SOC_REGISTERS + SDHOST_OFFSET) +#define SDHOST_LENGTH 0x00000100 #define SDHOST_REG(X) (SDHOST_BASE_ADDRESS + (X)) #define SDHOST_CMD SDHOST_REG(0x0) #define SDHOST_ARG SDHOST_REG(0x4) diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Sdio.= h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Sdio.h index 708a1d7a4f47..fd07b4717068 100644 --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Sdio.h +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Sdio.h @@ -6,20 +6,22 @@ * **/ =20 +#include + #ifndef __BCM2836_SDIO_H__ #define __BCM2836_SDIO_H__ =20 -//MMC/SD/SDIO1 register definitions. +// MMC/SD/SDIO1 register definitions. #define MMCHS1_OFFSET 0x00300000 -#define MMCHS1BASE (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ - + MMCHS1_OFFSET) +#define MMCHS1_BASE (BCM2836_SOC_REGISTERS + MMCHS1_OFFSET) +#define MMCHS1_LENGTH 0x00000100 =20 -#define MMCHS_BLK (MMCHS1BASE + 0x4) +#define MMCHS_BLK (MMCHS1_BASE + 0x4) #define BLEN_512BYTES (0x200UL << 0) =20 -#define MMCHS_ARG (MMCHS1BASE + 0x8) +#define MMCHS_ARG (MMCHS1_BASE + 0x8) =20 -#define MMCHS_CMD (MMCHS1BASE + 0xC) +#define MMCHS_CMD (MMCHS1_BASE + 0xC) #define BCE_ENABLE BIT1 #define DDIR_READ BIT4 #define DDIR_WRITE (0x0UL << 4) @@ -41,13 +43,13 @@ #define INDX(CMD_INDX) (TYPE(CMD_TYPE_NORMAL) | _INDX(CMD_INDX)) #define INDX_ABORT(CMD_INDX) (TYPE(CMD_TYPE_ABORT) | _INDX(CMD_INDX)) =20 -#define MMCHS_RSP10 (MMCHS1BASE + 0x10) -#define MMCHS_RSP32 (MMCHS1BASE + 0x14) -#define MMCHS_RSP54 (MMCHS1BASE + 0x18) -#define MMCHS_RSP76 (MMCHS1BASE + 0x1C) -#define MMCHS_DATA (MMCHS1BASE + 0x20) +#define MMCHS_RSP10 (MMCHS1_BASE + 0x10) +#define MMCHS_RSP32 (MMCHS1_BASE + 0x14) +#define MMCHS_RSP54 (MMCHS1_BASE + 0x18) +#define MMCHS_RSP76 (MMCHS1_BASE + 0x1C) +#define MMCHS_DATA (MMCHS1_BASE + 0x20) =20 -#define MMCHS_PRES_STATE (MMCHS1BASE + 0x24) +#define MMCHS_PRES_STATE (MMCHS1_BASE + 0x24) #define CMDI_MASK BIT0 #define CMDI_ALLOWED (0x0UL << 0) #define CMDI_NOT_ALLOWED BIT0 @@ -56,7 +58,7 @@ #define DATI_NOT_ALLOWED BIT1 #define WRITE_PROTECT_OFF BIT19 =20 -#define MMCHS_HCTL (MMCHS1BASE + 0x28) +#define MMCHS_HCTL (MMCHS1_BASE + 0x28) #define DTW_1_BIT (0x0UL << 1) #define DTW_4_BIT BIT1 #define SDBP_MASK BIT8 @@ -66,7 +68,7 @@ #define SDVS_3_0_V (0x6UL << 9) #define IWE BIT24 =20 -#define MMCHS_SYSCTL (MMCHS1BASE + 0x2C) +#define MMCHS_SYSCTL (MMCHS1_BASE + 0x2C) #define ICE BIT0 #define ICS_MASK BIT1 #define ICS BIT1 @@ -82,7 +84,7 @@ #define SRC BIT25 #define SRD BIT26 =20 -#define MMCHS_INT_STAT (MMCHS1BASE + 0x30) +#define MMCHS_INT_STAT (MMCHS1_BASE + 0x30) #define CC BIT0 #define TC BIT1 #define BWR BIT4 @@ -94,7 +96,7 @@ #define DCRC BIT21 #define DEB BIT22 =20 -#define MMCHS_IE (MMCHS1BASE + 0x34) +#define MMCHS_IE (MMCHS1_BASE + 0x34) #define CC_EN BIT0 #define TC_EN BIT1 #define BWR_EN BIT4 @@ -110,7 +112,7 @@ #define BADA_EN BIT29 #define ALL_EN 0xFFFFFFFF =20 -#define MMCHS_ISE (MMCHS1BASE + 0x38) +#define MMCHS_ISE (MMCHS1_BASE + 0x38) #define CC_SIGEN BIT0 #define TC_SIGEN BIT1 #define BWR_SIGEN BIT4 @@ -125,14 +127,14 @@ #define CERR_SIGEN BIT28 #define BADA_SIGEN BIT29 =20 -#define MMCHS_AC12 (MMCHS1BASE + 0x3C) +#define MMCHS_AC12 (MMCHS1_BASE + 0x3C) =20 -#define MMCHS_CAPA (MMCHS1BASE + 0x40) +#define MMCHS_CAPA (MMCHS1_BASE + 0x40) #define VS30 BIT25 #define VS18 BIT26 =20 -#define MMCHS_CUR_CAPA (MMCHS1BASE + 0x48) -#define MMCHS_REV (MMCHS1BASE + 0xFC) +#define MMCHS_CUR_CAPA (MMCHS1_BASE + 0x48) +#define MMCHS_REV (MMCHS1_BASE + 0xFC) =20 #define BLOCK_COUNT_SHIFT 16 #define RCA_SHIFT 16 --=20 2.21.0.windows.1 -=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 (#55066): https://edk2.groups.io/g/devel/message/55066 Mute This Topic: https://groups.io/mt/71605841/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55065+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55065+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886355; cv=none; d=zohomail.com; s=zohoarc; b=NEyS9TpKu4/mldzYJxR7mlzghrtTMXX7+lKdBp/Rk4h7dT40rel2oxxqxsR94nFq1Vx4kI67SGC8Q3X2JVvpJVCMV8i4SBg2hJLfH+pECne8Zb2mWygS6Gb+kO1DP57u1y3cKZD2FtGLLmeZgdDDovqClR11J7PAkuSWgkKrqlY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886355; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=8P/Bm7xbwQ+4/bJTyj76WR1OGixJKgJb5wJQq5O/aKc=; b=Y/PLUgVZhjntv7gRCAa0scqYQr65a0oOd0Dhwz+fiNZO/O0KzjyixjaRFujsxhxPBKv0XblEiy/Unla2bAA56nkSyeR+lt/qc3HUhDpQod7N16EaWM3erd9Hdu1E3fmjm1mEJ7Nqzjvca5HTLIynnX2ngilPnhPlr+5pnIuQuGI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55065+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886355597864.9190130064302; Fri, 28 Feb 2020 02:39:15 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id hfguYY1788612xMOKIZKsX9I; Fri, 28 Feb 2020 02:39:14 -0800 X-Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.groups.io with SMTP id smtpd.web10.12435.1582886353112625541 for ; Fri, 28 Feb 2020 02:39:13 -0800 X-Received: by mail-wm1-f67.google.com with SMTP id a141so2641567wme.2 for ; Fri, 28 Feb 2020 02:39:12 -0800 (PST) X-Gm-Message-State: zn8i9BR52i5QDxglyvniwncvx1787277AA= X-Google-Smtp-Source: APXvYqyO4voN+4WexV2lyOj0RRTotwP3ZbsO+SjS6gRSrXwIYF+O51GgMv9S0MYMvij8Ge4PuQSu/g== X-Received: by 2002:a05:600c:1009:: with SMTP id c9mr4161662wmc.162.1582886351318; Fri, 28 Feb 2020 02:39:11 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:10 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 03/15] Silicon/Bcm283x: Add GPU/VideoCore and Power Management constants Date: Fri, 28 Feb 2020 10:38:43 +0000 Message-Id: <20200228103855.11352-4-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886354; bh=S+bYggOOnLB5Jc+/C9TG2RIFjh5BZm3tU6UdncRv1e0=; h=Cc:Date:From:Reply-To:Subject:To; b=sXHG9hxYZ5WWhCC/8zskL0uYE8RpOt+rYkDCwCNEA0O6a5kbUUYqQsYbAsbDN2dQ8S4 b/A85Vfu56IKrQOK6dJLc1485F8QxS/BroWqhuOYvBHRfi3zVNE1QoenlXcdBXrdS/9Fg naqbD81nLg4WvqPqBzPA+kyLllDyw9RImN8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Whereas these devices are not explicitly described in the BCM2835 ARM Peripheral guide, they come as standard with the SoC and their constants can easily be found in the Device Trees for Bcm283x based devices. Create 2 new Silicon headers to host these constants. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Gpu.h | 48 ++++++= ++++++++++++++ Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Pwm.h | 34 ++++++= ++++++++ 2 files changed, 82 insertions(+) diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Gpu.h= b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Gpu.h new file mode 100644 index 000000000000..4eea4cf22fd8 --- /dev/null +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Gpu.h @@ -0,0 +1,48 @@ +/** @file + * + * Copyright (c) 2020, Pete Batard + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + **/ + +#include + +#ifndef __BCM2836_GPU_H__ +#define __BCM2836_GPU_H__ + +/* VideoCore constants */ + +#define BCM2836_VCHIQ_OFFSET 0x0000B840 +#define BCM2836_VCHIQ_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_VCHIQ_OFFSET) +#define BCM2836_VCHIQ_LENGTH 0x00000010 + +#define BCM2836_V3D_BUS_OFFSET 0x00C00000 +#define BCM2836_V3D_BUS_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_V3D_BUS_OFFSET) +#define BCM2836_V3D_BUS_LENGTH 0x00001000 + +#define BCM2836_HVS_OFFSET 0x00400000 +#define BCM2836_HVS_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_HVS_OFFSET) +#define BCM2836_HVS_LENGTH 0x00006000 + +#define BCM2836_PV0_OFFSET 0x00206000 +#define BCM2836_PV0_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_PV0_OFFSET) +#define BCM2836_PV0_LENGTH 0x00000100 + +#define BCM2836_PV1_OFFSET 0x00207000 +#define BCM2836_PV1_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_PV1_OFFSET) +#define BCM2836_PV1_LENGTH 0x00000100 + +#define BCM2836_PV2_OFFSET 0x00807000 +#define BCM2836_PV2_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_PV2_OFFSET) +#define BCM2836_PV2_LENGTH 0x00000100 + +#define BCM2836_HDMI0_OFFSET 0x00902000 +#define BCM2836_HDMI0_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_HDMI0_OFFSET) +#define BCM2836_HDMI0_LENGTH 0x00000600 + +#define BCM2836_HDMI1_OFFSET 0x00808000 +#define BCM2836_HDMI1_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_HDMI1_OFFSET) +#define BCM2836_HDMI1_LENGTH 0x00000100 + +#endif /* __BCM2836_MISC_H__ */ diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Pwm.h= b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Pwm.h new file mode 100644 index 000000000000..e2581b8901ad --- /dev/null +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Pwm.h @@ -0,0 +1,34 @@ +/** @file + * + * Copyright (c) 2020, Pete Batard + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + **/ + +#include + +#ifndef __BCM2836_PWM_H__ +#define __BCM2836_PWM_H__ + +/* Power Management constants */ + +#define BCM2836_PWM_DMA_OFFSET 0x00007B00 +#define BCM2836_PWM_DMA_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_PWM_DMA_OFFSET) +#define BCM2836_PWM_DMA_LENGTH 0x00000100 + +#define BCM2836_PWM_CLK_OFFSET 0x001010A0 +#define BCM2836_PWM_CLK_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_PWM_CLK_OFFSET) +#define BCM2836_PWM_CLK_LENGTH 0x00000008 + +#define BCM2836_PWM_CTRL_OFFSET 0x0020C000 +#define BCM2836_PWM_CTRL_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_PWM_CTRL_OFFSET) +#define BCM2836_PWM_CTRL_LENGTH 0x00000028 + +#define BCM2836_PWM_BUS_BASE_ADDRESS 0x7E20C000 +#define BCM2836_PWM_BUS_LENGTH 0x00000028 + +#define BCM2836_PWM_CTRL_UNCACHED_BASE_ADDRESS 0xFF20C000 +#define BCM2836_PWM_CTRL_UNCACHED_LENGTH 0x00000028 + +#endif /* __BCM2836_PWM_H__ */ --=20 2.21.0.windows.1 -=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 (#55065): https://edk2.groups.io/g/devel/message/55065 Mute This Topic: https://groups.io/mt/71605840/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55067+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55067+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886356; cv=none; d=zohomail.com; s=zohoarc; b=GdSKr8bRZbgeTNGsA98cRF2rvQIFIgIzjL5RNhuNWi86PFrqlMvL3XGWJfu3Vr6goIweGCNjMiiRQkiGe/ShU7VMeLJggFDoIwkVexTRK9/8NfsZEcHACkAeTQNQmy1VaNXoLNxYSXRvuWMMl6fMU6HElySslMzJ7ebmwX6Ib0s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886356; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=pFmZ6Mk/TxA45itZqftiS4bGghXyVwOAcGSZkvataqc=; b=eRmT08NgIbEueHvQ1MdxvBXbDrYnamWjyxt2krf/42AA6zNgMrWlytfSANUJIG1wU/JoUHAol1G7hNEtQzbmoz838lNrTnrjAOFR9IE9kQ21bfJUDC41FvfLanUBbp88b0QWCqJ1zoCW6OdMx0jjpw+Wr3sV/ZVXRqfSz2D1buk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55067+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886356187458.5163375999348; Fri, 28 Feb 2020 02:39:16 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id OkHxYY1788612x2fMnJNOEMA; Fri, 28 Feb 2020 02:39:15 -0800 X-Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web11.12284.1582886354288766409 for ; Fri, 28 Feb 2020 02:39:14 -0800 X-Received: by mail-wm1-f65.google.com with SMTP id t23so2684720wmi.1 for ; Fri, 28 Feb 2020 02:39:14 -0800 (PST) X-Gm-Message-State: NS9dgyNprRBJIqGbRQo0X5fAx1787277AA= X-Google-Smtp-Source: APXvYqwgvRBplRGAri2e73jraweLK8ytohgdDFXjThN8Xrda0wldOJZMM1Y/Vqy6vfAWqt7phxsYGg== X-Received: by 2002:a7b:c249:: with SMTP id b9mr4058030wmj.61.1582886352549; Fri, 28 Feb 2020 02:39:12 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:12 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 04/15] Silicon/BcmGenet: Add missing I/O mapping length and clean up Date: Fri, 28 Feb 2020 10:38:44 +0000 Message-Id: <20200228103855.11352-5-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886355; bh=dU3vRGLjnLOetKfIY1ZnwdqKGnlktEOWePUCKoveEcQ=; h=Cc:Date:From:Reply-To:Subject:To; b=DkqaUut/2bd/IuhMf2/X8t2qTe7ELEL36Adfnxk904KxTxzf71ZX2mGI468u+QKHe0G L1rPaZb6tMsTLUfTS+r69UvN9rocW2pZL2HMQgGb9uhZSP34nSP7Jx5AF9f6fYXb0YAeP kqq6P22jb2mMsmvZbMU5APnP1uifydb4U9Q= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Remove unneeded extra parenthesis on PCD, which can cause problems when used with ACPI ASL macros and add an [Includes] section to the .inf, so that the Genet.h header can be referenced where required. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Silicon/Broadcom/Drivers/Net/BcmGenetDxe/Genet.h | 3 ++- Silicon/Broadcom/Drivers/Net/BcmNet.dec | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/Genet.h b/Silicon/Bro= adcom/Drivers/Net/BcmGenetDxe/Genet.h index 4a3827c0e0d1..f56fb2977422 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/Genet.h +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/Genet.h @@ -11,7 +11,8 @@ =20 #include =20 -#define GENET_BASE_ADDRESS (FixedPcdGet64 (PcdBcmGenetRegistersAdd= ress)) +#define GENET_BASE_ADDRESS FixedPcdGet64 (PcdBcmGenetRegistersAddr= ess) +#define GENET_LENGTH 0x00010000 =20 #define GENET_SYS_RBUF_FLUSH_CTRL 0x0008 #define GENET_UMAC_MAC0 0x080c diff --git a/Silicon/Broadcom/Drivers/Net/BcmNet.dec b/Silicon/Broadcom/Dri= vers/Net/BcmNet.dec index 2a8688cb09a7..483b033af51c 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmNet.dec +++ b/Silicon/Broadcom/Drivers/Net/BcmNet.dec @@ -12,6 +12,9 @@ [Defines] PACKAGE_GUID =3D 34E19823-D23A-41AB-9C09-ED1225B32DFF PACKAGE_VERSION =3D 1.0 =20 +[Includes] + . + [Guids] gBcmNetTokenSpaceGuid =3D {0x12b97d70, 0x9149, 0x4c2f, {0x82, 0xd5, 0xad= , 0xa9, 0x1e, 0x92, 0x75, 0xa1}} =20 --=20 2.21.0.windows.1 -=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 (#55067): https://edk2.groups.io/g/devel/message/55067 Mute This Topic: https://groups.io/mt/71605842/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55068+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55068+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886360; cv=none; d=zohomail.com; s=zohoarc; b=Ox2UPSkGQRnqdJcmvv2WDaoVR5Klv3H0H1pUF30Vl2toyWrG2mW4tsecwrZ+kxi42lOlFepjJVzGcG8CD6G4Eofh5voQb4kyJtXQRP5s+r1qNhcint6F0dsjNGSGc1sASJFCQ0TOFJ1AitaLGAL6uKsCZxWsZvywytepyNUrrn0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886360; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=hv5FGHD0k5e0uXdyxjD9KCjrkNkrsa5Jya0CHarS544=; b=h7SXl0BJ1dVQuVhioKtlA6pSNvZuLntwTIIhdEF8LwfkufbS4qc7ehXzhuKP4rUQfVWAvl9wy1sBFRCAOPyvJ8L/E39tjdjKjMsEiiuiyKDWbOCPOcdPu8mteFN6tzn6OPShj8lcfPzeD8RxkDRGN+ChQRijD13DDVe3rhKWxH0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55068+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886360211586.9994023780861; Fri, 28 Feb 2020 02:39:20 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id uH3zYY1788612xCVcYCtsaxz; Fri, 28 Feb 2020 02:39:19 -0800 X-Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mx.groups.io with SMTP id smtpd.web12.12400.1582886358071647065 for ; Fri, 28 Feb 2020 02:39:18 -0800 X-Received: by mail-wm1-f66.google.com with SMTP id t23so2685007wmi.1 for ; Fri, 28 Feb 2020 02:39:17 -0800 (PST) X-Gm-Message-State: rLSq8wBMTL3D51tiK8odelLfx1787277AA= X-Google-Smtp-Source: APXvYqw4A9dOukNix3FJWN2/E86KxsECmQRDvsKqZBSyVafyw/zAKAnj6JG98U6xm4Zz334tJyNQ1w== X-Received: by 2002:a1c:3b89:: with SMTP id i131mr2480614wma.171.1582886354481; Fri, 28 Feb 2020 02:39:14 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:13 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 05/15] Platform/RPi4: Use Silicon constants in ACPI headers Date: Fri, 28 Feb 2020 10:38:45 +0000 Message-Id: <20200228103855.11352-6-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886359; bh=nJK3rFwcZgws8RbJ0oKhvKRI4LiQQnyPPquq7Tf2OAY=; h=Cc:Date:From:Reply-To:Subject:To; b=pcXwt33hTmXciFEId7eEj7/mhV4gxgiofpTPkWI9UblAXM4b+vJjpIThdZlY/ArVcrw uJIUBTF7NVuJJ4DztM9TQE6Ql9pgfCAisHY5ubL+jZCrha6z+rOSaKtZUxky5AY09k8bo k5HHdWhG8C1QWmRzlumuRxyVpuK2XE5hBzk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" With the new constants added, remove some of the hardcoded values from the ACPI tables. Note that because the ASL compiler is very limited in terms of macro processing, we can not use any arithmetic constants (e.g BASE + OFFSET) as parameters to MEMORY32FIXED (), and instead must alter the base address using CreateDwordField () after MEMORY32FIXED () has been invoked. To achieve that, we create a MEMORY32SETBASE () macro and move the MEMORY32FIXED () calls outside of Method (_CRS...). Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h | 8 + Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf | 2 + Platform/RaspberryPi/RPi4/AcpiTables/Csrt.aslc | 7 +- Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl | 422 +++++++++++-----= ---- Platform/RaspberryPi/RPi4/AcpiTables/Sdhc.asl | 32 +- Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl | 77 ++-- 6 files changed, 302 insertions(+), 246 deletions(-) diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h b/Platform/R= aspberryPi/RPi4/AcpiTables/AcpiTables.h index dcdbac7a0b7b..fcfad3b5d93b 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h +++ b/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h @@ -15,6 +15,14 @@ =20 #include =20 +// The ASL compiler can't perform arithmetic on MEMORY32SETBASE () +// parameters so you can't pass a constant like BASE + OFFSET (the +// compiler just silently sets it to zero). So we need a macro that +// can perform arithmetic base address update with an offset. +#define MEMORY32SETBASE(BufName, MemName, VarName, Offset) \ + CreateDwordField (^BufName, ^MemName._BAS, VarName) \ + Add (BCM2836_SOC_REGISTERS, Offset, VarName) + #define EFI_ACPI_OEM_ID {'M','C','R','S','F','T'} //= OEMID 6 bytes long #define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64 ('R','P','I','4= ','E','D','K','2') // OEM table id 8 bytes long #define EFI_ACPI_OEM_REVISION 0x02000820 diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf b/Platform= /RaspberryPi/RPi4/AcpiTables/AcpiTables.inf index aa8f67dec95e..358c315b6da1 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf +++ b/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf @@ -41,6 +41,7 @@ [Packages] MdePkg/MdePkg.dec Silicon/Broadcom/Bcm27xx/Bcm27xx.dec Silicon/Broadcom/Bcm283x/Bcm283x.dec + Silicon/Broadcom/Drivers/Net/BcmNet.dec =20 [FixedPcd] gArmTokenSpaceGuid.PcdArmArchTimerIntrNum @@ -52,6 +53,7 @@ [FixedPcd] gBcm27xxTokenSpaceGuid.PcdBcm27xxPciCpuMmioAdr gBcm27xxTokenSpaceGuid.PcdBcm27xxPciRegBase gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress + gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress =20 diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Csrt.aslc b/Platform/Rasp= berryPi/RPi4/AcpiTables/Csrt.aslc index f8bf3f26a341..03d888fffb8b 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Csrt.aslc +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Csrt.aslc @@ -10,6 +10,7 @@ **/ =20 #include +#include =20 #include "AcpiTables.h" =20 @@ -137,9 +138,9 @@ EFI_ACPI_5_1_CSRT_TABLE Csrt =3D { sizeof (DMA_CONTROLLER_VENDOR_DATA), // Controller vendor data he= re 1, - 0xFE007000, // Base address for channels - RPI_DMA_CHANNEL_COUNT * 0x100, // Base size =3D Number of channels= x 0x100 size for each channel - 0xFE007FE0, // Base address for controller + BCM2836_DMA0_BASE_ADDRESS, // Base address for channels + RPI_DMA_CHANNEL_COUNT * BCM2836_DMA_CHANNEL_LENGTH, // Base size = =3D Number of channels x channel size + BCM2836_DMA_CTRL_BASE_ADDRESS,// Base address for controller 8, // Base size =3D two registers RPI_DMA_USED_CHANNEL_COUNT, 0, // cannot use controller interrupt diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Dsdt.asl index 8d2938a6596c..c505413bcba2 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl @@ -2,6 +2,7 @@ * * Differentiated System Definition Table (DSDT) * + * Copyright (c) 2020, Pete Batard * Copyright (c) 2018, Andrey Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * @@ -9,6 +10,14 @@ * **/ =20 +#include +#include +#include +#include +#include + +#include "AcpiTables.h" + #define BCM_ALT0 0x4 #define BCM_ALT1 0x5 #define BCM_ALT2 0x6 @@ -75,14 +84,15 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_USB_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x69 } + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED(ReadWrite, 0xFE980000, 0x10000,) - Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x69= } - }) - Return(RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_USB_OFFSET) + Return (^RBUF) } } =20 @@ -97,44 +107,49 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2"= , 2) { Return(0xf) } + Name (RBUF, ResourceTemplate () + { + // Memory and interrupt for the GPU + MEMORY32FIXED (ReadWrite, 0, BCM2836_V3D_BUS_LENGTH, RM01) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x2A } + + // HVS - Hardware Video Scalar + MEMORY32FIXED (ReadWrite, 0, BCM2836_HVS_LENGTH, RM02) + // The HVS interrupt is reserved by the VPU + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 41 } + + // PixelValve0 - DSI0 or DPI + // MEMORY32FIXED (ReadWrite, BCM2836_PV0_BASE_ADDRESS, BCM2836_PV0= _LENGTH, RM03) + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 4D } + + // PixelValve1 - DS1 or SMI + // MEMORY32FIXED (ReadWrite, BCM2836_PV1_BASE_ADDRESS, BCM2836_PV1= _LENGTH, RM04) + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 4E } + + // PixelValve2 - HDMI output - connected to HVS display FIFO 1 + MEMORY32FIXED (ReadWrite, 0, BCM2836_PV2_LENGTH, RM05) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x4A } + + // HDMI registers + MEMORY32FIXED (ReadWrite, 0, BCM2836_HDMI0_LENGTH, RM06) + MEMORY32FIXED (ReadWrite, 0, BCM2836_HDMI1_LENGTH, RM07) + // hdmi_int[0] + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 48 } + // hdmi_int[1] + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 49 } + + // HDMI DDC connection + I2CSerialBus (0x50,, 100000,, "\\_SB.I2C2",,,,) // EDID + I2CSerialBus (0x30,, 100000,, "\\_SB.I2C2",,,,) // E-DDC Segment = Pointer + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - // Memory and interrupt for the GPU - MEMORY32FIXED(ReadWrite, 0xFEC00000, 0x1000,) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x2= A } - - // HVS - Hardware Video Scalar - MEMORY32FIXED (ReadWrite, 0xFE400000, 0x6000,) - // The HVS interrupt is reserved by the VPU - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { = 0x41 } - - // PixelValve0 - DSI0 or DPI - // MEMORY32FIXED (ReadWrite, 0xFE206000, 0x100,) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { = 0x4D } - - // PixelValve1 - DS1 or SMI - // MEMORY32FIXED (ReadWrite, 0xFE207000, 0x100,) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { = 0x4E } - - // PixelValve2 - HDMI output - connected to HVS display FIFO 1 - MEMORY32FIXED (ReadWrite, 0xFE807000, 0x100,) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x4= A } - - // HDMI registers - MEMORY32FIXED (ReadWrite, 0xFE902000, 0x600,) // HDMI registers - MEMORY32FIXED (ReadWrite, 0xFE808000, 0x100,) // HD registers - // hdmi_int[0] - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { = 0x48 } - // hdmi_int[1] - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { = 0x49 } - - // HDMI DDC connection - I2CSerialBus (0x50,, 100000,, "\\_SB.I2C2",,,,) // EDID - I2CSerialBus (0x30,, 100000,, "\\_SB.I2C2",,,,) // E-DDC Segmen= t Pointer - }) - Return(RBUF) + MEMORY32SETBASE (RBUF, RM01, RB01, BCM2836_V3D_BUS_OFFSET) + MEMORY32SETBASE (RBUF, RM02, RB02, BCM2836_HVS_OFFSET) + MEMORY32SETBASE (RBUF, RM05, RB05, BCM2836_PV2_OFFSET) + MEMORY32SETBASE (RBUF, RM06, RB06, BCM2836_HDMI0_OFFSET) + MEMORY32SETBASE (RBUF, RM07, RB07, BCM2836_HDMI1_OFFSET) + Return (^RBUF) } =20 // GPU Power Management Component Data @@ -196,14 +211,16 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_MBOX_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x61 } + }) + Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - Memory32Fixed (ReadWrite, 0xFE00B880, 0x00000024,) - Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x61= } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_MBOX_OFFSET) + Return (^RBUF) } } =20 @@ -219,14 +236,16 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_VCHIQ_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x62 } + }) + Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - Memory32Fixed (ReadWrite, 0xFE00B840, 0x00000010,) - Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x62= } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_VCHIQ_OFFSET) + Return (^RBUF) } } =20 @@ -255,15 +274,15 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return(0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, GPIO_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x51, 0x= 53 } + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0xFE200000, 0xB4, ) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x51 } - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x53 } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, GPIO_OFFSET) + Return (^RBUF) } } =20 @@ -281,9 +300,9 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) { Name (RBUF, ResourceTemplate () { - Memory32Fixed (ReadWrite, 0xfd580000, 0x10000, ) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0xB= D } - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0xB= E } + // No need for MEMORY32SETBASE on Genet as we have a straight ba= se address constant + MEMORY32FIXED (ReadWrite, GENET_BASE_ADDRESS, GENET_LENGTH, ) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0xB= D, 0xBE } }) Return (RBUF) } @@ -307,30 +326,31 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return(0xf) } - Method (_CRS, 0x0, Serialized) + Name (RBUF, ResourceTemplate () { - Name (RBUF, ResourceTemplate () - { - Memory32Fixed(ReadWrite, 0xFE804000, 0x20) - Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) {0x55} + MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C1_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x55 } =20 - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0"= , 0, ResourceConsumer,) {2, 3} - // - VendorLong () // Length =3D 0x31 - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, /= / .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, /= / J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1D, 0x00, 0x01, 0x10, 0x00, 0x01, /= / /....... - /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x16, 0x00, 0x20, /= / ........ - /* 0020 */ 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x5C, /= / ........ - /* 0028 */ 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, /= / _SB.GPI0 - /* 0030 */ 0x00 /= / . - } - }) - Return (RBUF) + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", = 0, ResourceConsumer,) {2, 3} + // + VendorLong () // Length =3D 0x31 + { + /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` + /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. + /* 0010 */ 0x2F, 0x8D, 0x1D, 0x00, 0x01, 0x10, 0x00, 0x01, // = /....... + /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x16, 0x00, 0x20, // = ........ + /* 0020 */ 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x5C, // = ........ + /* 0028 */ 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, // = _SB.GPI0 + /* 0030 */ 0x00 // . + } + }) + Method (_CRS, 0x0, Serialized) + { + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_I2C1_OFFSET) + Return (^RBUF) } } =20 @@ -345,14 +365,16 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return (0xf) } + Name (RBUF, ResourceTemplate() + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C2_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x55 } + }) + Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate() - { - Memory32Fixed (ReadWrite, 0xFE805000, 0x20) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) {0x55} - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_I2C2_OFFSET) + Return (^RBUF) } } =20 @@ -367,57 +389,59 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI0_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x56 } + + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig (Exclusive, PullDown, BCM_ALT0, "\\_SB.GPI0"= , 0, ResourceConsumer, ) {9, 10, 11} // MISO, MOSI, SCLK + VendorLong () // Length =3D 0x33 + { + /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` + /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. + /* 0010 */ 0x2F, 0x8D, 0x1F, 0x00, 0x01, 0x10, 0x00, 0x02, // = /....... + /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, // = ......." + /* 0020 */ 0x00, 0x00, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0B, // = ........ + /* 0028 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, // = .\_SB.GP + /* 0030 */ 0x49, 0x30, 0x00 // = I0. + } + + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", = 0, ResourceConsumer, ) {8} // CE0 + VendorLong () // Length =3D 0x2F + { + /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` + /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. + /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x01, // = /....... + /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, // = ........ + /* 0020 */ 0x00, 0x00, 0x00, 0x08, 0x00, 0x5C, 0x5F, 0x53, // = .....\_S + /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 // = B.GPI0. + } + + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", = 0, ResourceConsumer, ) {7} // CE1 + VendorLong () // Length =3D 0x2F + { + /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` + /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. + /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x01, // = /....... + /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, // = ........ + /* 0020 */ 0x00, 0x00, 0x00, 0x07, 0x00, 0x5C, 0x5F, 0x53, // = .....\_S + /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 // = B.GPI0. + } + }) + Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0xFE204000, 0x20,) - Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) {0x56} - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig (Exclusive, PullDown, BCM_ALT0, "\\_SB.GPI= 0", 0, ResourceConsumer, ) {9, 10, 11} // MISO, MOSI, SCLK - VendorLong () // Length =3D 0x33 - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, /= / .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, /= / J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1F, 0x00, 0x01, 0x10, 0x00, 0x02, /= / /....... - /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, /= / ......." - /* 0020 */ 0x00, 0x00, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0B, /= / ........ - /* 0028 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, /= / .\_SB.GP - /* 0030 */ 0x49, 0x30, 0x00 /= / I0. - } - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0"= , 0, ResourceConsumer, ) {8} // CE0 - VendorLong () // Length =3D 0x2F - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, /= / .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, /= / J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x01, /= / /....... - /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, /= / ........ - /* 0020 */ 0x00, 0x00, 0x00, 0x08, 0x00, 0x5C, 0x5F, 0x53, /= / .....\_S - /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 /= / B.GPI0. - } - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0"= , 0, ResourceConsumer, ) {7} // CE1 - VendorLong () // Length =3D 0x2F - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, /= / .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, /= / J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x01, /= / /....... - /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, /= / ........ - /* 0020 */ 0x00, 0x00, 0x00, 0x07, 0x00, 0x5C, 0x5F, 0x53, /= / .....\_S - /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 /= / B.GPI0. - } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_SPI0_OFFSET) + Return (^RBUF) } } =20 @@ -432,43 +456,45 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI1_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { 0x3D } + + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0",= 0, ResourceConsumer, ) {19, 20, 21} // MISO, MOSI, SCLK + VendorLong () // Length =3D 0x33 + { + /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` + /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. + /* 0010 */ 0x2F, 0x8D, 0x1F, 0x00, 0x01, 0x10, 0x00, 0x02, // = /....... + /* 0018 */ 0x03, 0x00, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, // = ......." + /* 0020 */ 0x00, 0x00, 0x00, 0x13, 0x00, 0x14, 0x00, 0x15, // = ........ + /* 0028 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, // = .\_SB.GP + /* 0030 */ 0x49, 0x30, 0x00 // = I0. + } + + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0",= 0, ResourceConsumer, ) {16} // CE2 + VendorLong () // Length =3D 0x2F + { + /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` + /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. + /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x02, // = /....... + /* 0018 */ 0x03, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, // = ........ + /* 0020 */ 0x00, 0x00, 0x00, 0x10, 0x00, 0x5C, 0x5F, 0x53, // = .....\_S + /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 // = B.GPI0. + } + }) + Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0xFE215080, 0x40,) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) {0x3D} - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0= ", 0, ResourceConsumer, ) {19, 20, 21} // MISO, MOSI, SCLK - VendorLong () // Length =3D 0x33 - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, /= / .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, /= / J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1F, 0x00, 0x01, 0x10, 0x00, 0x02, /= / /....... - /* 0018 */ 0x03, 0x00, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, /= / ......." - /* 0020 */ 0x00, 0x00, 0x00, 0x13, 0x00, 0x14, 0x00, 0x15, /= / ........ - /* 0028 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, /= / .\_SB.GP - /* 0030 */ 0x49, 0x30, 0x00 /= / I0. - } - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0= ", 0, ResourceConsumer, ) {16} // CE2 - VendorLong () // Length =3D 0x2F - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, /= / .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, /= / J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x02, /= / /....... - /* 0018 */ 0x03, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, /= / ........ - /* 0020 */ 0x00, 0x00, 0x00, 0x10, 0x00, 0x5C, 0x5F, 0x53, /= / .....\_S - /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 /= / B.GPI0. - } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_SPI1_OFFSET) + Return (^RBUF) } } =20 @@ -488,8 +514,8 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) // { // Name (RBUF, ResourceTemplate () // { - // MEMORY32FIXED (ReadWrite, 0xFE2150C0, 0x40,) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) {0x3= D} + // MEMORY32FIXED (ReadWrite, BCM2836_SPI2_BASE_ADDRESS, BCM2836_= SPI2_LENGTH, RMEM) + // Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { 0x= 3D } // }) // Return (RBUF) // } @@ -506,26 +532,30 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + // DMA channel 11 control + MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_DMA_LENGTH, RM01) + // PWM control + MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_CTRL_LENGTH, RM02) + // PWM control bus + MEMORY32FIXED (ReadWrite, BCM2836_PWM_BUS_BASE_ADDRESS, BCM2836_PW= M_BUS_LENGTH, ) + // PWM control uncached + MEMORY32FIXED (ReadWrite, BCM2836_PWM_CTRL_UNCACHED_BASE_ADDRESS, = BCM2836_PWM_CTRL_UNCACHED_LENGTH, ) + // PWM clock control + MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_CLK_LENGTH, RM03) + // Interrupt DMA channel 11 + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x3B } + // DMA channel 11, DREQ 5 for PWM + FixedDMA (5, 11, Width32Bit, ) + }) + Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - // DMA channel 11 control - Memory32Fixed (ReadWrite, 0xFE007B00, 0x00000100,) - // PWM control - Memory32Fixed (ReadWrite, 0xFE20C000, 0x00000028,) - // PWM control bus - Memory32Fixed (ReadWrite, 0x7E20C000, 0x00000028,) - // PWM control uncached - Memory32Fixed (ReadWrite, 0xFF20C000, 0x00000028,) - // PWM clock control - Memory32Fixed (ReadWrite, 0xFE1010A0, 0x00000008,) - // Interrupt DMA channel 11 - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x3= B } - // DMA channel 11, DREQ 5 for PWM - FixedDMA (5, 11, Width32Bit, ) - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RM01, RB01, BCM2836_PWM_DMA_OFFSET) + MEMORY32SETBASE (RBUF, RM02, RB02, BCM2836_PWM_CTRL_OFFSET) + MEMORY32SETBASE (RBUF, RM03, RB03, BCM2836_PWM_CLK_OFFSET) + Return (^RBUF) } } =20 diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Sdhc.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Sdhc.asl index 56d15c392743..590c71edd484 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Sdhc.asl +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Sdhc.asl @@ -2,6 +2,7 @@ * * [DSDT] SD controller/card definition (SDHC) * + * Copyright (c) 2020, Pete Batard * Copyright (c) 2018, Andrey Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * @@ -9,6 +10,11 @@ * **/ =20 +#include +#include + +#include "AcpiTables.h" + // // Note: UEFI can use either SDHost or Arasan. We expose both to the OS. // @@ -28,14 +34,15 @@ Device (SDC1) { Return(0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, MMCHS1_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x9E } + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0xFE300000, 0x100,) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x9E } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, MMCHS1_OFFSET) + Return (^RBUF) } =20 // @@ -71,14 +78,15 @@ Device (SDC2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, SDHOST_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x98 } + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0xFE202000, 0x100,) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x98 } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, SDHOST_OFFSET) + Return (^RBUF) } =20 // diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Uart.asl index 5b59f2dd3e16..ad9d21e6272d 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl @@ -2,6 +2,7 @@ * * [DSDT] Serial devices (UART). * + * Copyright (c) 2020, Pete Batard * Copyright (c) 2018, Andrey Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * @@ -9,6 +10,10 @@ * **/ =20 +#include + +#include "AcpiTables.h" + // PL011 based UART. Device (URT0) { @@ -20,14 +25,15 @@ Device (URT0) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_PL011_UART_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x99 } + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0xFE201000, 0x1000,) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x99 } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_PL011_UART_OFFSET) + Return (^RBUF) } =20 Name (CLCK, 48000000) @@ -59,37 +65,38 @@ Device (URTM) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_MINI_UART_LENGTH, RMEM) + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) { 0x7D } + + // NTRAID#MSFT-7141401-2016/04/7-jordanrh - disable UART muxing + // until a proper solution can be created for the dmap conflict. + // When muxing is enabled, must consider DBG2 table conflict. + // The alternate function resource needs to be reserved when + // the kernel debugger is enabled to prevent another client + // from muxing the pins away. + + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0, = ResourceConsumer, ) {14, 15} + // VendorLong () // Length =3D 0x31 + // { + // /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // .= `D....` + // /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // J= ...-#0. + // /* 0010 */ 0x2F, 0x8D, 0x1D, 0x00, 0x01, 0x10, 0x00, 0x02, // /= ....... + // /* 0018 */ 0x02, 0x00, 0x12, 0x00, 0x00, 0x16, 0x00, 0x20, // .= ...... + // /* 0020 */ 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0F, 0x00, 0x5C, // .= ......\ + // /* 0028 */ 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, // _= SB.GPI0 + // /* 0030 */ 0x00 // . + //} + + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0xFE215000, 0x70,) - Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) { 0x7D } - - // NTRAID#MSFT-7141401-2016/04/7-jordanrh - disable UART muxing - // until a proper solution can be created for the dmap conflict. - // When muxing is enabled, must consider DBG2 table conflict. - // The alternate function resource needs to be reserved when - // the kernel debugger is enabled to prevent another client - // from muxing the pins away. - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0= , ResourceConsumer, ) {14, 15} - // VendorLong () // Length =3D 0x31 - // { - // /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, //= .`D....` - // /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, //= J...-#0. - // /* 0010 */ 0x2F, 0x8D, 0x1D, 0x00, 0x01, 0x10, 0x00, 0x02, //= /....... - // /* 0018 */ 0x02, 0x00, 0x12, 0x00, 0x00, 0x16, 0x00, 0x20, //= ....... - // /* 0020 */ 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0F, 0x00, 0x5C, //= .......\ - // /* 0028 */ 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, //= _SB.GPI0 - // /* 0030 */ 0x00 //= . - //} - - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_MINI_UART_OFFSET) + Return (^RBUF) } } =20 --=20 2.21.0.windows.1 -=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 (#55068): https://edk2.groups.io/g/devel/message/55068 Mute This Topic: https://groups.io/mt/71605843/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55069+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55069+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886362; cv=none; d=zohomail.com; s=zohoarc; b=GKLvx8+w6s9UEC6YEQLlWKjJN+D5GkMrlTQKNXs0wfI14fvVYwmAe+V2jMTU/eGpK+eCYazHarGSi9NCWLpY9MiyB1mowtrgRiQKHTzvz4WazFVJpL1Q3DGgnPbnfSjHkgDkzbir2KgfVuw4WXN970wAkk59dqA4LfNzgZ4sa1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886362; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=H7UetrVVEr9rBFWG9dJkTmnw9/NAp1SpbBAdkW1g++c=; b=KFGjS8+Wb7ZNAG322w4RokAfVfVIg/Fiex54/2Rl+phBdNA6pqvoQBaEC60WTRPJG6B2EiJA7iJWt8PuBy85l9/NhocsS6jfZOE0O7Z36RZvTRMFEu36Qo1WOEQC5RdNjvwxgeQExNuUDbtebY1nALNkePwHyrUa5FHHNje9PZA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55069+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886362440360.9352607950151; Fri, 28 Feb 2020 02:39:22 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id y4BLYY1788612xjngTs8zH1r; Fri, 28 Feb 2020 02:39:21 -0800 X-Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mx.groups.io with SMTP id smtpd.web12.12401.1582886360284783615 for ; Fri, 28 Feb 2020 02:39:20 -0800 X-Received: by mail-wr1-f66.google.com with SMTP id m16so2328916wrx.11 for ; Fri, 28 Feb 2020 02:39:20 -0800 (PST) X-Gm-Message-State: kAUj7wmNAUPxQiAzAQljp6FCx1787277AA= X-Google-Smtp-Source: APXvYqwTH6Wno3PxuXG28bvriNkzRyfkHAvxSzdTG3W8yD7/DLllA+1HvCBblEQx7Q4pb1y8DTed0w== X-Received: by 2002:a5d:4610:: with SMTP id t16mr4174184wrq.408.1582886357297; Fri, 28 Feb 2020 02:39:17 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:16 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 06/15] Platform/RPi3: Use Silicon constants in ACPI headers Date: Fri, 28 Feb 2020 10:38:46 +0000 Message-Id: <20200228103855.11352-7-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886361; bh=lJhbOjrkLgq2WuprMCOhCtWsa8PPiOodMcJbuYZQdXI=; h=Cc:Date:From:Reply-To:Subject:To; b=ds5V6sNUoTBqfxZ2VRcB0O5pg2irWO+YUkzGzpHRgOYJzijdh04ZKf+djGEw12JcTzu 5ikg4clOVcfKfSlmVPGe7ymt31DuUhVzifqkZYnDf6zi/avllSgaMB2RUq5+UfNrqre10 MZeRHK625HoG1LfgnkCF0ho0h6rGLqkEx54= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" With the new constants added, remove some of the hardcoded values from the ACPI tables. Note that because the ASL compiler is very limited in terms of macro processing, we can not use any arithmetic constants (e.g BASE + OFFSET) as parameters to MEMORY32FIXED (), and instead must alter the base address using CreateDwordField () after MEMORY32FIXED () has been invoked. To achieve that, we create a MEMORY32SETBASE () macro and move the MEMORY32FIXED () calls outside of Method (_CRS...). Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h | 8 + Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf | 2 + Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc | 8 +- Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl | 415 +++++++++++-----= ---- Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl | 32 +- Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl | 87 ++-- 6 files changed, 306 insertions(+), 246 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h b/Platform/R= aspberryPi/RPi3/AcpiTables/AcpiTables.h index 958af026c8a3..3e68923d3c05 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h +++ b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h @@ -14,6 +14,14 @@ =20 #include =20 +// The ASL compiler can't perform arithmetic on MEMORY32SETBASE () +// parameters so you can't pass a constant like BASE + OFFSET (the +// compiler just silently sets it to zero). So we need a macro that +// can perform arithmetic base address update with an offset. +#define MEMORY32SETBASE(BufName, MemName, VarName, Offset) \ + CreateDwordField (^BufName, ^MemName._BAS, VarName) \ + Add (BCM2836_SOC_REGISTERS, Offset, VarName) + #define EFI_ACPI_OEM_ID {'M','C','R','S','F','T'} //= OEMID 6 bytes long #define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64 ('R','P','I','3= ','E','D','K','2') // OEM table id 8 bytes long #define EFI_ACPI_OEM_REVISION 0x02000820 diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf b/Platform= /RaspberryPi/RPi3/AcpiTables/AcpiTables.inf index 7ef41e79ad46..942acf2c6660 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf +++ b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf @@ -35,6 +35,8 @@ [Sources] [Packages] MdePkg/MdePkg.dec EmbeddedPkg/EmbeddedPkg.dec + Silicon/Broadcom/Bcm283x/Bcm283x.dec =20 [FixedPcd] + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Csrt.aslc index 3b617c0a832b..62f1a1fbdf19 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc @@ -8,6 +8,8 @@ * **/ =20 +#include + #include "AcpiTables.h" =20 #define DMA_MAX_REQ_LINES 32 @@ -134,9 +136,9 @@ EFI_ACPI_5_0_CSRT_TABLE Csrt =3D { sizeof (DMA_CONTROLLER_VENDOR_DATA), // Controller vendor data he= re 1, - 0x3F007000, // Base address for channels - RPI3_DMA_CHANNEL_COUNT * 0x100, // Base size =3D Number of channel= s x 0x100 size for each channel - 0x3F007FE0, // Base address for controller + BCM2836_DMA0_BASE_ADDRESS, // Base address for channels + RPI3_DMA_CHANNEL_COUNT * BCM2836_DMA_CHANNEL_LENGTH, // Base size = =3D Number of channels x channel size + BCM2836_DMA_CTRL_BASE_ADDRESS,// Base address for controller 8, // Base size =3D two registers RPI3_DMA_USED_CHANNEL_COUNT, 0, // cannot use controller interrupt diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl b/Platform/Raspb= erryPi/RPi3/AcpiTables/Dsdt.asl index ab4d4bf4851f..693e4b15e985 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl @@ -2,6 +2,7 @@ * * Differentiated System Definition Table (DSDT) * + * Copyright (c) 2020, Pete Batard * Copyright (c) 2018, Andrey Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * @@ -9,6 +10,13 @@ * **/ =20 +#include +#include +#include +#include + +#include "AcpiTables.h" + #define BCM_ALT0 0x4 #define BCM_ALT1 0x5 #define BCM_ALT2 0x6 @@ -74,14 +82,15 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_USB_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x29 } + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED(ReadWrite, 0x3F980000, 0x10000,) - Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x29= } - }) - Return(RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_USB_OFFSET) + Return (^RBUF) } } =20 @@ -96,44 +105,49 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2"= , 2) { Return(0xf) } + Name (RBUF, ResourceTemplate () + { + // Memory and interrupt for the GPU + MEMORY32FIXED (ReadWrite, 0, BCM2836_V3D_BUS_LENGTH, RM01) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x2A } + + // HVS - Hardware Video Scalar + MEMORY32FIXED (ReadWrite, 0, BCM2836_HVS_LENGTH, RM02) + // The HVS interrupt is reserved by the VPU + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 41 } + + // PixelValve0 - DSI0 or DPI + // MEMORY32FIXED (ReadWrite, BCM2836_PV0_BASE_ADDRESS, BCM2836_PV0= _LENGTH, RM03) + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 4D } + + // PixelValve1 - DS1 or SMI + // MEMORY32FIXED (ReadWrite, BCM2836_PV1_BASE_ADDRESS, BCM2836_PV1= _LENGTH, RM04) + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 4E } + + // PixelValve2 - HDMI output - connected to HVS display FIFO 1 + MEMORY32FIXED (ReadWrite, 0, BCM2836_PV2_LENGTH, RM05) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x4A } + + // HDMI registers + MEMORY32FIXED (ReadWrite, 0, BCM2836_HDMI0_LENGTH, RM06) + MEMORY32FIXED (ReadWrite, 0, BCM2836_HDMI1_LENGTH, RM07) + // hdmi_int[0] + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 48 } + // hdmi_int[1] + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 49 } + + // HDMI DDC connection + I2CSerialBus (0x50,, 100000,, "\\_SB.I2C2",,,,) // EDID + I2CSerialBus (0x30,, 100000,, "\\_SB.I2C2",,,,) // E-DDC Segment = Pointer + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - // Memory and interrupt for the GPU - MEMORY32FIXED(ReadWrite, 0x3FC00000, 0x1000,) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x2= A } - - // HVS - Hardware Video Scalar - MEMORY32FIXED (ReadWrite, 0x3F400000, 0x6000,) - // The HVS interrupt is reserved by the VPU - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { = 0x41 } - - // PixelValve0 - DSI0 or DPI - // MEMORY32FIXED (ReadWrite, 0x3F206000, 0x100,) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { = 0x4D } - - // PixelValve1 - DS1 or SMI - // MEMORY32FIXED (ReadWrite, 0x73F207000, 0x100,) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { = 0x4E } - - // PixelValve2 - HDMI output - connected to HVS display FIFO 1 - MEMORY32FIXED (ReadWrite, 0x3F807000, 0x100,) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x4= A } - - // HDMI registers - MEMORY32FIXED (ReadWrite, 0x3F902000, 0x600,) // HDMI registers - MEMORY32FIXED (ReadWrite, 0x3F808000, 0x100,) // HD registers - // hdmi_int[0] - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { = 0x48 } - // hdmi_int[1] - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { = 0x49 } - - // HDMI DDC connection - I2CSerialBus (0x50,, 100000,, "\\_SB.I2C2",,,,) // EDID - I2CSerialBus (0x30,, 100000,, "\\_SB.I2C2",,,,) // E-DDC Segmen= t Pointer - }) - Return(RBUF) + MEMORY32SETBASE (RBUF, RM01, RB01, BCM2836_V3D_BUS_OFFSET) + MEMORY32SETBASE (RBUF, RM02, RB02, BCM2836_HVS_OFFSET) + MEMORY32SETBASE (RBUF, RM05, RB05, BCM2836_PV2_OFFSET) + MEMORY32SETBASE (RBUF, RM06, RB06, BCM2836_HDMI0_OFFSET) + MEMORY32SETBASE (RBUF, RM07, RB07, BCM2836_HDMI1_OFFSET) + Return (^RBUF) } =20 // GPU Power Management Component Data @@ -195,14 +209,16 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_MBOX_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x61 } + }) + Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - Memory32Fixed (ReadWrite, 0x3F00B880, 0x00000024,) - Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x61= } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_MBOX_OFFSET) + Return (^RBUF) } } =20 @@ -218,14 +234,16 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_VCHIQ_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x62 } + }) + Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - Memory32Fixed (ReadWrite, 0x3F00B840, 0x00000010,) - Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x62= } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_VCHIQ_OFFSET) + Return (^RBUF) } } =20 @@ -254,15 +272,15 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return(0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, GPIO_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x51, 0x= 53 } + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0x3F200000, 0xB4, ) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x51 } - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x53 } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, GPIO_OFFSET) + Return (^RBUF) } } =20 @@ -277,30 +295,31 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return(0xf) } - Method (_CRS, 0x0, Serialized) + Name (RBUF, ResourceTemplate () { - Name (RBUF, ResourceTemplate () - { - Memory32Fixed(ReadWrite, 0x3F804000, 0x20) - Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) {0x55} + MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C1_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x55 } =20 - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0"= , 0, ResourceConsumer,) {2, 3} - // - VendorLong () // Length =3D 0x31 - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, /= / .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, /= / J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1D, 0x00, 0x01, 0x10, 0x00, 0x01, /= / /....... - /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x16, 0x00, 0x20, /= / ........ - /* 0020 */ 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x5C, /= / ........ - /* 0028 */ 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, /= / _SB.GPI0 - /* 0030 */ 0x00 /= / . - } - }) - Return (RBUF) + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", = 0, ResourceConsumer,) {2, 3} + // + VendorLong () // Length =3D 0x31 + { + /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` + /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. + /* 0010 */ 0x2F, 0x8D, 0x1D, 0x00, 0x01, 0x10, 0x00, 0x01, // = /....... + /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x16, 0x00, 0x20, // = ........ + /* 0020 */ 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x5C, // = ........ + /* 0028 */ 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, // = _SB.GPI0 + /* 0030 */ 0x00 // . + } + }) + Method (_CRS, 0x0, Serialized) + { + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_I2C1_OFFSET) + Return (^RBUF) } } =20 @@ -315,14 +334,16 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return (0xf) } + Name (RBUF, ResourceTemplate() + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C2_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x55 } + }) + Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate() - { - Memory32Fixed (ReadWrite, 0x3F805000, 0x20) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) {0x55} - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_I2C2_OFFSET) + Return (^RBUF) } } =20 @@ -337,57 +358,59 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI0_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x56 } + + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig (Exclusive, PullDown, BCM_ALT0, "\\_SB.GPI0"= , 0, ResourceConsumer, ) {9, 10, 11} // MISO, MOSI, SCLK + VendorLong () // Length =3D 0x33 + { + /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` + /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. + /* 0010 */ 0x2F, 0x8D, 0x1F, 0x00, 0x01, 0x10, 0x00, 0x02, // = /....... + /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, // = ......." + /* 0020 */ 0x00, 0x00, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0B, // = ........ + /* 0028 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, // = .\_SB.GP + /* 0030 */ 0x49, 0x30, 0x00 // = I0. + } + + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", = 0, ResourceConsumer, ) {8} // CE0 + VendorLong () // Length =3D 0x2F + { + /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` + /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. + /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x01, // = /....... + /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, // = ........ + /* 0020 */ 0x00, 0x00, 0x00, 0x08, 0x00, 0x5C, 0x5F, 0x53, // = .....\_S + /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 // = B.GPI0. + } + + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", = 0, ResourceConsumer, ) {7} // CE1 + VendorLong () // Length =3D 0x2F + { + /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` + /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. + /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x01, // = /....... + /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, // = ........ + /* 0020 */ 0x00, 0x00, 0x00, 0x07, 0x00, 0x5C, 0x5F, 0x53, // = .....\_S + /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 // = B.GPI0. + } + }) + Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0x3F204000, 0x20,) - Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) {0x56} - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig (Exclusive, PullDown, BCM_ALT0, "\\_SB.GPI= 0", 0, ResourceConsumer, ) {9, 10, 11} // MISO, MOSI, SCLK - VendorLong () // Length =3D 0x33 - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, /= / .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, /= / J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1F, 0x00, 0x01, 0x10, 0x00, 0x02, /= / /....... - /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, /= / ......." - /* 0020 */ 0x00, 0x00, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0B, /= / ........ - /* 0028 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, /= / .\_SB.GP - /* 0030 */ 0x49, 0x30, 0x00 /= / I0. - } - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0"= , 0, ResourceConsumer, ) {8} // CE0 - VendorLong () // Length =3D 0x2F - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, /= / .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, /= / J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x01, /= / /....... - /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, /= / ........ - /* 0020 */ 0x00, 0x00, 0x00, 0x08, 0x00, 0x5C, 0x5F, 0x53, /= / .....\_S - /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 /= / B.GPI0. - } - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0"= , 0, ResourceConsumer, ) {7} // CE1 - VendorLong () // Length =3D 0x2F - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, /= / .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, /= / J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x01, /= / /....... - /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, /= / ........ - /* 0020 */ 0x00, 0x00, 0x00, 0x07, 0x00, 0x5C, 0x5F, 0x53, /= / .....\_S - /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 /= / B.GPI0. - } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_SPI0_OFFSET) + Return (^RBUF) } } =20 @@ -402,43 +425,45 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI1_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { 0x3D } + + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0",= 0, ResourceConsumer, ) {19, 20, 21} // MISO, MOSI, SCLK + VendorLong () // Length =3D 0x33 + { + /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` + /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. + /* 0010 */ 0x2F, 0x8D, 0x1F, 0x00, 0x01, 0x10, 0x00, 0x02, // = /....... + /* 0018 */ 0x03, 0x00, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, // = ......." + /* 0020 */ 0x00, 0x00, 0x00, 0x13, 0x00, 0x14, 0x00, 0x15, // = ........ + /* 0028 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, // = .\_SB.GP + /* 0030 */ 0x49, 0x30, 0x00 // = I0. + } + + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0",= 0, ResourceConsumer, ) {16} // CE2 + VendorLong () // Length =3D 0x2F + { + /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` + /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. + /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x02, // = /....... + /* 0018 */ 0x03, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, // = ........ + /* 0020 */ 0x00, 0x00, 0x00, 0x10, 0x00, 0x5C, 0x5F, 0x53, // = .....\_S + /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 // = B.GPI0. + } + }) + Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0x3F215080, 0x40,) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) {0x3D} - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0= ", 0, ResourceConsumer, ) {19, 20, 21} // MISO, MOSI, SCLK - VendorLong () // Length =3D 0x33 - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, /= / .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, /= / J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1F, 0x00, 0x01, 0x10, 0x00, 0x02, /= / /....... - /* 0018 */ 0x03, 0x00, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, /= / ......." - /* 0020 */ 0x00, 0x00, 0x00, 0x13, 0x00, 0x14, 0x00, 0x15, /= / ........ - /* 0028 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, /= / .\_SB.GP - /* 0030 */ 0x49, 0x30, 0x00 /= / I0. - } - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0= ", 0, ResourceConsumer, ) {16} // CE2 - VendorLong () // Length =3D 0x2F - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, /= / .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, /= / J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x02, /= / /....... - /* 0018 */ 0x03, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, /= / ........ - /* 0020 */ 0x00, 0x00, 0x00, 0x10, 0x00, 0x5C, 0x5F, 0x53, /= / .....\_S - /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 /= / B.GPI0. - } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_SPI1_OFFSET) + Return (^RBUF) } } =20 @@ -458,8 +483,8 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) // { // Name (RBUF, ResourceTemplate () // { - // MEMORY32FIXED (ReadWrite, 0x3F2150C0, 0x40,) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) {0x3= D} + // MEMORY32FIXED (ReadWrite, BCM2836_SPI2_BASE_ADDRESS, BCM2836_= SPI2_LENGTH, RMEM) + // Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { 0x= 3D } // }) // Return (RBUF) // } @@ -476,26 +501,30 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + // DMA channel 11 control + MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_DMA_LENGTH, RM01) + // PWM control + MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_CTRL_LENGTH, RM02) + // PWM control bus + MEMORY32FIXED (ReadWrite, BCM2836_PWM_BUS_BASE_ADDRESS, BCM2836_PW= M_BUS_LENGTH, ) + // PWM control uncached + MEMORY32FIXED (ReadWrite, BCM2836_PWM_CTRL_UNCACHED_BASE_ADDRESS, = BCM2836_PWM_CTRL_UNCACHED_LENGTH, ) + // PWM clock control + MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_CLK_LENGTH, RM03) + // Interrupt DMA channel 11 + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x3B } + // DMA channel 11, DREQ 5 for PWM + FixedDMA (5, 11, Width32Bit, ) + }) + Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - // DMA channel 11 control - Memory32Fixed (ReadWrite, 0x3F007B00, 0x00000100,) - // PWM control - Memory32Fixed (ReadWrite, 0x3F20C000, 0x00000028,) - // PWM control bus - Memory32Fixed (ReadWrite, 0x7E20C000, 0x00000028,) - // PWM control uncached - Memory32Fixed (ReadWrite, 0xFF20C000, 0x00000028,) - // PWM clock control - Memory32Fixed (ReadWrite, 0x3F1010A0, 0x00000008,) - // Interrupt DMA channel 11 - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x3= B } - // DMA channel 11, DREQ 5 for PWM - FixedDMA (5, 11, Width32Bit, ) - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RM01, RB01, BCM2836_PWM_DMA_OFFSET) + MEMORY32SETBASE (RBUF, RM02, RB02, BCM2836_PWM_CTRL_OFFSET) + MEMORY32SETBASE (RBUF, RM03, RB03, BCM2836_PWM_CLK_OFFSET) + Return (^RBUF) } } =20 diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl b/Platform/Raspb= erryPi/RPi3/AcpiTables/Sdhc.asl index 0d42db30ae22..f7553280b60e 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl @@ -2,6 +2,7 @@ * * [DSDT] SD controller/card definition (SDHC) * + * Copyright (c) 2020, Pete Batard * Copyright (c) 2018, Andrey Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * @@ -9,6 +10,11 @@ * **/ =20 +#include +#include + +#include "AcpiTables.h" + // // Note: UEFI can use either SDHost or Arasan. We expose both to the OS. // @@ -28,14 +34,15 @@ Device (SDC1) { Return(0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, MMCHS1_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x5E } + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0x3F300000, 0x100,) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x5E } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, MMCHS1_OFFSET) + Return (^RBUF) } =20 // @@ -71,14 +78,15 @@ Device (SDC2) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, SDHOST_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x58 } + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0x3F202000, 0x100,) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x58 } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, SDHOST_OFFSET) + Return (^RBUF) } =20 // diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl b/Platform/Raspb= erryPi/RPi3/AcpiTables/Uart.asl index a0067c82c661..ddab63f15268 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl @@ -2,6 +2,7 @@ * * [DSDT] Serial devices (UART). * + * Copyright (c) 2020, Pete Batard * Copyright (c) 2018, Andrey Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * @@ -9,28 +10,33 @@ * **/ =20 +#include + +#include "AcpiTables.h" + // PL011 based UART. Device (URT0) { Name (_HID, "BCM2837") - Name (_CID, "HID3123") + Name (_CID, "ARMH0011") Name (_UID, 0x4) Name (_CCA, 0x0) Method (_STA) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_PL011_UART_LENGTH, RMEM) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x59 } + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0x3F201000, 0x1000,) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x59 } - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_PL011_UART_OFFSET) + Return (^RBUF) } =20 - Name (CLCK, 3000000) + Name (CLCK, 48000000) =20 Name (_DSD, Package () { @@ -59,37 +65,38 @@ Device (URTM) { Return (0xf) } + Name (RBUF, ResourceTemplate () + { + MEMORY32FIXED (ReadWrite, 0, BCM2836_MINI_UART_LENGTH, RMEM) + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) { 0x3D } + + // NTRAID#MSFT-7141401-2016/04/7-jordanrh - disable UART muxing + // until a proper solution can be created for the dmap conflict. + // When muxing is enabled, must consider DBG2 table conflict. + // The alternate function resource needs to be reserved when + // the kernel debugger is enabled to prevent another client + // from muxing the pins away. + + // + // MsftFunctionConfig is encoded as the VendorLong. + // + // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0, = ResourceConsumer, ) {14, 15} + // VendorLong () // Length =3D 0x31 + // { + // /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // .= `D....` + // /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // J= ...-#0. + // /* 0010 */ 0x2F, 0x8D, 0x1D, 0x00, 0x01, 0x10, 0x00, 0x02, // /= ....... + // /* 0018 */ 0x02, 0x00, 0x12, 0x00, 0x00, 0x16, 0x00, 0x20, // .= ...... + // /* 0020 */ 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0F, 0x00, 0x5C, // .= ......\ + // /* 0028 */ 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, // _= SB.GPI0 + // /* 0030 */ 0x00 // . + //} + + }) Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0x3F215000, 0x70,) - Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) {0x3D} - - // NTRAID#MSFT-7141401-2016/04/7-jordanrh - disable UART muxing - // until a proper solution can be created for the dmap conflict. - // When muxing is enabled, must consider DBG2 table conflict. - // The alternate function resource needs to be reserved when - // the kernel debugger is enabled to prevent another client - // from muxing the pins away. - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0= , ResourceConsumer, ) {14, 15} - // VendorLong () // Length =3D 0x31 - // { - // /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, //= .`D....` - // /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, //= J...-#0. - // /* 0010 */ 0x2F, 0x8D, 0x1D, 0x00, 0x01, 0x10, 0x00, 0x02, //= /....... - // /* 0018 */ 0x02, 0x00, 0x12, 0x00, 0x00, 0x16, 0x00, 0x20, //= ....... - // /* 0020 */ 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0F, 0x00, 0x5C, //= .......\ - // /* 0028 */ 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, //= _SB.GPI0 - // /* 0030 */ 0x00 //= . - //} - - }) - Return (RBUF) + MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_MINI_UART_OFFSET) + Return (^RBUF) } } =20 @@ -108,7 +115,7 @@ Device(BTH0) { Name (RBUF, ResourceTemplate () { - // BT UART: UART0 (PL011) + // BT UART: URT0 (PL011) or URTM (miniUART) UARTSerialBus( 115200, // InitialBaudRate: in BPS , // BitsPerByte: default to 8 bits @@ -133,7 +140,11 @@ Device(BTH0) // no flow control. 16, // ReceiveBufferSize 16, // TransmitBufferSize +#ifdef PL011_ENABLE + "\\_SB.URTM", // ResourceSource: +#else "\\_SB.URT0", // ResourceSource: +#endif // UART bus controller name , // ResourceSourceIndex: assumed to be 0 , // ResourceUsage: assumed to be --=20 2.21.0.windows.1 -=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 (#55069): https://edk2.groups.io/g/devel/message/55069 Mute This Topic: https://groups.io/mt/71605844/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55070+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55070+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886362; cv=none; d=zohomail.com; s=zohoarc; b=Bt+XTLn+MLiJKoTqinWn/BYPfBrOdZ11mgHjCvXP+7FehbYr+1eDcDmXIxGt1/LLbZDtQSVzs95k0JblSwQwz534AcVoPPAFzHTPN9oNuSAMG5/8U8nLePbQzgUTk+fPc1ePdbMF2RQ9Cvsnm6tMuCS84Fxl4wmH9U63ctA7iC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886362; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=88I9Mcllzom0fw+jt90e5DgQchhf7+xpBA0g/BICqBM=; b=azUJSC3ibeeVh2EQtFdOPghiV0VrHWt6OQS+h6T2+WdNvIhIMa+2/2+0W9Qvuh2UVVdCy8plmBPiVkrlhmV59A9na2GlyF+CnK+pi8OQa1wSiVwxTOecjSGtOHwdz4zvOCelLtM8NodhLUsKGR/jCR5f3yvB5L+jVRKFExgowjg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55070+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886362898674.2904760986388; Fri, 28 Feb 2020 02:39:22 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id UdLRYY1788612xmDtHwzSHBq; Fri, 28 Feb 2020 02:39:21 -0800 X-Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.groups.io with SMTP id smtpd.web10.12437.1582886361010286251 for ; Fri, 28 Feb 2020 02:39:21 -0800 X-Received: by mail-wm1-f67.google.com with SMTP id f15so2661072wml.3 for ; Fri, 28 Feb 2020 02:39:20 -0800 (PST) X-Gm-Message-State: cX3hABhrU2xCPnJNAyBNoLoYx1787277AA= X-Google-Smtp-Source: APXvYqwauEDyhIZM7M2bkUXm2tUk2GksoS3tuudfwGLYPTOYDbTMqiSHQ33uqBoCJCtvQnadD528YQ== X-Received: by 2002:a1c:3b0a:: with SMTP id i10mr4473440wma.177.1582886358983; Fri, 28 Feb 2020 02:39:18 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:18 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 07/15] Platform/RPi3: Switch to .aslc for serial related ACPI tables Date: Fri, 28 Feb 2020 10:38:47 +0000 Message-Id: <20200228103855.11352-8-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886361; bh=d8KXi0v6tXUJ0z43u9jc2E140eI4tR1v1lqDUNpZivw=; h=Cc:Date:From:Reply-To:Subject:To; b=GEuyA2V3uwZIHxolHAdN3Zk46jQMzJcZGpZ4rb2nhwXNeMOAli0yWDzWylNTi0OQhkM lm+gLYTqdxhVu1QNNldP7wmHgLitCpeqJP8gK646VEK19D8sydJ446e+2PVtE4Me0RumM /Oob7WCTvhZVL7jluD+Y/71stnMHysfm5AU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Apart from the serial interrupt constants, the SPCR and DBG2 .aslc we use for the Pi 4 platform can be applied as is for the Pi 3. As a result, we replace the existing binary blobs with formal ASLC. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf | 3 +- Platform/RaspberryPi/RPi3/AcpiTables/Dbg2.aslc | 105 ++++++++++++++++= +--- Platform/RaspberryPi/RPi3/AcpiTables/Spcr.asl | 47 --------- Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc | 96 ++++++++++++++++= ++ 4 files changed, 189 insertions(+), 62 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf b/Platform= /RaspberryPi/RPi3/AcpiTables/AcpiTables.inf index 942acf2c6660..4b4e431da650 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf +++ b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf @@ -30,7 +30,7 @@ [Sources] Gtdt.aslc Dsdt.asl Csrt.aslc - Spcr.asl + Spcr.aslc =20 [Packages] MdePkg/MdePkg.dec @@ -39,4 +39,5 @@ [Packages] =20 [FixedPcd] gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress + gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Dbg2.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Dbg2.aslc index 9315f23e0d2d..dcad8e205596 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Dbg2.aslc +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Dbg2.aslc @@ -2,27 +2,104 @@ * * Debug Port Table (DBG2) * - * Copyright (c) Microsoft Corporation. All rights reserved. + * Copyright (c) 2019, Pete Batard + * Copyright (c) 2012-2016, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * **/ =20 -UINT8 Dbg2[92] =3D { - 0x44, 0x42, 0x47, 0x32, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x4D, 0x53, 0x46, 0x54, 0x20, 0x20, 0x45, 0x44, 0x4B, 0x32, - 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, 0x4D, 0x53, - 0x46, 0x54, 0x01, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x01, 0x0A, 0x00, - 0x26, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x80, 0x10, 0x00, - 0x00, 0x00, 0x16, 0x00, 0x22, 0x00, 0x00, 0x20, 0x00, 0x10, - 0x00, 0x50, 0x21, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, - 0x00, 0x00, '\\', '_', 'S', 'B', '.', 'U', 'R', 'T', - 'M', 0x00, +#include +#include +#include +#include +#include + +#include "AcpiTables.h" + +#pragma pack(1) + +#define RPI_DBG2_NUM_DEBUG_PORTS 1 +#define RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1 +#define RPI_DBG2_NAMESPACESTRING_FIELD_SIZE 10 + +#ifdef PL011_ENABLE +#define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_ARM_PL011_UART +#define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART= _BASE_ADDRESS +#define RPI_UART_LENGTH BCM2836_PL011_UART= _LENGTH +#define RPI_UART_STR { '\\', '_', 'S', = 'B', '.', 'U', 'R', 'T', '0', 0x00 } +#else +#define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_BCM2835_UART +#define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_= BASE_ADDRESS +#define RPI_UART_LENGTH BCM2836_MINI_UART_= LENGTH +// +// RPI_UART_STR should match the value used Uart.asl +// +#define RPI_UART_STR { '\\', '_', 'S', = 'B', '.', 'U', 'R', 'T', 'M', 0x00 } +#endif + +typedef struct { + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device; + EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE BaseAddressRegiste= r; + UINT32 AddressSize; + UINT8 NameSpaceString[RP= I_DBG2_NAMESPACESTRING_FIELD_SIZE]; +} DBG2_DEBUG_DEVICE_INFORMATION; + +typedef struct { + EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE Description; + DBG2_DEBUG_DEVICE_INFORMATION Dbg2DeviceInfo[RPI= _DBG2_NUM_DEBUG_PORTS]; +} DBG2_TABLE; + + +#define DBG2_DEBUG_PORT_DDI(NumReg, SubType, UartBase, UartAddrLen, UartNa= meStr) { \ + { = \ + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, /* U= INT8 Revision */ \ + sizeof (DBG2_DEBUG_DEVICE_INFORMATION), /* U= INT16 Length */ \ + NumReg, /* U= INT8 NumberofGenericAddressRegisters */ \ + RPI_DBG2_NAMESPACESTRING_FIELD_SIZE, /* U= INT16 NameSpaceStringLength */ \ + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, NameSpaceString), /* U= INT16 NameSpaceStringOffset */ \ + 0, /* U= INT16 OemDataLength */ \ + 0, /* U= INT16 OemDataOffset */ \ + EFI_ACPI_DBG2_PORT_TYPE_SERIAL, /* U= INT16 Port Type */ \ + SubType, /* U= INT16 Port Subtype */ \ + {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, /* U= INT8 Reserved[2] */ \ + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister), /* U= INT16 BaseAddressRegister Offset */ \ + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize) /* U= INT16 AddressSize Offset */ \ + }, = \ + ARM_GAS32 (UartBase), /* EFI_ACPI_5_1_GENER= IC_ADDRESS_STRUCTURE BaseAddressRegister */ \ + UartAddrLen, /* UINT32 AddressSiz= e */ \ + UartNameStr /* UINT8 NameSpaceS= tring[MAX_DBG2_NAME_LEN] */ \ + } + + +STATIC DBG2_TABLE Dbg2 =3D { + { + ACPI_HEADER ( + EFI_ACPI_5_1_DEBUG_PORT_2_TABLE_SIGNATURE, + DBG2_TABLE, + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION + ), + OFFSET_OF (DBG2_TABLE, Dbg2DeviceInfo), + RPI_DBG2_NUM_DEBUG_PORTS /* U= INT32 NumberDbgDeviceInfo */ + }, + { + /* + * Kernel Debug Port + */ + DBG2_DEBUG_PORT_DDI ( + RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS, + RPI_UART_INTERFACE_TYPE, + RPI_UART_BASE_ADDRESS, + RPI_UART_LENGTH, + RPI_UART_STR + ), + } }; =20 +#pragma pack() + // -// Reference the table being generated to prevent the optimizer from remov= ing the -// data structure from the executable +// Reference the table being generated to prevent the optimizer from remov= ing +// the data structure from the executable // VOID* CONST ReferenceAcpiTable =3D &Dbg2; diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.asl b/Platform/Raspb= erryPi/RPi3/AcpiTables/Spcr.asl deleted file mode 100644 index 2e6a37323794..000000000000 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.asl +++ /dev/null @@ -1,47 +0,0 @@ -/** @file - * - * Serial Port Console Redirection Table (SPCR) - * - * Copyright (c) 2017-2018, Andrey Warkentin - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -[000h 0000 4] Signature : "SPCR" [Serial Port Cons= ole Redirection table] -[004h 0004 4] Table Length : 00000050 -[008h 0008 1] Revision : 02 -[009h 0009 1] Checksum : 00 -[00Ah 0010 6] Oem ID : "RPiEFI" -[010h 0016 8] Oem Table ID : "RPi3UEFI" -[018h 0024 4] Oem Revision : 00000001 -[01Ch 0028 4] Asl Compiler ID : "----" -[020h 0032 4] Asl Compiler Revision : 00000000 - -[024h 0036 1] Interface Type : 10 -[025h 0037 3] Reserved : 000000 - -[028h 0040 12] Serial Port Register : [Generic Address Structure] -[028h 0040 1] Space ID : 00 [SystemMemory] -[029h 0041 1] Bit Width : 20 -[02Ah 0042 1] Bit Offset : 00 -[02Bh 0043 1] Encoded Access Width : 03 [DWord Access:32] -[02Ch 0044 8] Address : 000000003f215000 - -[034h 0052 1] Interrupt Type : 0E -[035h 0053 1] PCAT-compatible IRQ : 00 -[036h 0054 4] Interrupt : 3D -[03Ah 0058 1] Baud Rate : 07 -[03Bh 0059 1] Parity : 00 -[03Ch 0060 1] Stop Bits : 01 -[03Dh 0061 1] Flow Control : 00 -[03Eh 0062 1] Terminal Type : 00 -[04Ch 0076 1] Reserved : 00 -[040h 0064 2] PCI Device ID : FFFF -[042h 0066 2] PCI Vendor ID : FFFF -[044h 0068 1] PCI Bus : 00 -[045h 0069 1] PCI Device : 00 -[046h 0070 1] PCI Function : 00 -[047h 0071 4] PCI Flags : 00000000 -[04Bh 0075 1] PCI Segment : 00 -[04Ch 0076 4] Reserved : 00000000 diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Spcr.aslc new file mode 100644 index 000000000000..cfa1734a3980 --- /dev/null +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc @@ -0,0 +1,96 @@ +/** @file +* SPCR Table +* +* Copyright (c) 2019 Pete Batard +* Copyright (c) 2014-2016, ARM Limited. All rights reserved. +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#include +#include +#include +#include +#include + +#include "AcpiTables.h" + +#define RPI_UART_FLOW_CONTROL_NONE 0 + +#ifdef PL011_ENABLE +#define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART +#define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART_BASE_ADDRE= SS +#define RPI_UART_INTERRUPT 0x59 +#else +#define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_BCM2835_UART +#define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_BASE_ADDRESS +#define RPI_UART_INTERRUPT 0x3D +#endif +STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr =3D { + ACPI_HEADER ( + EFI_ACPI_5_1_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE, + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION + ), + // UINT8 InterfaceType; + RPI_UART_INTERFACE_TYPE, + // UINT8 Reserved1[3]; + { + EFI_ACPI_RESERVED_BYTE, + EFI_ACPI_RESERVED_BYTE, + EFI_ACPI_RESERVED_BYTE + }, + // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE BaseAddress; + ARM_GAS32 (RPI_UART_BASE_ADDRESS), + // UINT8 InterruptType; + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC, + // UINT8 Irq; + 0, // Not used on ARM + // UINT32 GlobalSystemInterrupt; + RPI_UART_INTERRUPT, + // UINT8 BaudRate; +#if (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 9600) + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_9600, +#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 19200) + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_19200, +#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 57600) + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_57600, +#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 115200) + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200, +#else +#error Unsupported SPCR Baud Rate +#endif + // UINT8 Parity; + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY, + // UINT8 StopBits; + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1, + // UINT8 FlowControl; + RPI_UART_FLOW_CONTROL_NONE, + // UINT8 TerminalType; + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT_UTF8, + // UINT8 Reserved2; + EFI_ACPI_RESERVED_BYTE, + // UINT16 PciDeviceId; + 0xFFFF, + // UINT16 PciVendorId; + 0xFFFF, + // UINT8 PciBusNumber; + 0x00, + // UINT8 PciDeviceNumber; + 0x00, + // UINT8 PciFunctionNumber; + 0x00, + // UINT32 PciFlags; + 0x00000000, + // UINT8 PciSegment; + 0x00, + // UINT32 Reserved3; + EFI_ACPI_RESERVED_DWORD +}; + +// +// Reference the table being generated to prevent the optimizer from remov= ing the +// data structure from the executable +// +VOID* CONST ReferenceAcpiTable =3D &Spcr; --=20 2.21.0.windows.1 -=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 (#55070): https://edk2.groups.io/g/devel/message/55070 Mute This Topic: https://groups.io/mt/71605845/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55071+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55071+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886363; cv=none; d=zohomail.com; s=zohoarc; b=d/S0UV2fgXZlsG946Cz1gkHTQKuZGBocSgLy9+EOAW+putmh8VeXITP0Y1aMXIDIglkJMITu6IV5GqC/TgUJPTaqKEjHONz0rgsfIZKvnL+y9zYE+AfHaWVQvO3XHnHQu0HD5F3G1A5jJBfhECHhxAV3jIpAH1l4wftzgpH7NPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886363; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=5x8dbuEuQzLg4TWsJJKiPpaztVNJKoHffw0fI+LD7ZE=; b=Bqfkl6SZxkFI//B9ppVjAQxk3iJs7sYS2zt2cehV+Sl/NJfSL6Noj9aic2bPp3WdMmFkqz7yru4oCmUpJ54CQmBaul4Z8amslE5qt6cTeXd3che1AlZgn2U3hyYDLE/5RIVAqyryXrUoXckwF80c6LL0tC/7prM0ivItxx+/wMI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55071+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886363746877.5878534944143; Fri, 28 Feb 2020 02:39:23 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id bV06YY1788612xLdx5QMhEEW; Fri, 28 Feb 2020 02:39:22 -0800 X-Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web10.12438.1582886361900863563 for ; Fri, 28 Feb 2020 02:39:22 -0800 X-Received: by mail-wr1-f68.google.com with SMTP id x7so2426696wrr.0 for ; Fri, 28 Feb 2020 02:39:21 -0800 (PST) X-Gm-Message-State: 7hKaDx9hNcP4isHc1t9Sb0p4x1787277AA= X-Google-Smtp-Source: APXvYqxHPYyaw74nHnnESVKR5A7zi6PzKGf+1txZ731pqRzJkU4Qubhtxbejg6b/8GG+XzwRin+i6Q== X-Received: by 2002:adf:914e:: with SMTP id j72mr4296485wrj.109.1582886360165; Fri, 28 Feb 2020 02:39:20 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:19 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 08/15] Platform/RPi3: Update CSRT table to ACPI 5.1 Date: Fri, 28 Feb 2020 10:38:48 +0000 Message-Id: <20200228103855.11352-9-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886362; bh=lYBoUSfOBw4gVWZPEEU+IEsWkFoVABJ/YkkXBkoBPqY=; h=Cc:Date:From:Reply-To:Subject:To; b=eN1uubnOjH7BTnbC1DB9fVt1SQXA9D9zCTwaaSd2dthJT+pkRrmxn3EYnBXUp50nl97 V7JEHHd746R0jeaDepTsr8oVXBRY0llp4M6Uj15YaoeUE3NiENXaxAiagasPpYn0Fh0Mn hwg/DVa9m8sYbfVCFr8hdoGgNprRuEcSm68= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" This brings this table in line with what we have for Pi 4 and will enable factorization of ACPI code between the two platforms. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h | 24 ++++++++++++++++---- Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc | 14 ++++++------ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h b/Platform/R= aspberryPi/RPi3/AcpiTables/AcpiTables.h index 3e68923d3c05..9c76624e4ac8 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h +++ b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h @@ -2,6 +2,7 @@ * * RPi3 defines for constructing ACPI tables * + * Copyright (c) 2019, ARM Ltd. All rights reserved. * Copyright (c) 2018, Andrei Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * @@ -12,7 +13,7 @@ #ifndef __ACPITABLES_H__ #define __ACPITABLES_H__ =20 -#include +#include =20 // The ASL compiler can't perform arithmetic on MEMORY32SETBASE () // parameters so you can't pass a constant like BASE + OFFSET (the @@ -29,6 +30,21 @@ #define EFI_ACPI_CREATOR_REVISION 0x00000097 =20 #define EFI_ACPI_VENDOR_ID SIGNATURE_32 ('M','S','F','T= ') + +// A macro to initialise the common header part of EFI ACPI tables as defi= ned by +// EFI_ACPI_DESCRIPTION_HEADER structure. +#define ACPI_HEADER(Signature, Type, Revision) { \ + Signature, /* UINT32 Signature */ \ + sizeof (Type), /* UINT32 Length */ \ + Revision, /* UINT8 Revision */ \ + 0, /* UINT8 Checksum */ \ + EFI_ACPI_OEM_ID, /* UINT8 OemId[6] */ \ + EFI_ACPI_OEM_TABLE_ID, /* UINT64 OemTableId */ \ + EFI_ACPI_OEM_REVISION, /* UINT32 OemRevision */ \ + EFI_ACPI_CREATOR_ID, /* UINT32 CreatorId */ \ + EFI_ACPI_CREATOR_REVISION /* UINT32 CreatorRevision */ \ + } + #define EFI_ACPI_CSRT_REVISION 0x00000005 #define EFI_ACPI_CSRT_DEVICE_ID_DMA 0x00000009 // Fixed id #define EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP 0x0 // Count up from 0 @@ -36,7 +52,7 @@ #define RPI3_DMA_CHANNEL_COUNT 10 // All 10 DMA channels ar= e listed, including the reserved ones #define RPI3_DMA_USED_CHANNEL_COUNT 5 // Use 5 DMA channels =20 -#define EFI_ACPI_5_0_CSRT_REVISION 0x00000000 +#define EFI_ACPI_5_1_CSRT_REVISION 0x00000000 =20 typedef enum { @@ -68,7 +84,7 @@ typedef struct UINT16 Revision; // 2 bytes UINT16 Reserved; // 2 bytes UINT32 SharedInfoLength; // 4 bytes -} EFI_ACPI_5_0_CSRT_RESOURCE_GROUP_HEADER; +} EFI_ACPI_5_1_CSRT_RESOURCE_GROUP_HEADER; =20 //------------------------------------------------------------------------ // CSRT Resource Descriptor 12 bytes total @@ -79,6 +95,6 @@ typedef struct UINT16 ResourceType; // 2 bytes UINT16 ResourceSubType; // 2 bytes UINT32 UID; // 4 bytes -} EFI_ACPI_5_0_CSRT_RESOURCE_DESCRIPTOR_HEADER; +} EFI_ACPI_5_1_CSRT_RESOURCE_DESCRIPTOR_HEADER; =20 #endif // __ACPITABLES_H__ diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Csrt.aslc index 62f1a1fbdf19..0a8393a8076b 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc @@ -39,7 +39,7 @@ typedef struct //------------------------------------------------------------------------ typedef struct { - EFI_ACPI_5_0_CSRT_RESOURCE_DESCRIPTOR_HEADER DmaControllerHeader; + EFI_ACPI_5_1_CSRT_RESOURCE_DESCRIPTOR_HEADER DmaControllerHeader; DMA_CONTROLLER_VENDOR_DATA ControllerVendorData; } RD_DMA_CONTROLLER; =20 @@ -59,7 +59,7 @@ typedef struct //------------------------------------------------------------------------ typedef struct { - EFI_ACPI_5_0_CSRT_RESOURCE_DESCRIPTOR_HEADER DmaChannelHeader; + EFI_ACPI_5_1_CSRT_RESOURCE_DESCRIPTOR_HEADER DmaChannelHeader; DMA_CHANNEL_VENDOR_DATA ChannelVendorData; } RD_DMA_CHANNEL; =20 @@ -69,7 +69,7 @@ typedef struct =20 typedef struct { - EFI_ACPI_5_0_CSRT_RESOURCE_GROUP_HEADER ResGroupHeader; + EFI_ACPI_5_1_CSRT_RESOURCE_GROUP_HEADER ResGroupHeader; RD_DMA_CONTROLLER DmaController; RD_DMA_CHANNEL DmaChannels[RPI3_DMA_CHANNEL_COUNT]; } RG_DMA; @@ -85,17 +85,17 @@ typedef struct // DMA Resource Group RG_DMA DmaResourceGroup; =20 -} EFI_ACPI_5_0_CSRT_TABLE; +} EFI_ACPI_5_1_CSRT_TABLE; =20 -EFI_ACPI_5_0_CSRT_TABLE Csrt =3D +EFI_ACPI_5_1_CSRT_TABLE Csrt =3D { //----------------------------------------------------------------------= -- // ACPI Table Header //----------------------------------------------------------------------= -- { - EFI_ACPI_5_0_CORE_SYSTEM_RESOURCE_TABLE_SIGNATURE, // Signature = "CSRT" + EFI_ACPI_5_1_CORE_SYSTEM_RESOURCE_TABLE_SIGNATURE, // Signature = "CSRT" sizeof (EFI_ACPI_DESCRIPTION_HEADER) + sizeof (RG_DMA), // Length - EFI_ACPI_5_0_CSRT_REVISION, // Revision + EFI_ACPI_5_1_CSRT_REVISION, // Revision 0x00, // Checksum calculated at runtime. EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field "BC28= 36" EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes lo= ng) "RPI3EDK2" --=20 2.21.0.windows.1 -=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 (#55071): https://edk2.groups.io/g/devel/message/55071 Mute This Topic: https://groups.io/mt/71605846/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55072+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55072+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886366; cv=none; d=zohomail.com; s=zohoarc; b=Jx8wU8u2G4r/LInkXARWufvjHBw4piMzkigR69BfLBpWV+gReRzJj3oTOk8lE2LHoC2D6kC0QJw1FkPHB3YvfWrBqKPWFBMBlg/Hw3mPnh0+gLRh1IyKAvAYTNQ4ij+ImV9gIt7O3lWGDi56xf/t1TrBof2xkifmEj3v47agOts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886366; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=EElZHzZyrCWPPBokTiY110Ze4QOCUailRRaNQ7Eq26k=; b=bmgCyYz34w352BYiNI6vq2RkBaxfX0LdobynyrYT533ihEwLf+7QV0yZ8pMAON2qxFUhTOvuPkYbZNByQBNc04j2e1PqLuV34V8EpK0gO+UvnsEN6IOQCTxQxwPUx6t6uIuWYHkFviYgIFwyEWD8gfNUT5VloCXD3a7hDEaQZa4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55072+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886366067229.35762600165197; Fri, 28 Feb 2020 02:39:26 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id CXqGYY1788612xypMTptPohX; Fri, 28 Feb 2020 02:39:25 -0800 X-Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web09.12588.1582886363963497092 for ; Fri, 28 Feb 2020 02:39:24 -0800 X-Received: by mail-wm1-f65.google.com with SMTP id z12so2653698wmi.4 for ; Fri, 28 Feb 2020 02:39:23 -0800 (PST) X-Gm-Message-State: 0D87GkxdnJsacnwjSFGAP7CYx1787277AA= X-Google-Smtp-Source: APXvYqy1fwoBG34CtVdypSy+kwazkwbTYpOk1sSkgTopn8jhdyEjkN0pNY8a5FoOnfgbToSBokUwrw== X-Received: by 2002:a7b:c38c:: with SMTP id s12mr4119168wmj.96.1582886361651; Fri, 28 Feb 2020 02:39:21 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:21 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 09/15] Platform/RPi3: Use proper aslc for FADT, GTDT and MADT tables generation Date: Fri, 28 Feb 2020 10:38:49 +0000 Message-Id: <20200228103855.11352-10-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886365; bh=3pYcepBWG42JrdHSi3RUH28XXZxVjls7rfT/104dHrY=; h=Cc:Date:From:Reply-To:Subject:To; b=di/oYFjmJOV29/NTti7OZbsg7gJi9QpsF6l5J9ySDt6VmvwWp/WeJs2/bTdcWsbQChn JFL5U3tpPVigsYP+9xjjmsB68qVFw7JZ0Bxf91R+vVgyob/8H4Ba2E+lt1Y2CvOeTjlD1 B16Z6PBOF63pAt0ttGlNNn3yCIN3PVIoPps= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The FADT and GTDT tables are virtually identical to the ones we use for the Pi 4, except for the RPI_SYSTEM_TIMER_BASE_ADDRESS in Gtdt.aslc. However, 2 changes are required for these tables to work with Windows: 1. The ACPI OEM ID for the FADT table MUST be "BC2836" (else Windows 10 fails to boot) so we change the global value in AcpiTables.h. 2. The values for PcdArmArchTimerVirtIntrNum and PcdArmArchTimerHypIntrNum seem to have been swapped in our existing .dsc so we swap them back (Without this swap, Windows 10 simply refuses to boot). The MADT table is deduced from the original Microsoft blob. The one thing of notice is that no GIC Distributor section should exist in that table, otherwise Windows 10 will fail to boot. Obviously, all of the changes applied by this commit were validated on a Raspberry Pi 3 running Windows 10. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h | 2 +- Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf | 6 ++ Platform/RaspberryPi/RPi3/AcpiTables/Fadt.aslc | 99 ++++++++++++++---= --- Platform/RaspberryPi/RPi3/AcpiTables/Gtdt.aslc | 69 ++++++++++---- Platform/RaspberryPi/RPi3/AcpiTables/Madt.aslc | 98 +++++++++--------= -- Platform/RaspberryPi/RPi3/RPi3.dsc | 4 +- 6 files changed, 180 insertions(+), 98 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h b/Platform/R= aspberryPi/RPi3/AcpiTables/AcpiTables.h index 9c76624e4ac8..c860b7881842 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h +++ b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h @@ -23,7 +23,7 @@ CreateDwordField (^BufName, ^MemName._BAS, VarName) \ Add (BCM2836_SOC_REGISTERS, Offset, VarName) =20 -#define EFI_ACPI_OEM_ID {'M','C','R','S','F','T'} //= OEMID 6 bytes long +#define EFI_ACPI_OEM_ID {'B','C','2','8','3','6'} //= OEMID 6 bytes long #define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64 ('R','P','I','3= ','E','D','K','2') // OEM table id 8 bytes long #define EFI_ACPI_OEM_REVISION 0x02000820 #define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('R','P','I','3= ') diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf b/Platform= /RaspberryPi/RPi3/AcpiTables/AcpiTables.inf index 4b4e431da650..9363660b0ef7 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf +++ b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf @@ -33,11 +33,17 @@ [Sources] Spcr.aslc =20 [Packages] + ArmPkg/ArmPkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec MdePkg/MdePkg.dec EmbeddedPkg/EmbeddedPkg.dec Silicon/Broadcom/Bcm283x/Bcm283x.dec =20 [FixedPcd] + gArmTokenSpaceGuid.PcdArmArchTimerIntrNum + gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum + gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum + gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Fadt.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Fadt.aslc index 3ef877fde5f4..ebf58fb7fc3c 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Fadt.aslc +++ b/Platform/RaspberryPi/RPi3/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,76 @@ * **/ =20 -UINT8 Fadt[268] =3D { - 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" + +/* + * Note: Use ACPI 5.1 since we need to match MADT ACPI requirements + */ +EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE Fadt =3D { + 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 + 0, = // UINT32 Dsdt + 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 + 0, = // UINT8 PmTmrLen + 0, = // UINT8 Gpe0BlkLen + 0, = // UINT8 Gpe1BlkLen + 0, = // UINT8 Gpe1Base + 0, = // UINT8 CstCnt + 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_RESERVED_WORD, = // UINT16 IaPcBootArch (Reserved on ARM) + 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 + 0, = // UINT64 XDsdt + 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 }; =20 // diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Gtdt.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Gtdt.aslc index 6551315a5502..0cd6be8cadaa 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Gtdt.aslc +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Gtdt.aslc @@ -1,27 +1,56 @@ /** @file - * - * Generic Timer Description Table (GTDT) - * Automatically generated by AutoAcpi - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ +* Generic Timer Description Table (GTDT) +* +* Copyright (c) 2018, Linaro Limited. All rights reserved. +* Copyright (c) 2012 - 2016, ARM Limited. All rights reserved. +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ =20 -UINT8 Gtdt[80] =3D { - 0x47, 0x54, 0x44, 0x54, 0x50, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x4D, 0x53, 0x46, 0x54, 0x20, 0x20, 0x45, 0x44, 0x4B, 0x32, - 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, 0x4D, 0x53, - 0x46, 0x54, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#include +#include +#include + +#include "AcpiTables.h" + +#define RPI_SYSTEM_TIMER_BASE_ADDRESS 0x4000001C +#define RPI_GTDT_GLOBAL_FLAGS 0 +#define RPI_GTDT_GTIMER_FLAGS EFI_ACPI_5_1_GTDT_TIMER_FLAG_TIMER= _INTERRUPT_POLARITY + +#pragma pack (1) + +typedef struct { + EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt; +} EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLES; + +#pragma pack () + +EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt =3D { + { + ACPI_HEADER( + EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLES, + EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION + ), + RPI_SYSTEM_TIMER_BASE_ADDRESS, // UINT64 PhysicalAddre= ss + 0, // UINT32 Reserved + FixedPcdGet32 (PcdArmArchTimerSecIntrNum), // UINT32 SecurePL1Time= rGSIV + RPI_GTDT_GTIMER_FLAGS, // UINT32 SecurePL1Time= rFlags + FixedPcdGet32 (PcdArmArchTimerIntrNum), // UINT32 NonSecurePL1T= imerGSIV + RPI_GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL1T= imerFlags + FixedPcdGet32 (PcdArmArchTimerVirtIntrNum), // UINT32 VirtualTimerG= SIV + RPI_GTDT_GTIMER_FLAGS, // UINT32 VirtualTimerF= lags + FixedPcdGet32 (PcdArmArchTimerHypIntrNum), // UINT32 NonSecurePL2T= imerGSIV + RPI_GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL2T= imerFlags + 0xFFFFFFFFFFFFFFFF, // UINT64 CntReadBasePh= ysicalAddress + 0, // UINT32 PlatformTimer= Count + 0 // UINT32 PlatfromTimerO= ffset + }, }; =20 // -// Reference the table being generated to prevent the optimizer from remov= ing the -// data structure from the executable +// Reference the table being generated to prevent the optimizer +// from removing the data structure from the executable // VOID* CONST ReferenceAcpiTable =3D &Gtdt; diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Madt.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Madt.aslc index 39cd4c5cee6c..a42ddb8954df 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Madt.aslc +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Madt.aslc @@ -1,52 +1,56 @@ /** @file - * - * Multiple APIC Description Table (MADT) - * - * Copyright (c) 2018, Andrey Warkentin - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ +* Multiple APIC Description Table (MADT) +* +* Copyright (c) 2016 Linaro Ltd. All rights reserved. +* Copyright (c) 2012 - 2015, ARM Limited. All rights reserved. +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ =20 -/* - * Even though the BCM283x don't contain a GIC, these - * GICC definitions enable multi-core support (with PSCI). - * - * Mind the signatures in the header, they must be kept. - */ -UINT8 Madt[] =3D { - 0x41, 0x50, 0x49, 0x43, 0x6c, 0x01, 0x00, 0x00, 0x03, 0xaf, 0x42, 0x43, - 0x32, 0x38, 0x33, 0x36, 0x45, 0x44, 0x4b, 0x32, 0x20, 0x20, 0x20, 0x20, - 0x01, 0x00, 0x00, 0x00, 0x4d, 0x53, 0x46, 0x54, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x50, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x0b, 0x50, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x0b, 0x50, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x50, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00 +#include +#include +#include +#include + +#include "AcpiTables.h" + +// +// Multiple APIC Description Table +// +#pragma pack (1) + +typedef struct { + EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header; + EFI_ACPI_5_1_GIC_STRUCTURE GicInterfaces[4]; + // Do *NOT* add a GIC Distributor on the Pi 3 or Windows 10 won't boot! +} PI_MULTIPLE_APIC_DESCRIPTION_TABLE; + +#pragma pack () + +PI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt =3D { + { + ACPI_HEADER ( + EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, + PI_MULTIPLE_APIC_DESCRIPTION_TABLE, + EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION + ), + // + // MADT specific fields + // + 0, // LocalApicAddress + 0, // Flags + }, + { + 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), + 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), + 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), + 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), + }, }; =20 // diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3= /RPi3.dsc index 40fb0879c2ed..94d1e5b1c45b 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -328,8 +328,8 @@ [PcdsFixedAtBuild.common] gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress|0x40000000 gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum|0x0 gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|0x1 - gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum|0x2 - gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum|0x3 + gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum|0x3 + gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum|0x2 =20 [LibraryClasses.common] ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf --=20 2.21.0.windows.1 -=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 (#55072): https://edk2.groups.io/g/devel/message/55072 Mute This Topic: https://groups.io/mt/71605848/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55073+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55073+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886366; cv=none; d=zohomail.com; s=zohoarc; b=Fymki6jcZLT0ESdm9W+RdrMb0+ZHKwIJsggRCSxxNWP8XE9bc3+ayDLVU1mVs81UA308F2+QnO6iI2wvgl7gFbtpXhXg7jukpG0IGpyFeJviOa8PFrE2FeZNW8x/ASmOKf0W8HOxgTBhcZxT5MJTXtmRvZF9q6SrGWq8vwNyClw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886366; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=dbxqr7KORiM+FlK4r/gUsuwnrFV1jNl9cssOpBn6e/8=; b=HYxx7rnzufJ4yQLA2efU0BeAA2ibu5WLfCSb/7P9LL6po+Lb1xJE9LvkeVAhnDccz5Uzx7iQ8KX0EHDcqeGfXuttr0gVeAXs6UvuBIRiHlv1tLhsZaJgA5NmicSb5JdK0V8ExwXgfu4oK4Ga/AzP0STqujcU2EjKuhzT+pRXivU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55073+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886366321333.75239165068524; Fri, 28 Feb 2020 02:39:26 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id YZrZYY1788612xJwkVTnDyty; Fri, 28 Feb 2020 02:39:25 -0800 X-Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web11.12286.1582886364520658036 for ; Fri, 28 Feb 2020 02:39:24 -0800 X-Received: by mail-wr1-f65.google.com with SMTP id p18so2347631wre.9 for ; Fri, 28 Feb 2020 02:39:24 -0800 (PST) X-Gm-Message-State: oTS5x9X2xmuEfPzLuk6bB8bgx1787277AA= X-Google-Smtp-Source: APXvYqzbkGZxOoiclpOZtFP6ZCOK/Z8xXftt+cwlIXEb178InhWquQouEzx1QSa/37agHEdJ3vS7+w== X-Received: by 2002:a5d:6408:: with SMTP id z8mr4284278wru.122.1582886362753; Fri, 28 Feb 2020 02:39:22 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:22 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 10/15] Platform/RPi4: Add RPI_MODEL constant and replace PL011_ENABLE Date: Fri, 28 Feb 2020 10:38:50 +0000 Message-Id: <20200228103855.11352-11-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886365; bh=mX6D4grQTj1rCpKiP/lplu/QQt62B4fy1PIcFjmP5Qg=; h=Cc:Date:From:Reply-To:Subject:To; b=XzNKiw2QinkxWfeGpe7P5BX9mA8zXJ2gUbaTyxmwlfzmIrU9YF90qY/KLza68NM74dj GnFK/d6ZHDECdr6eEsNMcPvGzZjxTh2g2GfBKlOfd9ZhUzSZVQQDyiaJzwVy+TMRkAWzZ haWZJEX4pIehZHgWrhHYVehPcGHtuJBFT1s= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Since there are multiple Raspberry Pi Models and a lot of the code we use can be factorized, it is useful to have an RPI_MODEL build time constant, set to the platform model number, that can be referenced in the source. Make use this new constant to replace the PL011_ENABLE feature check. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf | 7 ------- Platform/RaspberryPi/RPi4/AcpiTables/Dbg2.aslc | 2 +- Platform/RaspberryPi/RPi4/AcpiTables/Spcr.aslc | 3 ++- Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl | 2 +- Platform/RaspberryPi/RPi4/RPi4.dsc | 4 ++++ 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf b/Platform= /RaspberryPi/RPi4/AcpiTables/AcpiTables.inf index 358c315b6da1..c95d75ed01bb 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf +++ b/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf @@ -56,10 +56,3 @@ [FixedPcd] gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress - -# The following is a stopgap solution to default to PL011 -# usage in ACPI (most common case), until we can switch -# to using DynamicTablesPkg/ConfigurationManagerDxe. -[BuildOptions] - GCC:*_*_*_ASLPP_FLAGS =3D -DPL011_ENABLE - GCC:*_*_*_ASLCC_FLAGS =3D -DPL011_ENABLE diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Dbg2.aslc b/Platform/Rasp= berryPi/RPi4/AcpiTables/Dbg2.aslc index dcad8e205596..c3d5994f8e97 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Dbg2.aslc +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Dbg2.aslc @@ -23,7 +23,7 @@ #define RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1 #define RPI_DBG2_NAMESPACESTRING_FIELD_SIZE 10 =20 -#ifdef PL011_ENABLE +#if (RPI_MODEL =3D=3D 4) #define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_ARM_PL011_UART #define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART= _BASE_ADDRESS #define RPI_UART_LENGTH BCM2836_PL011_UART= _LENGTH diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Spcr.aslc b/Platform/Rasp= berryPi/RPi4/AcpiTables/Spcr.aslc index cb17fbe0ff2f..bec4ad660ec9 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Spcr.aslc +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Spcr.aslc @@ -18,7 +18,8 @@ =20 #define RPI_UART_FLOW_CONTROL_NONE 0 =20 -#ifdef PL011_ENABLE +// Prefer PL011 serial output on the Raspberry Pi 4 +#if (RPI_MODEL =3D=3D 4) #define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART #define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART_BASE_ADDRE= SS #define RPI_UART_INTERRUPT BCM2836_PL011_UART_INTERRUPT diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Uart.asl index ad9d21e6272d..1be285220ad7 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl @@ -140,7 +140,7 @@ Device(BTH0) // no flow control. 16, // ReceiveBufferSize 16, // TransmitBufferSize -#ifdef PL011_ENABLE +#if (RPI_MODEL =3D=3D 4) "\\_SB.URTM", // ResourceSource: #else "\\_SB.URT0", // ResourceSource: diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index 7c1937672597..09bd19e3b724 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -229,6 +229,10 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] ##########################################################################= ######################### =20 [BuildOptions] + GCC:*_*_*_CC_FLAGS =3D -DRPI_MODEL=3D4 + GCC:*_*_*_ASLPP_FLAGS =3D -DRPI_MODEL=3D4 + GCC:*_*_*_ASLCC_FLAGS =3D -DRPI_MODEL=3D4 + GCC:*_*_*_VFRPP_FLAGS =3D -DRPI_MODEL=3D4 GCC:*_*_AARCH64_DLINK_FLAGS =3D -Wl,--fix-cortex-a53-843419 GCC:RELEASE_*_*_CC_FLAGS =3D -DMDEPKG_NDEBUG -DNDEBUG =20 --=20 2.21.0.windows.1 -=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 (#55073): https://edk2.groups.io/g/devel/message/55073 Mute This Topic: https://groups.io/mt/71605849/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55074+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55074+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886368; cv=none; d=zohomail.com; s=zohoarc; b=lzYQvYVm9SxoNvPmbGcX2QIQG2IvILi1kBm21VbvKEzpV8LSVFMKGEV7k3bIUWFHtxI0H0h6h46Y9uSWadFQXjy2UVV9ppUCJRLkl+BAHmxCyGalMOPShMDeKAa07VNmWwDubTUwirUA99FbWF82+HSMMaq7v8ItlwOjOw0EJcM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886368; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=N3ym6UXXzrUzgHsYN7OmxexDU7S1HsjRJqe06fJGbYQ=; b=Wc5vWI3bDdRDONh1kHrlJ22biDAt7VLYoeXFw9qkJMCYk3wXggrApb271tuctxAWJUzdVOOGslfy36sqaYH8EpywYrJsPzXH5CAjoAnz0APz3DygP4urW6uSjpYHliKEyGtWc5MIFqqJREp2xISGIdMW1yvlxYG4qHHBLbz/YWI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55074+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886368510280.50145466881986; Fri, 28 Feb 2020 02:39:28 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id a1j6YY1788612xXkH0EZ2KiL; Fri, 28 Feb 2020 02:39:27 -0800 X-Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mx.groups.io with SMTP id smtpd.web12.12402.1582886366455164576 for ; Fri, 28 Feb 2020 02:39:26 -0800 X-Received: by mail-wm1-f68.google.com with SMTP id d138so1044353wmd.5 for ; Fri, 28 Feb 2020 02:39:26 -0800 (PST) X-Gm-Message-State: mRsuL3Tc8eJKqXBljUBIbb8gx1787277AA= X-Google-Smtp-Source: APXvYqxUbCR/bL+9FUi3g/H3eHYhwff+2EC0v++TwQNwZ90SBWKNI8hoDE6o6m0+QW89nuIuxPXB5g== X-Received: by 2002:a7b:c183:: with SMTP id y3mr4027985wmi.45.1582886364449; Fri, 28 Feb 2020 02:39:24 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:23 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 11/15] Platform/RPi4: Move ACPI interrupts definitions to AcpiTables.h Date: Fri, 28 Feb 2020 10:38:51 +0000 Message-Id: <20200228103855.11352-12-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886367; bh=pPnMqEz4GB8jk+dR96dyQk1bj+7PrgMmYWLhNKWQHIY=; h=Cc:Date:From:Reply-To:Subject:To; b=q9uOJbtVKy1MDdbrCfty9ir7aONfAAJ2IeBcl8gHg1a/QaFidP6ZDcpxTgydNKo3QTx 2o943yg9lhvEfU04wV7tIeCmaziAewBuJ9+gDE2Bk99GTuRNlQSDDMU4qiaftQvzZu4lu CJCfhrMW/57Rm8aYAkPUUGQNqkwZNvhbawM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The ACPI interrupts are not the same across different Raspberry Pi platforms therefore moving them into AcpiTables.h will help with ACPI code factorization. We also take this opportunity to move the serial interrupt definitions away from Silicon, since the ones defined in Bcm2836.h only applied to the Raspberry Pi 4. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h | 28 +++++++++= ++++++ Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl | 36 +++++++++= +---------- Platform/RaspberryPi/RPi4/AcpiTables/Sdhc.asl | 4 +-- Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl | 4 +-- Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 2 -- 5 files changed, 50 insertions(+), 24 deletions(-) diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h b/Platform/R= aspberryPi/RPi4/AcpiTables/AcpiTables.h index fcfad3b5d93b..3d1737aed41a 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h +++ b/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h @@ -97,4 +97,32 @@ typedef struct UINT32 UID; // 4 bytes } EFI_ACPI_5_1_CSRT_RESOURCE_DESCRIPTOR_HEADER; =20 +//------------------------------------------------------------------------ +// Interrupts. These are specific to each platform +//------------------------------------------------------------------------ +#define BCM2836_V3D_BUS_INTERRUPT 0x2A +#define BCM2836_DMA_INTERRUPT 0x3B +#define BCM2836_SPI1_INTERRUPT 0x3D +#define BCM2836_SPI2_INTERRUPT 0x3D +#define BCM2836_HVS_INTERRUPT 0x41 +#define BCM2836_HDMI0_INTERRUPT 0x48 +#define BCM2836_HDMI1_INTERRUPT 0x49 +#define BCM2836_PV2_INTERRUPT 0x4A +#define BCM2836_PV0_INTERRUPT 0x4D +#define BCM2836_PV1_INTERRUPT 0x4E +#define BCM2836_MBOX_INTERRUPT 0x61 +#define BCM2836_VCHIQ_INTERRUPT 0x62 +#define BCM2386_GPIO_INTERRUPT0 0x51 +#define BCM2386_GPIO_INTERRUPT1 0x53 +#define BCM2836_I2C1_INTERRUPT 0x55 +#define BCM2836_I2C2_INTERRUPT 0x55 +#define BCM2836_SPI0_INTERRUPT 0x56 +#define BCM2836_USB_INTERRUPT 0x69 +#define BCM2836_SDHOST_INTERRUPT 0x98 +#define BCM2836_MMCHS1_INTERRUPT 0x9E +#define BCM2836_MINI_UART_INTERRUPT 0x7D +#define BCM2836_PL011_UART_INTERRUPT 0x99 +#define GENET_INTERRUPT0 0xBD +#define GENET_INTERRUPT1 0xBE + #endif // __ACPITABLES_H__ diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Dsdt.asl index c505413bcba2..e1ddb742376a 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl @@ -87,7 +87,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_USB_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x69 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_USB_INTERRUPT } }) Method (_CRS, 0x0, Serialized) { @@ -111,32 +111,32 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { // Memory and interrupt for the GPU MEMORY32FIXED (ReadWrite, 0, BCM2836_V3D_BUS_LENGTH, RM01) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x2A } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_V3D_BUS_INTERRUPT } =20 // HVS - Hardware Video Scalar MEMORY32FIXED (ReadWrite, 0, BCM2836_HVS_LENGTH, RM02) // The HVS interrupt is reserved by the VPU - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 41 } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_HVS_INTERRUPT } =20 // PixelValve0 - DSI0 or DPI // MEMORY32FIXED (ReadWrite, BCM2836_PV0_BASE_ADDRESS, BCM2836_PV0= _LENGTH, RM03) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 4D } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_PV0_INTERRUPT } =20 // PixelValve1 - DS1 or SMI // MEMORY32FIXED (ReadWrite, BCM2836_PV1_BASE_ADDRESS, BCM2836_PV1= _LENGTH, RM04) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 4E } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_PV1_INTERRUPT } =20 // PixelValve2 - HDMI output - connected to HVS display FIFO 1 MEMORY32FIXED (ReadWrite, 0, BCM2836_PV2_LENGTH, RM05) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x4A } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_PV2_INTERRUPT } =20 // HDMI registers MEMORY32FIXED (ReadWrite, 0, BCM2836_HDMI0_LENGTH, RM06) MEMORY32FIXED (ReadWrite, 0, BCM2836_HDMI1_LENGTH, RM07) // hdmi_int[0] - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 48 } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_HDMI0_INTERRUPT } // hdmi_int[1] - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 49 } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_HDMI1_INTERRUPT } =20 // HDMI DDC connection I2CSerialBus (0x50,, 100000,, "\\_SB.I2C2",,,,) // EDID @@ -214,7 +214,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_MBOX_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x61 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_MBOX_INTERRUPT } }) =20 Method (_CRS, 0x0, Serialized) @@ -239,7 +239,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_VCHIQ_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x62 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_VCHIQ_INTERRUPT } }) =20 Method (_CRS, 0x0, Serialized) @@ -277,7 +277,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, GPIO_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x51, 0x= 53 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2386_= GPIO_INTERRUPT0, BCM2386_GPIO_INTERRUPT1 } }) Method (_CRS, 0x0, Serialized) { @@ -302,7 +302,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) { // No need for MEMORY32SETBASE on Genet as we have a straight ba= se address constant MEMORY32FIXED (ReadWrite, GENET_BASE_ADDRESS, GENET_LENGTH, ) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0xB= D, 0xBE } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { GEN= ET_INTERRUPT0, GENET_INTERRUPT1 } }) Return (RBUF) } @@ -329,7 +329,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C1_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x55 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_= I2C1_INTERRUPT } =20 // // MsftFunctionConfig is encoded as the VendorLong. @@ -368,7 +368,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate() { MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C2_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x55 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_= I2C2_INTERRUPT } }) =20 Method (_CRS, 0x0, Serialized) @@ -392,7 +392,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI0_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x56 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_= SPI0_INTERRUPT } =20 // // MsftFunctionConfig is encoded as the VendorLong. @@ -459,7 +459,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI1_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { 0x3D } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { BCM2836= _SPI1_INTERRUPT } =20 // // MsftFunctionConfig is encoded as the VendorLong. @@ -515,7 +515,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) // Name (RBUF, ResourceTemplate () // { // MEMORY32FIXED (ReadWrite, BCM2836_SPI2_BASE_ADDRESS, BCM2836_= SPI2_LENGTH, RMEM) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { 0x= 3D } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { BC= M2836_SPI2_INTERRUPT } // }) // Return (RBUF) // } @@ -545,7 +545,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) // PWM clock control MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_CLK_LENGTH, RM03) // Interrupt DMA channel 11 - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x3B } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_DMA_INTERRUPT } // DMA channel 11, DREQ 5 for PWM FixedDMA (5, 11, Width32Bit, ) }) diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Sdhc.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Sdhc.asl index 590c71edd484..0ab1ba27f2cf 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Sdhc.asl +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Sdhc.asl @@ -37,7 +37,7 @@ Device (SDC1) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, MMCHS1_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x9E } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_M= MCHS1_INTERRUPT } }) Method (_CRS, 0x0, Serialized) { @@ -81,7 +81,7 @@ Device (SDC2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, SDHOST_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x98 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_S= DHOST_INTERRUPT } }) Method (_CRS, 0x0, Serialized) { diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Uart.asl index 1be285220ad7..c466247bb33b 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl @@ -28,7 +28,7 @@ Device (URT0) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_PL011_UART_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x99 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_P= L011_UART_INTERRUPT } }) Method (_CRS, 0x0, Serialized) { @@ -68,7 +68,7 @@ Device (URTM) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_MINI_UART_LENGTH, RMEM) - Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) { 0x7D } + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_MINI_= UART_INTERRUPT } =20 // NTRAID#MSFT-7141401-2016/04/7-jordanrh - disable UART muxing // until a proper solution can be created for the dmap conflict. diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h b/= Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h index 0b402e9ac56e..a930c64af379 100644 --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h @@ -80,12 +80,10 @@ #define BCM2836_PL011_UART_OFFSET 0x00201000 #define BCM2836_PL011_UART_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_PL011_UART_OFFSET) #define BCM2836_PL011_UART_LENGTH 0x00001000 -#define BCM2836_PL011_UART_INTERRUPT 0x99 =20 #define BCM2836_MINI_UART_OFFSET 0x00215000 #define BCM2836_MINI_UART_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_MINI_UART_OFFSET) #define BCM2836_MINI_UART_LENGTH 0x00000070 -#define BCM2836_MINI_UART_INTERRUPT 0x7D =20 #define BCM2836_I2C0_OFFSET 0x00205000 #define BCM2836_I2C0_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_I2C0_OFFSET) --=20 2.21.0.windows.1 -=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 (#55074): https://edk2.groups.io/g/devel/message/55074 Mute This Topic: https://groups.io/mt/71605850/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55075+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55075+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886370; cv=none; d=zohomail.com; s=zohoarc; b=YTdQ4f5woVFCqs1SG47TQazyuYYgj27TscvU4AvYo18SNdO1ivWSv+tCpkN1JcHgZ/lJ3QvdgAnn0awq+o+B5RyxsWZAbhmpy98CbJm/FIZEgT8nTG0FY5Bwi0h8swigksfcMjtCQJ9XdEqd0MMZwJmGYX1P4pwd7RKJ0jS2rR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886370; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=y1cJbum64rg90gw0m5ojTTY5BFmDIbKBrwHf09p/bwI=; b=lLsRsCstbQA5jlmDC8g9NFYuuQpgDb1zpgN9N6y7x45bTvOADZEBqNkjyNqaOLy/yG9lacBjbROjIVzeJRIyXxJtI2rZ79DkCwUet0XrTDXH0XHuWyrzgXzjmBUJ05LUQ7V7WkuDk05SnN/u41bgmt6z4B+MJ8Fag4m/mPG93nQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55075+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886370482727.6346167615117; Fri, 28 Feb 2020 02:39:30 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id tCWRYY1788612xiVClawzgm7; Fri, 28 Feb 2020 02:39:29 -0800 X-Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.groups.io with SMTP id smtpd.web10.12439.1582886368422448547 for ; Fri, 28 Feb 2020 02:39:28 -0800 X-Received: by mail-wm1-f67.google.com with SMTP id a5so2687952wmb.0 for ; Fri, 28 Feb 2020 02:39:28 -0800 (PST) X-Gm-Message-State: sTSDGB6pHj5FSQVDu5AewYMzx1787277AA= X-Google-Smtp-Source: APXvYqxgK4aa305DMDvB8yemACsqkaRqiqRlfjPWdirxIGwmNyXGZ6iPVbjAe++1Kh25o9vysFlEyg== X-Received: by 2002:a1c:a5c2:: with SMTP id o185mr2233943wme.173.1582886366327; Fri, 28 Feb 2020 02:39:26 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:25 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 12/15] Platform/RPi3: Move ACPI interrupts definitions to AcpiTables.h Date: Fri, 28 Feb 2020 10:38:52 +0000 Message-Id: <20200228103855.11352-13-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886369; bh=4D5QCuIAWT+J9snfsTPdNCOZ/S26AvTrLq7Ws16B3gM=; h=Cc:Date:From:Reply-To:Subject:To; b=LMD/1cvUBBWqUAG3FDGIHnL8miqJsDDt/U8+ga1tpJW65c+Byr72G2UU77B85h2vjfZ 1ASPmRSRBW+ss1z7CVi8McqQWk2IuHFkvI6u4/e5X0v6CKeZSarZJ87JgOjTI63LErKB8 pqS8WlsYnXpHZkXUQqQA4DynuhGmgTbQzXc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The ACPI interrupts are not the same across different Raspberry Pi platforms therefore moving them into AcpiTables.h will help with ACPI code factorization. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h | 26 +++++++++++++++ Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl | 34 ++++++++++---------- Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl | 4 +-- Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc | 4 +-- Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl | 4 +-- 5 files changed, 49 insertions(+), 23 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h b/Platform/R= aspberryPi/RPi3/AcpiTables/AcpiTables.h index c860b7881842..be97fc4c1eff 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h +++ b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h @@ -97,4 +97,30 @@ typedef struct UINT32 UID; // 4 bytes } EFI_ACPI_5_1_CSRT_RESOURCE_DESCRIPTOR_HEADER; =20 +//------------------------------------------------------------------------ +// Interrupts. These are specific to each platform +//------------------------------------------------------------------------ +#define BCM2836_USB_INTERRUPT 0x29 +#define BCM2836_V3D_BUS_INTERRUPT 0x2A +#define BCM2836_DMA_INTERRUPT 0x3B +#define BCM2836_SPI1_INTERRUPT 0x3D +#define BCM2836_SPI2_INTERRUPT 0x3D +#define BCM2836_HVS_INTERRUPT 0x41 +#define BCM2836_HDMI0_INTERRUPT 0x48 +#define BCM2836_HDMI1_INTERRUPT 0x49 +#define BCM2836_PV2_INTERRUPT 0x4A +#define BCM2836_PV0_INTERRUPT 0x4D +#define BCM2836_PV1_INTERRUPT 0x4E +#define BCM2836_MBOX_INTERRUPT 0x61 +#define BCM2836_VCHIQ_INTERRUPT 0x62 +#define BCM2386_GPIO_INTERRUPT0 0x51 +#define BCM2386_GPIO_INTERRUPT1 0x53 +#define BCM2836_I2C1_INTERRUPT 0x55 +#define BCM2836_I2C2_INTERRUPT 0x55 +#define BCM2836_SPI0_INTERRUPT 0x56 +#define BCM2836_SDHOST_INTERRUPT 0x58 +#define BCM2836_MMCHS1_INTERRUPT 0x5E +#define BCM2836_MINI_UART_INTERRUPT 0x3D +#define BCM2836_PL011_UART_INTERRUPT 0x59 + #endif // __ACPITABLES_H__ diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl b/Platform/Raspb= erryPi/RPi3/AcpiTables/Dsdt.asl index 693e4b15e985..1e17ec901042 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl @@ -85,7 +85,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_USB_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x29 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_USB_INTERRUPT } }) Method (_CRS, 0x0, Serialized) { @@ -109,32 +109,32 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2= ", 2) { // Memory and interrupt for the GPU MEMORY32FIXED (ReadWrite, 0, BCM2836_V3D_BUS_LENGTH, RM01) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x2A } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_V3D_BUS_INTERRUPT } =20 // HVS - Hardware Video Scalar MEMORY32FIXED (ReadWrite, 0, BCM2836_HVS_LENGTH, RM02) // The HVS interrupt is reserved by the VPU - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 41 } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_HVS_INTERRUPT } =20 // PixelValve0 - DSI0 or DPI // MEMORY32FIXED (ReadWrite, BCM2836_PV0_BASE_ADDRESS, BCM2836_PV0= _LENGTH, RM03) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 4D } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_PV0_INTERRUPT } =20 // PixelValve1 - DS1 or SMI // MEMORY32FIXED (ReadWrite, BCM2836_PV1_BASE_ADDRESS, BCM2836_PV1= _LENGTH, RM04) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 4E } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_PV1_INTERRUPT } =20 // PixelValve2 - HDMI output - connected to HVS display FIFO 1 MEMORY32FIXED (ReadWrite, 0, BCM2836_PV2_LENGTH, RM05) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x4A } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_PV2_INTERRUPT } =20 // HDMI registers MEMORY32FIXED (ReadWrite, 0, BCM2836_HDMI0_LENGTH, RM06) MEMORY32FIXED (ReadWrite, 0, BCM2836_HDMI1_LENGTH, RM07) // hdmi_int[0] - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 48 } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_HDMI0_INTERRUPT } // hdmi_int[1] - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x= 49 } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_HDMI1_INTERRUPT } =20 // HDMI DDC connection I2CSerialBus (0x50,, 100000,, "\\_SB.I2C2",,,,) // EDID @@ -212,7 +212,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_MBOX_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x61 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_MBOX_INTERRUPT } }) =20 Method (_CRS, 0x0, Serialized) @@ -237,7 +237,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_VCHIQ_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x62 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_VCHIQ_INTERRUPT } }) =20 Method (_CRS, 0x0, Serialized) @@ -275,7 +275,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, GPIO_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x51, 0x= 53 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2386_= GPIO_INTERRUPT0, BCM2386_GPIO_INTERRUPT1 } }) Method (_CRS, 0x0, Serialized) { @@ -298,7 +298,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C1_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x55 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_= I2C1_INTERRUPT } =20 // // MsftFunctionConfig is encoded as the VendorLong. @@ -337,7 +337,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate() { MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C2_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x55 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_= I2C2_INTERRUPT } }) =20 Method (_CRS, 0x0, Serialized) @@ -361,7 +361,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI0_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x56 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_= SPI0_INTERRUPT } =20 // // MsftFunctionConfig is encoded as the VendorLong. @@ -428,7 +428,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI1_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { 0x3D } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { BCM2836= _SPI1_INTERRUPT } =20 // // MsftFunctionConfig is encoded as the VendorLong. @@ -484,7 +484,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) // Name (RBUF, ResourceTemplate () // { // MEMORY32FIXED (ReadWrite, BCM2836_SPI2_BASE_ADDRESS, BCM2836_= SPI2_LENGTH, RMEM) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { 0x= 3D } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { BC= M2836_SPI2_INTERRUPT } // }) // Return (RBUF) // } @@ -514,7 +514,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) // PWM clock control MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_CLK_LENGTH, RM03) // Interrupt DMA channel 11 - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x3B } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_DMA_INTERRUPT } // DMA channel 11, DREQ 5 for PWM FixedDMA (5, 11, Width32Bit, ) }) diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl b/Platform/Raspb= erryPi/RPi3/AcpiTables/Sdhc.asl index f7553280b60e..0ab1ba27f2cf 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl @@ -37,7 +37,7 @@ Device (SDC1) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, MMCHS1_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x5E } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_M= MCHS1_INTERRUPT } }) Method (_CRS, 0x0, Serialized) { @@ -81,7 +81,7 @@ Device (SDC2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, SDHOST_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x58 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_S= DHOST_INTERRUPT } }) Method (_CRS, 0x0, Serialized) { diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Spcr.aslc index cfa1734a3980..cb17fbe0ff2f 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc @@ -21,11 +21,11 @@ #ifdef PL011_ENABLE #define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART #define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART_BASE_ADDRE= SS -#define RPI_UART_INTERRUPT 0x59 +#define RPI_UART_INTERRUPT BCM2836_PL011_UART_INTERRUPT #else #define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_BCM2835_UART #define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_BASE_ADDRESS -#define RPI_UART_INTERRUPT 0x3D +#define RPI_UART_INTERRUPT BCM2836_MINI_UART_INTERRUPT #endif STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr =3D { ACPI_HEADER ( diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl b/Platform/Raspb= erryPi/RPi3/AcpiTables/Uart.asl index ddab63f15268..edd8bcc3b376 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl @@ -28,7 +28,7 @@ Device (URT0) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_PL011_UART_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x59 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_P= L011_UART_INTERRUPT } }) Method (_CRS, 0x0, Serialized) { @@ -68,7 +68,7 @@ Device (URTM) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_MINI_UART_LENGTH, RMEM) - Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) { 0x3D } + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_MINI_= UART_INTERRUPT } =20 // NTRAID#MSFT-7141401-2016/04/7-jordanrh - disable UART muxing // until a proper solution can be created for the dmap conflict. --=20 2.21.0.windows.1 -=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 (#55075): https://edk2.groups.io/g/devel/message/55075 Mute This Topic: https://groups.io/mt/71605852/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55076+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55076+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886372; cv=none; d=zohomail.com; s=zohoarc; b=fKM65hPZjIjM3E6Po1D4oirPjuJl9gbqSbTccx1IHS4wFKh92ZL0AXicFrWr+TF9+0hQ+n7FAwkP8TNchgMe1GmvDa37SB+J3chDj5n7XPQMCtkbk8ufsTQ5ggwbZVpGk8aVDC0BeD3RWGXCeourPjrUskM5USHpmrFTqgcwEwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886372; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=XnixMBQK+f5ITF1P3hPfvWylXb5G2j6TZm2IgiObq50=; b=Cs0IO+MQo0n+iOfkz3tZWxYxNTAItXXX2d/gInAkxcXfqwRKvSHiT2SA7f/hH8DDr3lBlao27Ez5WLgtyhS7szQE6cRbbz7UjE+5Z/58qmKCWkcflR8EUj5iDUdV2lql3HHWkgAcQ8yzN0IW+JvihQZXa6NV/vgrfFu6CfZ/iVM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55076+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886372370824.280103794708; Fri, 28 Feb 2020 02:39:32 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id tNYNYY1788612xQz3mi4HyJE; Fri, 28 Feb 2020 02:39:31 -0800 X-Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web10.12440.1582886370482385115 for ; Fri, 28 Feb 2020 02:39:30 -0800 X-Received: by mail-wr1-f65.google.com with SMTP id v2so2320180wrp.12 for ; Fri, 28 Feb 2020 02:39:30 -0800 (PST) X-Gm-Message-State: ucyl7xS9HHoxzuWlzCRDuIGhx1787277AA= X-Google-Smtp-Source: APXvYqz9oDMaCWy5g54iWyI6i/qGZlTWvWvD2sdWe5kDDZBok/IzoiF5TFwvZrDaePCQS2zWOS7ftw== X-Received: by 2002:adf:de12:: with SMTP id b18mr4196143wrm.268.1582886368039; Fri, 28 Feb 2020 02:39:28 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:27 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 13/15] Platform/RPi4: Prepare ACPI code for factorization Date: Fri, 28 Feb 2020 10:38:53 +0000 Message-Id: <20200228103855.11352-14-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886371; bh=L9gHmbuvQpcsQb0K5JEBRkUdJMqu29jVCQxivECsc3U=; h=Cc:Date:From:Reply-To:Subject:To; b=WVX9SdO7ArJwwIQdSYCQHc2hq6Sh7QhbWtCJsk38OLUpe1Wv7sIWaSBbtWHxiLnPiPo iLG8YWCpGM0lhmKr8iSOB5zvVrZ2RaWxz9ag/z5GYreW0Zlt4VegYCbuaR2NZvtCEyQ5S s49Zz+KHez4OQZjZmGz7P8zq7qn6++unwJs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" * Update the OEM IDs and base revision numbers. * Move RPI_SYSTEM_TIMER_BASE_ADDRESS to AcpiTables.h. * Add RPi3 constants and conditional blocks according to model. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h | 48 +++++++++++++++++--- Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl | 4 ++ Platform/RaspberryPi/RPi4/AcpiTables/Gtdt.aslc | 1 - Platform/RaspberryPi/RPi4/AcpiTables/Madt.aslc | 15 ++++++ 4 files changed, 61 insertions(+), 7 deletions(-) diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h b/Platform/R= aspberryPi/RPi4/AcpiTables/AcpiTables.h index 3d1737aed41a..0b8a8494450c 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h +++ b/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h @@ -1,7 +1,8 @@ /** @file * - * RPi4 defines for constructing ACPI tables + * RPi defines for constructing ACPI tables * + * Copyright (c) 2020, Pete Batard * Copyright (c) 2019, ARM Ltd. All rights reserved. * Copyright (c) 2018, Andrei Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. @@ -23,11 +24,15 @@ CreateDwordField (^BufName, ^MemName._BAS, VarName) \ Add (BCM2836_SOC_REGISTERS, Offset, VarName) =20 -#define EFI_ACPI_OEM_ID {'M','C','R','S','F','T'} //= OEMID 6 bytes long -#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64 ('R','P','I','4= ','E','D','K','2') // OEM table id 8 bytes long -#define EFI_ACPI_OEM_REVISION 0x02000820 -#define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('R','P','I','4= ') -#define EFI_ACPI_CREATOR_REVISION 0x00000097 +#if (RPI_MODEL =3D=3D 3) +#define EFI_ACPI_OEM_ID {'B','C','2','8','3','6'} +#else +#define EFI_ACPI_OEM_ID {'M','C','R','S','F','T'} +#endif +#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64 ('R','P','I','_= ','E','D','K','2') +#define EFI_ACPI_OEM_REVISION 0x00000100 +#define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('E','D','K','2= ') +#define EFI_ACPI_CREATOR_REVISION 0x00000100 =20 #define EFI_ACPI_VENDOR_ID SIGNATURE_32 ('M','S','F','T= ') =20 @@ -52,6 +57,12 @@ #define RPI_DMA_CHANNEL_COUNT 10 // All 10 DMA channels ar= e listed, including the reserved ones #define RPI_DMA_USED_CHANNEL_COUNT 5 // Use 5 DMA channels =20 +#if (RPI_MODEL =3D=3D 3) +#define RPI_SYSTEM_TIMER_BASE_ADDRESS 0x4000001C +#elif (RPI_MODEL =3D=3D 4) +#define RPI_SYSTEM_TIMER_BASE_ADDRESS 0xFF80001C +#endif + #define EFI_ACPI_5_1_CSRT_REVISION 0x00000000 =20 typedef enum @@ -100,6 +111,30 @@ typedef struct //------------------------------------------------------------------------ // Interrupts. These are specific to each platform //------------------------------------------------------------------------ +#if (RPI_MODEL =3D=3D 3) +#define BCM2836_V3D_BUS_INTERRUPT 0x2A +#define BCM2836_DMA_INTERRUPT 0x3B +#define BCM2836_SPI1_INTERRUPT 0x3D +#define BCM2836_SPI2_INTERRUPT 0x3D +#define BCM2836_HVS_INTERRUPT 0x41 +#define BCM2836_HDMI0_INTERRUPT 0x48 +#define BCM2836_HDMI1_INTERRUPT 0x49 +#define BCM2836_PV2_INTERRUPT 0x4A +#define BCM2836_PV0_INTERRUPT 0x4D +#define BCM2836_PV1_INTERRUPT 0x4E +#define BCM2836_MBOX_INTERRUPT 0x61 +#define BCM2836_VCHIQ_INTERRUPT 0x62 +#define BCM2386_GPIO_INTERRUPT0 0x51 +#define BCM2386_GPIO_INTERRUPT1 0x53 +#define BCM2836_I2C1_INTERRUPT 0x55 +#define BCM2836_I2C2_INTERRUPT 0x55 +#define BCM2836_SPI0_INTERRUPT 0x56 +#define BCM2836_USB_INTERRUPT 0x29 +#define BCM2836_SDHOST_INTERRUPT 0x58 +#define BCM2836_MMCHS1_INTERRUPT 0x5E +#define BCM2836_MINI_UART_INTERRUPT 0x3D +#define BCM2836_PL011_UART_INTERRUPT 0x59 +#elif (RPI_MODEL =3D=3D 4) #define BCM2836_V3D_BUS_INTERRUPT 0x2A #define BCM2836_DMA_INTERRUPT 0x3B #define BCM2836_SPI1_INTERRUPT 0x3D @@ -124,5 +159,6 @@ typedef struct #define BCM2836_PL011_UART_INTERRUPT 0x99 #define GENET_INTERRUPT0 0xBD #define GENET_INTERRUPT1 0xBE +#endif =20 #endif // __ACPITABLES_H__ diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Dsdt.asl index e1ddb742376a..c2775088b5a2 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl @@ -31,7 +31,9 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) { include ("Sdhc.asl") include ("Pep.asl") +#if (RPI_MODEL =3D=3D 4) include ("Xhci.asl") +#endif =20 Device (CPU0) { @@ -286,6 +288,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) } } =20 +#if (RPI_MODEL =3D=3D 4) Device (ETH0) { Name (_HID, "BCM6E4E") @@ -314,6 +317,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2",= 2) } }) } +#endif =20 // Description: I2C Device (I2C1) diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Gtdt.aslc b/Platform/Rasp= berryPi/RPi4/AcpiTables/Gtdt.aslc index 7c2aa9389456..8453e487fb63 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Gtdt.aslc +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Gtdt.aslc @@ -14,7 +14,6 @@ =20 #include "AcpiTables.h" =20 -#define RPI_SYSTEM_TIMER_BASE_ADDRESS 0xFF80001C #define RPI_GTDT_GLOBAL_FLAGS 0 #define RPI_GTDT_GTIMER_FLAGS EFI_ACPI_5_1_GTDT_TIMER_FLAG_TIMER= _INTERRUPT_POLARITY =20 diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Madt.aslc b/Platform/Rasp= berryPi/RPi4/AcpiTables/Madt.aslc index f847a9310ff7..4029cd191ab5 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Madt.aslc +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Madt.aslc @@ -23,7 +23,9 @@ typedef struct { EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header; EFI_ACPI_5_1_GIC_STRUCTURE GicInterfaces[4]; +#if (RPI_MODEL !=3D 3) EFI_ACPI_5_1_GIC_DISTRIBUTOR_STRUCTURE GicDistributor; +#endif } PI_MULTIPLE_APIC_DESCRIPTION_TABLE; =20 #pragma pack () @@ -42,6 +44,16 @@ PI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt =3D { 0, // Flags }, { +#if (RPI_MODEL =3D=3D 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), + 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), + 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), + 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 =3D=3D 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), @@ -54,8 +66,11 @@ PI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt =3D { 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 }, +#if (RPI_MODEL !=3D 3) EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet64 (PcdGicDistributorBas= e), 0) +#endif }; =20 // --=20 2.21.0.windows.1 -=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 (#55076): https://edk2.groups.io/g/devel/message/55076 Mute This Topic: https://groups.io/mt/71605853/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55077+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55077+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886375; cv=none; d=zohomail.com; s=zohoarc; b=RD4h7+2n/V7kAujdzTeZ05ReagJ1P8EEOehR+dYkXtKwqIkvy6BpGpUYRoO3VNo1KSDdfM5TLh9siZHSjCDon4ihkxEA9FKxdW94Iifmg3ahHmK1Is0CSrBekK5qFKn9nOBurxYJoJWeS640PcutpuzdTC2ZHmjUlY8C3Ela9DQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886375; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=rTG9CDwlXOBAZxYOyzgS5Er6HZ+KmgpEeRT1y70ZwXs=; b=gzomVAfliVtfsuT8pOnAAvL2cAv13uJ4Af3y2c+AY3Zd2p/AeZS5LGZCPFB7jWq9xIYIXzVokt2IGdUTyohVmTY8xtHUJGJdlvd2QIZ2hms0t05gpd67l/FSFlPGa5+s77L++vbq6s7xZhjQxLjzVQVNhcqfhbZAVGQhhGblRO0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55077+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15828863751811005.7254374353467; Fri, 28 Feb 2020 02:39:35 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id nzuYYY1788612xaKRI7eBQGo; Fri, 28 Feb 2020 02:39:33 -0800 X-Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.groups.io with SMTP id smtpd.web12.12403.1582886373151083659 for ; Fri, 28 Feb 2020 02:39:33 -0800 X-Received: by mail-wr1-f67.google.com with SMTP id e8so2389155wrm.5 for ; Fri, 28 Feb 2020 02:39:32 -0800 (PST) X-Gm-Message-State: 6xMHJ2pKu2Qd1eba2kf6si9Tx1787277AA= X-Google-Smtp-Source: APXvYqws3N1RjA8g1bp3S54+FVUmDgRvEZnqkM7priDPwb3+pPAR0iroI5d5Gb4UBDhr5ygf9cxCoA== X-Received: by 2002:adf:f648:: with SMTP id x8mr4518809wrp.198.1582886370597; Fri, 28 Feb 2020 02:39:30 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:30 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 14/15] Platform/RPi3: Merge ACPI code from RPi4 Date: Fri, 28 Feb 2020 10:38:54 +0000 Message-Id: <20200228103855.11352-15-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886373; bh=tSq5JbLxVJDjchOfi5Ttj4je2l6n3XtokNfmDlGxi5I=; h=Cc:Date:From:Reply-To:Subject:To; b=JQGurkuM++sOjfw/askSCvZrCOfUCUpzQKR+X0JqWR3bx25h+fE+nZxJ7g9J2lqxTwh BRPCA3+Y9pGfILr2eq/KE+9YSk1/X3+w0/s8BQhBFy3JJ6VIHnVS50T5RpoVhgfMRSFOB QQuMxLtBbOhTPoJz/HmHl57Rv4lPcK8J9Xs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" This basically copies all of the RPi4 platform ACPI source into RPi3 since the last commit updates the code to serve both platforms. No alteration of original ACPI source files were applied. Whereas this commit is pretty much superfluous (apart from the .dsc changes), since these files will be removed in the next commit, we apply it nonetheless so that the minimal alterations to the existing Raspberry 3 tables are made apparent. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h | 88 +++++++++---- Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf | 11 +- Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc | 28 ++-- Platform/RaspberryPi/RPi3/AcpiTables/Dbg2.aslc | 2 +- Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl | 35 +++++ Platform/RaspberryPi/RPi3/AcpiTables/Gtdt.aslc | 1 - Platform/RaspberryPi/RPi3/AcpiTables/Madt.aslc | 22 +++- Platform/RaspberryPi/RPi3/AcpiTables/Pep.asl | 5 +- Platform/RaspberryPi/RPi3/AcpiTables/Pep.c | 7 +- Platform/RaspberryPi/RPi3/AcpiTables/Pep.h | 9 +- Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc | 3 +- Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl | 2 +- Platform/RaspberryPi/RPi3/AcpiTables/Xhci.asl | 136 ++++++++++++++++= ++++ Platform/RaspberryPi/RPi3/RPi3.dsc | 4 + 14 files changed, 300 insertions(+), 53 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h b/Platform/R= aspberryPi/RPi3/AcpiTables/AcpiTables.h index be97fc4c1eff..0b8a8494450c 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h +++ b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h @@ -1,7 +1,8 @@ /** @file * - * RPi3 defines for constructing ACPI tables + * RPi defines for constructing ACPI tables * + * Copyright (c) 2020, Pete Batard * Copyright (c) 2019, ARM Ltd. All rights reserved. * Copyright (c) 2018, Andrei Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. @@ -23,11 +24,15 @@ CreateDwordField (^BufName, ^MemName._BAS, VarName) \ Add (BCM2836_SOC_REGISTERS, Offset, VarName) =20 -#define EFI_ACPI_OEM_ID {'B','C','2','8','3','6'} //= OEMID 6 bytes long -#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64 ('R','P','I','3= ','E','D','K','2') // OEM table id 8 bytes long -#define EFI_ACPI_OEM_REVISION 0x02000820 -#define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('R','P','I','3= ') -#define EFI_ACPI_CREATOR_REVISION 0x00000097 +#if (RPI_MODEL =3D=3D 3) +#define EFI_ACPI_OEM_ID {'B','C','2','8','3','6'} +#else +#define EFI_ACPI_OEM_ID {'M','C','R','S','F','T'} +#endif +#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64 ('R','P','I','_= ','E','D','K','2') +#define EFI_ACPI_OEM_REVISION 0x00000100 +#define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('E','D','K','2= ') +#define EFI_ACPI_CREATOR_REVISION 0x00000100 =20 #define EFI_ACPI_VENDOR_ID SIGNATURE_32 ('M','S','F','T= ') =20 @@ -49,8 +54,14 @@ #define EFI_ACPI_CSRT_DEVICE_ID_DMA 0x00000009 // Fixed id #define EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP 0x0 // Count up from 0 =20 -#define RPI3_DMA_CHANNEL_COUNT 10 // All 10 DMA channels ar= e listed, including the reserved ones -#define RPI3_DMA_USED_CHANNEL_COUNT 5 // Use 5 DMA channels +#define RPI_DMA_CHANNEL_COUNT 10 // All 10 DMA channels ar= e listed, including the reserved ones +#define RPI_DMA_USED_CHANNEL_COUNT 5 // Use 5 DMA channels + +#if (RPI_MODEL =3D=3D 3) +#define RPI_SYSTEM_TIMER_BASE_ADDRESS 0x4000001C +#elif (RPI_MODEL =3D=3D 4) +#define RPI_SYSTEM_TIMER_BASE_ADDRESS 0xFF80001C +#endif =20 #define EFI_ACPI_5_1_CSRT_REVISION 0x00000000 =20 @@ -100,27 +111,54 @@ typedef struct //------------------------------------------------------------------------ // Interrupts. These are specific to each platform //------------------------------------------------------------------------ +#if (RPI_MODEL =3D=3D 3) +#define BCM2836_V3D_BUS_INTERRUPT 0x2A +#define BCM2836_DMA_INTERRUPT 0x3B +#define BCM2836_SPI1_INTERRUPT 0x3D +#define BCM2836_SPI2_INTERRUPT 0x3D +#define BCM2836_HVS_INTERRUPT 0x41 +#define BCM2836_HDMI0_INTERRUPT 0x48 +#define BCM2836_HDMI1_INTERRUPT 0x49 +#define BCM2836_PV2_INTERRUPT 0x4A +#define BCM2836_PV0_INTERRUPT 0x4D +#define BCM2836_PV1_INTERRUPT 0x4E +#define BCM2836_MBOX_INTERRUPT 0x61 +#define BCM2836_VCHIQ_INTERRUPT 0x62 +#define BCM2386_GPIO_INTERRUPT0 0x51 +#define BCM2386_GPIO_INTERRUPT1 0x53 +#define BCM2836_I2C1_INTERRUPT 0x55 +#define BCM2836_I2C2_INTERRUPT 0x55 +#define BCM2836_SPI0_INTERRUPT 0x56 #define BCM2836_USB_INTERRUPT 0x29 -#define BCM2836_V3D_BUS_INTERRUPT 0x2A -#define BCM2836_DMA_INTERRUPT 0x3B -#define BCM2836_SPI1_INTERRUPT 0x3D -#define BCM2836_SPI2_INTERRUPT 0x3D -#define BCM2836_HVS_INTERRUPT 0x41 -#define BCM2836_HDMI0_INTERRUPT 0x48 -#define BCM2836_HDMI1_INTERRUPT 0x49 -#define BCM2836_PV2_INTERRUPT 0x4A -#define BCM2836_PV0_INTERRUPT 0x4D -#define BCM2836_PV1_INTERRUPT 0x4E -#define BCM2836_MBOX_INTERRUPT 0x61 -#define BCM2836_VCHIQ_INTERRUPT 0x62 -#define BCM2386_GPIO_INTERRUPT0 0x51 -#define BCM2386_GPIO_INTERRUPT1 0x53 -#define BCM2836_I2C1_INTERRUPT 0x55 -#define BCM2836_I2C2_INTERRUPT 0x55 -#define BCM2836_SPI0_INTERRUPT 0x56 #define BCM2836_SDHOST_INTERRUPT 0x58 #define BCM2836_MMCHS1_INTERRUPT 0x5E #define BCM2836_MINI_UART_INTERRUPT 0x3D #define BCM2836_PL011_UART_INTERRUPT 0x59 +#elif (RPI_MODEL =3D=3D 4) +#define BCM2836_V3D_BUS_INTERRUPT 0x2A +#define BCM2836_DMA_INTERRUPT 0x3B +#define BCM2836_SPI1_INTERRUPT 0x3D +#define BCM2836_SPI2_INTERRUPT 0x3D +#define BCM2836_HVS_INTERRUPT 0x41 +#define BCM2836_HDMI0_INTERRUPT 0x48 +#define BCM2836_HDMI1_INTERRUPT 0x49 +#define BCM2836_PV2_INTERRUPT 0x4A +#define BCM2836_PV0_INTERRUPT 0x4D +#define BCM2836_PV1_INTERRUPT 0x4E +#define BCM2836_MBOX_INTERRUPT 0x61 +#define BCM2836_VCHIQ_INTERRUPT 0x62 +#define BCM2386_GPIO_INTERRUPT0 0x51 +#define BCM2386_GPIO_INTERRUPT1 0x53 +#define BCM2836_I2C1_INTERRUPT 0x55 +#define BCM2836_I2C2_INTERRUPT 0x55 +#define BCM2836_SPI0_INTERRUPT 0x56 +#define BCM2836_USB_INTERRUPT 0x69 +#define BCM2836_SDHOST_INTERRUPT 0x98 +#define BCM2836_MMCHS1_INTERRUPT 0x9E +#define BCM2836_MINI_UART_INTERRUPT 0x7D +#define BCM2836_PL011_UART_INTERRUPT 0x99 +#define GENET_INTERRUPT0 0xBD +#define GENET_INTERRUPT1 0xBE +#endif =20 #endif // __ACPITABLES_H__ diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf b/Platform= /RaspberryPi/RPi3/AcpiTables/AcpiTables.inf index 9363660b0ef7..c95d75ed01bb 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf +++ b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf @@ -2,6 +2,7 @@ # # ACPI table data and ASL sources required to boot the platform. # +# Copyright (c) 2019, ARM Limited. All rights reserved. # Copyright (c) 2017, Andrey Warkentin # Copyright (c) Microsoft Corporation. All rights reserved. # @@ -35,15 +36,23 @@ [Sources] [Packages] ArmPkg/ArmPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec - MdePkg/MdePkg.dec EmbeddedPkg/EmbeddedPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Silicon/Broadcom/Bcm27xx/Bcm27xx.dec Silicon/Broadcom/Bcm283x/Bcm283x.dec + Silicon/Broadcom/Drivers/Net/BcmNet.dec =20 [FixedPcd] gArmTokenSpaceGuid.PcdArmArchTimerIntrNum gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum + gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase + gArmTokenSpaceGuid.PcdGicDistributorBase + gBcm27xxTokenSpaceGuid.PcdBcm27xxPciCpuMmioAdr + gBcm27xxTokenSpaceGuid.PcdBcm27xxPciRegBase gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress + gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Csrt.aslc index 0a8393a8076b..03d888fffb8b 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc @@ -2,22 +2,24 @@ * * Core System Resource Table (CSRT) * + * Copyright (c) 2019, ARM Ltd. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * **/ =20 +#include #include =20 #include "AcpiTables.h" =20 -#define DMA_MAX_REQ_LINES 32 +#define RPI_DMA_MAX_REQ_LINES 32 =20 #pragma pack (push, 1) =20 //------------------------------------------------------------------------ -// DMA Controller Vendor Data for RPi3 +// DMA Controller Vendor Data //------------------------------------------------------------------------ typedef struct { @@ -35,7 +37,7 @@ typedef struct } DMA_CONTROLLER_VENDOR_DATA; =20 //------------------------------------------------------------------------ -// DMA Controller on RPi3 +// DMA Controller //------------------------------------------------------------------------ typedef struct { @@ -44,7 +46,7 @@ typedef struct } RD_DMA_CONTROLLER; =20 //------------------------------------------------------------------------ -// DMA Channel Vendor Data for RPi3 +// DMA Channel Vendor Data //------------------------------------------------------------------------ typedef struct { @@ -55,7 +57,7 @@ typedef struct } DMA_CHANNEL_VENDOR_DATA; =20 //------------------------------------------------------------------------ -// DMA Channel on RPi3 +// DMA Channel //------------------------------------------------------------------------ typedef struct { @@ -64,18 +66,18 @@ typedef struct } RD_DMA_CHANNEL; =20 //------------------------------------------------------------------------ -// DMA Resource Group on RPi3 +// DMA Resource Group //------------------------------------------------------------------------ =20 typedef struct { EFI_ACPI_5_1_CSRT_RESOURCE_GROUP_HEADER ResGroupHeader; RD_DMA_CONTROLLER DmaController; - RD_DMA_CHANNEL DmaChannels[RPI3_DMA_CHANNEL_COUNT]; + RD_DMA_CHANNEL DmaChannels[RPI_DMA_CHANNEL_COUNT]; } RG_DMA; =20 //------------------------------------------------------------------------= ---- -// CSRT table structure for RPi3 platform - current revision only includes= DMA +// CSRT table structure - current revision only includes DMA //------------------------------------------------------------------------= ---- typedef struct { @@ -97,8 +99,8 @@ EFI_ACPI_5_1_CSRT_TABLE Csrt =3D sizeof (EFI_ACPI_DESCRIPTION_HEADER) + sizeof (RG_DMA), // Length EFI_ACPI_5_1_CSRT_REVISION, // Revision 0x00, // Checksum calculated at runtime. - EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field "BC28= 36" - EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes lo= ng) "RPI3EDK2" + EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field + EFI_ACPI_OEM_TABLE_ID, // OEM table identification (8 bytes l= ong) EFI_ACPI_OEM_REVISION, // OEM revision number. EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID. EFI_ACPI_CREATOR_REVISION // ASL compiler revision number. @@ -137,13 +139,13 @@ EFI_ACPI_5_1_CSRT_TABLE Csrt =3D sizeof (DMA_CONTROLLER_VENDOR_DATA), // Controller vendor data he= re 1, BCM2836_DMA0_BASE_ADDRESS, // Base address for channels - RPI3_DMA_CHANNEL_COUNT * BCM2836_DMA_CHANNEL_LENGTH, // Base size = =3D Number of channels x channel size + RPI_DMA_CHANNEL_COUNT * BCM2836_DMA_CHANNEL_LENGTH, // Base size = =3D Number of channels x channel size BCM2836_DMA_CTRL_BASE_ADDRESS,// Base address for controller 8, // Base size =3D two registers - RPI3_DMA_USED_CHANNEL_COUNT, + RPI_DMA_USED_CHANNEL_COUNT, 0, // cannot use controller interrupt 0, // Minimum Request Line - DMA_MAX_REQ_LINES - 1, // Maximum Request Line + RPI_DMA_MAX_REQ_LINES - 1, // Maximum Request Line FALSE, }, }, diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Dbg2.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Dbg2.aslc index dcad8e205596..c3d5994f8e97 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Dbg2.aslc +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Dbg2.aslc @@ -23,7 +23,7 @@ #define RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1 #define RPI_DBG2_NAMESPACESTRING_FIELD_SIZE 10 =20 -#ifdef PL011_ENABLE +#if (RPI_MODEL =3D=3D 4) #define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_ARM_PL011_UART #define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART= _BASE_ADDRESS #define RPI_UART_LENGTH BCM2836_PL011_UART= _LENGTH diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl b/Platform/Raspb= erryPi/RPi3/AcpiTables/Dsdt.asl index 1e17ec901042..c2775088b5a2 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl @@ -10,6 +10,7 @@ * **/ =20 +#include #include #include #include @@ -30,6 +31,9 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) { include ("Sdhc.asl") include ("Pep.asl") +#if (RPI_MODEL =3D=3D 4) + include ("Xhci.asl") +#endif =20 Device (CPU0) { @@ -284,6 +288,37 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2"= , 2) } } =20 +#if (RPI_MODEL =3D=3D 4) + Device (ETH0) + { + Name (_HID, "BCM6E4E") + Name (_CID, "BCM6E4E") + Name (_UID, 0x0) + Name (_CCA, 0x0) + Method (_STA) + { + Return (0xf) + } + Method (_CRS, 0x0, Serialized) + { + Name (RBUF, ResourceTemplate () + { + // No need for MEMORY32SETBASE on Genet as we have a straight ba= se address constant + MEMORY32FIXED (ReadWrite, GENET_BASE_ADDRESS, GENET_LENGTH, ) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { GEN= ET_INTERRUPT0, GENET_INTERRUPT1 } + }) + Return (RBUF) + } + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { "brcm,max-dma-burst-size", 0x08 }, + Package () { "phy-mode", "rgmii-rxid" }, + } + }) + } +#endif + // Description: I2C Device (I2C1) { diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Gtdt.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Gtdt.aslc index 0cd6be8cadaa..8453e487fb63 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Gtdt.aslc +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Gtdt.aslc @@ -14,7 +14,6 @@ =20 #include "AcpiTables.h" =20 -#define RPI_SYSTEM_TIMER_BASE_ADDRESS 0x4000001C #define RPI_GTDT_GLOBAL_FLAGS 0 #define RPI_GTDT_GTIMER_FLAGS EFI_ACPI_5_1_GTDT_TIMER_FLAG_TIMER= _INTERRUPT_POLARITY =20 diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Madt.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Madt.aslc index a42ddb8954df..4029cd191ab5 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Madt.aslc +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Madt.aslc @@ -23,7 +23,9 @@ typedef struct { EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header; EFI_ACPI_5_1_GIC_STRUCTURE GicInterfaces[4]; - // Do *NOT* add a GIC Distributor on the Pi 3 or Windows 10 won't boot! +#if (RPI_MODEL !=3D 3) + EFI_ACPI_5_1_GIC_DISTRIBUTOR_STRUCTURE GicDistributor; +#endif } PI_MULTIPLE_APIC_DESCRIPTION_TABLE; =20 #pragma pack () @@ -42,6 +44,7 @@ PI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt =3D { 0, // Flags }, { +#if (RPI_MODEL =3D=3D 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), EFI_ACPI_5_1_GICC_STRUCTURE_INIT( @@ -50,7 +53,24 @@ PI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt =3D { 2, 2, GET_MPID(0, 2), EFI_ACPI_5_1_GIC_ENABLED, 0x09, 0x40000000, = 0, 0, 0, 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 =3D=3D 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 }, +#if (RPI_MODEL !=3D 3) + EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet64 (PcdGicDistributorBas= e), 0) +#endif }; =20 // diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Pep.asl b/Platform/Raspbe= rryPi/RPi3/AcpiTables/Pep.asl index 2ddb27bcdbb3..8a0a44e1c4c9 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Pep.asl +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Pep.asl @@ -2,6 +2,7 @@ * * Platform Extension Plugin (PEP). * + * Copyright (c) 2019, ARM Ltd. All rights reserved. * Copyright (c) 2018, Andrey Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * @@ -12,9 +13,9 @@ Device(PEPD) { // - // RPI3 PEP virtual device. + // PEP virtual device. // - Name (_HID, "BCM2854") // Note: since pep on rpi3 is virtual device, + Name (_HID, "BCM2854") // Note: Since PEP on RPi is a virtual device, Name (_CID, "BCM2854") // its device id needs to be generated by Microso= ft Name (_UID, 0x0) Name (_CRS, ResourceTemplate () diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Pep.c b/Platform/Raspberr= yPi/RPi3/AcpiTables/Pep.c index 51db779d7976..f452580c703d 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Pep.c +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Pep.c @@ -2,6 +2,7 @@ * * PEP device tables * + * Copyright (c) 2019, ARM Ltd. All rights reserved. * Copyright (c) 2018, Andrei Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * @@ -11,7 +12,7 @@ =20 #include "Pep.h" =20 -PEP_PROCESSOR_TABLE_PLAT RPI3Processors =3D { +PEP_PROCESSOR_TABLE_PLAT RpiProcessors =3D { 1, // Version 1, // NumberProcessors { // ProcessorInfo @@ -29,7 +30,7 @@ PEP_PROCESSOR_TABLE_PLAT RPI3Processors =3D { } }; =20 -PEP_COORDINATED_STATE_TABLE_PLAT RPI3CoordinatedStates =3D { +PEP_COORDINATED_STATE_TABLE_PLAT RpiCoordinatedStates =3D { 1, // Version 1, // CoordinatedStateCount { // CordinatedStates[] @@ -51,7 +52,7 @@ PEP_COORDINATED_STATE_TABLE_PLAT RPI3CoordinatedStates = =3D { } }; =20 -PEP_DEVICE_TABLE_PLAT RPI3Devices =3D { +PEP_DEVICE_TABLE_PLAT RpiDevices =3D { 1, // Version 1, // NumberDevices { // DeviceInfo diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Pep.h b/Platform/Raspberr= yPi/RPi3/AcpiTables/Pep.h index f5f04518dec6..30f6768f12a5 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Pep.h +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Pep.h @@ -2,6 +2,7 @@ * * PEP device defines * + * Copyright (c) 2019, ARM Ltd. All rights reserved. * Copyright (c) 2018, Andrei Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * @@ -13,10 +14,10 @@ * Note: Not everything is here. At least SOC_STATE_TYPE is missing. */ =20 -#ifndef _RPI3PEP_H_INCLUDED_ -#define _RPI3PEP_H_INCLUDED_ +#ifndef _RPI_PEP_H_INCLUDED_ +#define _RPI_PEP_H_INCLUDED_ =20 -#include +#include =20 #define PEP_MAX_DEPENDENCIES_PER_STATE 16 #define MAX_PROCESSOR_PATH_LENGTH 16 @@ -117,4 +118,4 @@ typedef struct _PEP_DEVICE_TABLE_PLAT { PEP_DEVICE_INFO_PLAT DeviceInfo[P_NUMBER_DEVICES]; } PEP_DEVICE_TABLE_PLAT, *PPEP_DEVICE_TABLE_PLAT; =20 -#endif // _RPI3PEP_H_INCLUDED_ +#endif // _RPI_PEP_H_INCLUDED_ diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc b/Platform/Rasp= berryPi/RPi3/AcpiTables/Spcr.aslc index cb17fbe0ff2f..bec4ad660ec9 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc @@ -18,7 +18,8 @@ =20 #define RPI_UART_FLOW_CONTROL_NONE 0 =20 -#ifdef PL011_ENABLE +// Prefer PL011 serial output on the Raspberry Pi 4 +#if (RPI_MODEL =3D=3D 4) #define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART #define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART_BASE_ADDRE= SS #define RPI_UART_INTERRUPT BCM2836_PL011_UART_INTERRUPT diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl b/Platform/Raspb= erryPi/RPi3/AcpiTables/Uart.asl index edd8bcc3b376..c466247bb33b 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl @@ -140,7 +140,7 @@ Device(BTH0) // no flow control. 16, // ReceiveBufferSize 16, // TransmitBufferSize -#ifdef PL011_ENABLE +#if (RPI_MODEL =3D=3D 4) "\\_SB.URTM", // ResourceSource: #else "\\_SB.URT0", // ResourceSource: diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Xhci.asl b/Platform/Raspb= erryPi/RPi3/AcpiTables/Xhci.asl new file mode 100644 index 000000000000..0083d1992936 --- /dev/null +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Xhci.asl @@ -0,0 +1,136 @@ +/** @file + * + * Copyright (c) 2019 Linaro, Limited. All rights reserved. + * Copyright (c) 2019 Andrei Warkentin + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + **/ + +#include + +/* + * The following can be used to remove parenthesis from + * defined macros that the compiler complains about. + */ +#define ISOLATE_ARGS(...) __VA_ARGS__ +#define REMOVE_PARENTHESES(x) ISOLATE_ARGS x + +#define SANITIZED_PCIE_CPU_MMIO_WINDOW REMOVE_PARENTHESES(PCIE_CPU_MMIO_W= INDOW) +#define SANITIZED_PCIE_REG_BASE REMOVE_PARENTHESES(PCIE_REG_BASE) + +/* + * According to UEFI boot log for the VLI device on Pi 4. + */ +#define XHCI_REG_LENGTH 0x1000 + +Device (SCB0) { + Name (_HID, "ACPI0004") + Name (_UID, 0x0) + Name (_CCA, 0x0) + + Method (_CRS, 0, Serialized) { // _CRS: Current Resource Settings + /* + * Container devices with _DMA must have _CRS, meaning SCB0 + * to provide all resources that XHC0 consumes (except + * interrupts). + */ + Name (RBUF, ResourceTemplate () { + QWordMemory (ResourceProducer, + , + MinFixed, + MaxFixed, + NonCacheable, + ReadWrite, + 0x0, + SANITIZED_PCIE_CPU_MMIO_WINDOW, // MIN + SANITIZED_PCIE_CPU_MMIO_WINDOW, // MAX + 0x0, + 0x1, // LEN + , + , + MMIO + ) + }) + CreateQwordField (RBUF, MMIO._MAX, MMBE) + CreateQwordField (RBUF, MMIO._LEN, MMLE) + Add (MMBE, XHCI_REG_LENGTH - 1, MMBE) + Add (MMLE, XHCI_REG_LENGTH - 1, MMLE) + Return (RBUF) + } + + Name (_DMA, ResourceTemplate() { + /* + * XHC0 is limited to DMA to first 3GB. Note this + * only applies to PCIe, not GENET or other devices + * next to the A72. + */ + QWordMemory (ResourceConsumer, + , + MinFixed, + MaxFixed, + NonCacheable, + ReadWrite, + 0x0, + 0x0, // MIN + 0xbfffffff, // MAX + 0x0, // TRA + 0xc0000000, // LEN + , + , + ) + }) + + Device (XHC0) + { + Name (_HID, "PNP0D10") // _HID: Hardware ID + Name (_UID, 0x0) // _UID: Unique ID + Name (_CCA, 0x0) // _CCA: Cache Coherency Attribute + + Method (_CRS, 0, Serialized) { // _CRS: Current Resource Settings + Name (RBUF, ResourceTemplate () { + QWordMemory (ResourceConsumer, + , + MinFixed, + MaxFixed, + NonCacheable, + ReadWrite, + 0x0, + SANITIZED_PCIE_CPU_MMIO_WINDOW, // MIN + SANITIZED_PCIE_CPU_MMIO_WINDOW, // MAX + 0x0, + 0x1, // LEN + , + , + MMIO + ) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive,= ,, ) { + 175 + } + }) + CreateQwordField (RBUF, MMIO._MAX, MMBE) + CreateQwordField (RBUF, MMIO._LEN, MMLE) + Add (MMBE, XHCI_REG_LENGTH - 1, MMBE) + Add (MMLE, XHCI_REG_LENGTH - 1, MMLE) + Return (RBUF) + } + + Method (_INI, 0, Serialized) { + OperationRegion (PCFG, SystemMemory, SANITIZED_PCIE_REG_BASE += PCIE_EXT_CFG_DATA, 0x1000) + Field (PCFG, AnyAcc, NoLock, Preserve) { + Offset (0), + VNID, 16, // Vendor ID + DVID, 16, // Device ID + CMND, 16, // Command register + STAT, 16, // Status register + } + + // Set command register to: + // 1) decode MMIO (set bit 1) + // 2) enable DMA (set bit 2) + // 3) enable interrupts (clear bit 10) + Debug =3D "xHCI enable" + Store (0x6, CMND) + } + } +} diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3= /RPi3.dsc index 94d1e5b1c45b..10f02737dce1 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -218,6 +218,10 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] ##########################################################################= ######################### =20 [BuildOptions] + GCC:*_*_*_CC_FLAGS =3D -DRPI_MODEL=3D3 + GCC:*_*_*_ASLPP_FLAGS =3D -DRPI_MODEL=3D3 + GCC:*_*_*_ASLCC_FLAGS =3D -DRPI_MODEL=3D3 + GCC:*_*_*_VFRPP_FLAGS =3D -DRPI_MODEL=3D3 GCC:*_*_AARCH64_DLINK_FLAGS =3D -Wl,--fix-cortex-a53-843419 GCC:RELEASE_*_*_CC_FLAGS =3D -DMDEPKG_NDEBUG -DNDEBUG =20 --=20 2.21.0.windows.1 -=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 (#55077): https://edk2.groups.io/g/devel/message/55077 Mute This Topic: https://groups.io/mt/71605854/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- From nobody Mon May 6 18:15:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55078+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55078+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1582886382; cv=none; d=zohomail.com; s=zohoarc; b=h2MZD3h6Fl48ZJylu/X4o8SxPcDciYKKRE0R+9Um7D634GiwRc2p9IWfN/ocQmtg0LmdrGA4aKChTWjWfyuYGjqwBJ1uRPviMeoGkJKUwIcVUzSE/IoqMmxrG4hc6HDe0uP//h15ybMh+omiPAQR4Pr5JmobA2FuRjyX5t+lvHE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582886382; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=UQ/XUhl/u7LqpyrOx9VBpSbg+UzOd7tqaogDiF3tLzA=; b=hrga0AzSUsD6Uc6/dOqkMhxE8/BhdcLwftDectCOSYAProBico9qdOxMvBmLOL2ohf9U3MQ6GF/CGZQFZRWkqs8t3pQZccNSGorjBaOdF14Qvtc8l8/KoFgPApJqeX+2HAuA6+sulAVMtCudjZmGA0XwIWGSp8TBCDcE9HnrLM4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55078+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582886382438735.0496867906717; Fri, 28 Feb 2020 02:39:42 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id M9GJYY1788612xGqGDfrJwUn; Fri, 28 Feb 2020 02:39:40 -0800 X-Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web11.12290.1582886379551850694 for ; Fri, 28 Feb 2020 02:39:40 -0800 X-Received: by mail-wr1-f68.google.com with SMTP id v4so2362619wrs.8 for ; Fri, 28 Feb 2020 02:39:39 -0800 (PST) X-Gm-Message-State: IjRJPB69oO7nekGZIZSrUh7Zx1787277AA= X-Google-Smtp-Source: APXvYqwDTdtzO0E/aHxhtVgOCadVfida2HVbuThCgPRWshGzxpmiiZPehJThQQ2SHtTxRNgxTWlqfw== X-Received: by 2002:a5d:61cb:: with SMTP id q11mr4425926wrv.71.1582886374947; Fri, 28 Feb 2020 02:39:34 -0800 (PST) X-Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:34 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-devel] [edk2-platforms][PATCH 15/15] Platform/RPi: Factorize ACPI tables Date: Fri, 28 Feb 2020 10:38:55 +0000 Message-Id: <20200228103855.11352-16-pete@akeo.ie> In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 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,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582886380; bh=NSaiaiksy+qr7tmfW7x7Dv7xdoeHPcnKoaWWctbWX2w=; h=Cc:Date:From:Reply-To:Subject:To; b=nNvcAx0AmtkhmL53gwjZANOIZVvKYDQCZ/0flpZF7sEGIIUYjD+32l6n2jwybQWXJcO 8xSoRal3q3PlY1pn3zEphS0A2SUMLLC14zJ1/ssqYJdXY2JoZjU4FnwcMEKKqMWOkycte RFGQjDWdwEYbwE+RMYfhpGBAlrtRI5Kl/uw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" With the ACPI source for the Pi 3 and Pi 4 being identical, we can finally factorize it. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/AcpiTables.h | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/AcpiTables.inf | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Csrt.aslc | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Dbg2.aslc | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Dsdt.asl | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Fadt.aslc | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Gtdt.aslc | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Madt.aslc | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Pep.asl | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Pep.c | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Pep.h | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Rhpx.asl | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Sdhc.asl | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Spcr.aslc | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Uart.asl | 0 Platform/RaspberryPi/{RPi3 =3D> }/AcpiTables/Xhci.asl | 0 Platform/RaspberryPi/RPi3/RPi3.dsc | 2 +- Platform/RaspberryPi/RPi3/RPi3.fdf | 2 +- Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h | 164 ------ Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf | 58 -- Platform/RaspberryPi/RPi4/AcpiTables/Csrt.aslc | 330 ----------= -- Platform/RaspberryPi/RPi4/AcpiTables/Dbg2.aslc | 105 ---- Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl | 569 ----------= ---------- Platform/RaspberryPi/RPi4/AcpiTables/Fadt.aslc | 89 --- Platform/RaspberryPi/RPi4/AcpiTables/Gtdt.aslc | 55 -- Platform/RaspberryPi/RPi4/AcpiTables/Madt.aslc | 80 --- Platform/RaspberryPi/RPi4/AcpiTables/Pep.asl | 90 ---- Platform/RaspberryPi/RPi4/AcpiTables/Pep.c | 79 --- Platform/RaspberryPi/RPi4/AcpiTables/Pep.h | 121 ----- Platform/RaspberryPi/RPi4/AcpiTables/Rhpx.asl | 195 ------- Platform/RaspberryPi/RPi4/AcpiTables/Sdhc.asl | 107 ---- Platform/RaspberryPi/RPi4/AcpiTables/Spcr.aslc | 97 ---- Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl | 163 ------ Platform/RaspberryPi/RPi4/AcpiTables/Xhci.asl | 136 ----- Platform/RaspberryPi/RPi4/RPi4.dsc | 2 +- Platform/RaspberryPi/RPi4/RPi4.fdf | 2 +- 36 files changed, 4 insertions(+), 2442 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h b/Platform/R= aspberryPi/AcpiTables/AcpiTables.h similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h rename to Platform/RaspberryPi/AcpiTables/AcpiTables.h diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf b/Platform= /RaspberryPi/AcpiTables/AcpiTables.inf similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.inf rename to Platform/RaspberryPi/AcpiTables/AcpiTables.inf diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc b/Platform/Rasp= berryPi/AcpiTables/Csrt.aslc similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Csrt.aslc rename to Platform/RaspberryPi/AcpiTables/Csrt.aslc diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Dbg2.aslc b/Platform/Rasp= berryPi/AcpiTables/Dbg2.aslc similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Dbg2.aslc rename to Platform/RaspberryPi/AcpiTables/Dbg2.aslc diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl b/Platform/Raspb= erryPi/AcpiTables/Dsdt.asl similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl rename to Platform/RaspberryPi/AcpiTables/Dsdt.asl diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Fadt.aslc b/Platform/Rasp= berryPi/AcpiTables/Fadt.aslc similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Fadt.aslc rename to Platform/RaspberryPi/AcpiTables/Fadt.aslc diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Gtdt.aslc b/Platform/Rasp= berryPi/AcpiTables/Gtdt.aslc similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Gtdt.aslc rename to Platform/RaspberryPi/AcpiTables/Gtdt.aslc diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Madt.aslc b/Platform/Rasp= berryPi/AcpiTables/Madt.aslc similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Madt.aslc rename to Platform/RaspberryPi/AcpiTables/Madt.aslc diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Pep.asl b/Platform/Raspbe= rryPi/AcpiTables/Pep.asl similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Pep.asl rename to Platform/RaspberryPi/AcpiTables/Pep.asl diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Pep.c b/Platform/Raspberr= yPi/AcpiTables/Pep.c similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Pep.c rename to Platform/RaspberryPi/AcpiTables/Pep.c diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Pep.h b/Platform/Raspberr= yPi/AcpiTables/Pep.h similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Pep.h rename to Platform/RaspberryPi/AcpiTables/Pep.h diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Rhpx.asl b/Platform/Raspb= erryPi/AcpiTables/Rhpx.asl similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Rhpx.asl rename to Platform/RaspberryPi/AcpiTables/Rhpx.asl diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl b/Platform/Raspb= erryPi/AcpiTables/Sdhc.asl similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl rename to Platform/RaspberryPi/AcpiTables/Sdhc.asl diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc b/Platform/Rasp= berryPi/AcpiTables/Spcr.aslc similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc rename to Platform/RaspberryPi/AcpiTables/Spcr.aslc diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl b/Platform/Raspb= erryPi/AcpiTables/Uart.asl similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl rename to Platform/RaspberryPi/AcpiTables/Uart.asl diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Xhci.asl b/Platform/Raspb= erryPi/AcpiTables/Xhci.asl similarity index 100% rename from Platform/RaspberryPi/RPi3/AcpiTables/Xhci.asl rename to Platform/RaspberryPi/AcpiTables/Xhci.asl diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3= /RPi3.dsc index 10f02737dce1..304bc3dfeadf 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -550,7 +550,7 @@ [Components.common] MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf - Platform/RaspberryPi/$(PLATFORM_NAME)/AcpiTables/AcpiTables.inf + Platform/RaspberryPi/AcpiTables/AcpiTables.inf =20 # # SMBIOS Support diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf b/Platform/RaspberryPi/RPi3= /RPi3.fdf index 31730865601f..ec3742c83729 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.fdf +++ b/Platform/RaspberryPi/RPi3/RPi3.fdf @@ -242,7 +242,7 @@ [FV.FvMain] INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphic= sResourceTableDxe.inf - INF RuleOverride =3D ACPITABLE Platform/RaspberryPi/$(PLATFORM_NAME)/Acp= iTables/AcpiTables.inf + INF RuleOverride =3D ACPITABLE Platform/RaspberryPi/AcpiTables/AcpiTable= s.inf =20 # # SMBIOS Support diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h b/Platform/R= aspberryPi/RPi4/AcpiTables/AcpiTables.h deleted file mode 100644 index 0b8a8494450c..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.h +++ /dev/null @@ -1,164 +0,0 @@ -/** @file - * - * RPi defines for constructing ACPI tables - * - * Copyright (c) 2020, Pete Batard - * Copyright (c) 2019, ARM Ltd. All rights reserved. - * Copyright (c) 2018, Andrei Warkentin - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -#ifndef __ACPITABLES_H__ -#define __ACPITABLES_H__ - -#include - -// The ASL compiler can't perform arithmetic on MEMORY32SETBASE () -// parameters so you can't pass a constant like BASE + OFFSET (the -// compiler just silently sets it to zero). So we need a macro that -// can perform arithmetic base address update with an offset. -#define MEMORY32SETBASE(BufName, MemName, VarName, Offset) \ - CreateDwordField (^BufName, ^MemName._BAS, VarName) \ - Add (BCM2836_SOC_REGISTERS, Offset, VarName) - -#if (RPI_MODEL =3D=3D 3) -#define EFI_ACPI_OEM_ID {'B','C','2','8','3','6'} -#else -#define EFI_ACPI_OEM_ID {'M','C','R','S','F','T'} -#endif -#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64 ('R','P','I','_= ','E','D','K','2') -#define EFI_ACPI_OEM_REVISION 0x00000100 -#define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('E','D','K','2= ') -#define EFI_ACPI_CREATOR_REVISION 0x00000100 - -#define EFI_ACPI_VENDOR_ID SIGNATURE_32 ('M','S','F','T= ') - -// A macro to initialise the common header part of EFI ACPI tables as defi= ned by -// EFI_ACPI_DESCRIPTION_HEADER structure. -#define ACPI_HEADER(Signature, Type, Revision) { \ - Signature, /* UINT32 Signature */ \ - sizeof (Type), /* UINT32 Length */ \ - Revision, /* UINT8 Revision */ \ - 0, /* UINT8 Checksum */ \ - EFI_ACPI_OEM_ID, /* UINT8 OemId[6] */ \ - EFI_ACPI_OEM_TABLE_ID, /* UINT64 OemTableId */ \ - EFI_ACPI_OEM_REVISION, /* UINT32 OemRevision */ \ - EFI_ACPI_CREATOR_ID, /* UINT32 CreatorId */ \ - EFI_ACPI_CREATOR_REVISION /* UINT32 CreatorRevision */ \ - } - -#define EFI_ACPI_CSRT_REVISION 0x00000005 -#define EFI_ACPI_CSRT_DEVICE_ID_DMA 0x00000009 // Fixed id -#define EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP 0x0 // Count up from 0 - -#define RPI_DMA_CHANNEL_COUNT 10 // All 10 DMA channels ar= e listed, including the reserved ones -#define RPI_DMA_USED_CHANNEL_COUNT 5 // Use 5 DMA channels - -#if (RPI_MODEL =3D=3D 3) -#define RPI_SYSTEM_TIMER_BASE_ADDRESS 0x4000001C -#elif (RPI_MODEL =3D=3D 4) -#define RPI_SYSTEM_TIMER_BASE_ADDRESS 0xFF80001C -#endif - -#define EFI_ACPI_5_1_CSRT_REVISION 0x00000000 - -typedef enum -{ - EFI_ACPI_CSRT_RESOURCE_TYPE_RESERVED, // 0 - EFI_ACPI_CSRT_RESOURCE_TYPE_INTERRUPT, // 1 - EFI_ACPI_CSRT_RESOURCE_TYPE_TIMER, // 2 - EFI_ACPI_CSRT_RESOURCE_TYPE_DMA, // 3 - EFI_ACPI_CSRT_RESOURCE_TYPE_CACHE, // 4 -} -CSRT_RESOURCE_TYPE; - -typedef enum -{ - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CHANNEL, // 0 - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CONTROLLER // 1 -} -CSRT_DMA_SUBTYPE; - -//------------------------------------------------------------------------ -// CSRT Resource Group header 24 bytes long -//------------------------------------------------------------------------ -typedef struct -{ - UINT32 Length; // Length - UINT32 VendorID; // 4 bytes - UINT32 SubVendorId; // 4 bytes - UINT16 DeviceId; // 2 bytes - UINT16 SubdeviceId; // 2 bytes - UINT16 Revision; // 2 bytes - UINT16 Reserved; // 2 bytes - UINT32 SharedInfoLength; // 4 bytes -} EFI_ACPI_5_1_CSRT_RESOURCE_GROUP_HEADER; - -//------------------------------------------------------------------------ -// CSRT Resource Descriptor 12 bytes total -//------------------------------------------------------------------------ -typedef struct -{ - UINT32 Length; // 4 bytes - UINT16 ResourceType; // 2 bytes - UINT16 ResourceSubType; // 2 bytes - UINT32 UID; // 4 bytes -} EFI_ACPI_5_1_CSRT_RESOURCE_DESCRIPTOR_HEADER; - -//------------------------------------------------------------------------ -// Interrupts. These are specific to each platform -//------------------------------------------------------------------------ -#if (RPI_MODEL =3D=3D 3) -#define BCM2836_V3D_BUS_INTERRUPT 0x2A -#define BCM2836_DMA_INTERRUPT 0x3B -#define BCM2836_SPI1_INTERRUPT 0x3D -#define BCM2836_SPI2_INTERRUPT 0x3D -#define BCM2836_HVS_INTERRUPT 0x41 -#define BCM2836_HDMI0_INTERRUPT 0x48 -#define BCM2836_HDMI1_INTERRUPT 0x49 -#define BCM2836_PV2_INTERRUPT 0x4A -#define BCM2836_PV0_INTERRUPT 0x4D -#define BCM2836_PV1_INTERRUPT 0x4E -#define BCM2836_MBOX_INTERRUPT 0x61 -#define BCM2836_VCHIQ_INTERRUPT 0x62 -#define BCM2386_GPIO_INTERRUPT0 0x51 -#define BCM2386_GPIO_INTERRUPT1 0x53 -#define BCM2836_I2C1_INTERRUPT 0x55 -#define BCM2836_I2C2_INTERRUPT 0x55 -#define BCM2836_SPI0_INTERRUPT 0x56 -#define BCM2836_USB_INTERRUPT 0x29 -#define BCM2836_SDHOST_INTERRUPT 0x58 -#define BCM2836_MMCHS1_INTERRUPT 0x5E -#define BCM2836_MINI_UART_INTERRUPT 0x3D -#define BCM2836_PL011_UART_INTERRUPT 0x59 -#elif (RPI_MODEL =3D=3D 4) -#define BCM2836_V3D_BUS_INTERRUPT 0x2A -#define BCM2836_DMA_INTERRUPT 0x3B -#define BCM2836_SPI1_INTERRUPT 0x3D -#define BCM2836_SPI2_INTERRUPT 0x3D -#define BCM2836_HVS_INTERRUPT 0x41 -#define BCM2836_HDMI0_INTERRUPT 0x48 -#define BCM2836_HDMI1_INTERRUPT 0x49 -#define BCM2836_PV2_INTERRUPT 0x4A -#define BCM2836_PV0_INTERRUPT 0x4D -#define BCM2836_PV1_INTERRUPT 0x4E -#define BCM2836_MBOX_INTERRUPT 0x61 -#define BCM2836_VCHIQ_INTERRUPT 0x62 -#define BCM2386_GPIO_INTERRUPT0 0x51 -#define BCM2386_GPIO_INTERRUPT1 0x53 -#define BCM2836_I2C1_INTERRUPT 0x55 -#define BCM2836_I2C2_INTERRUPT 0x55 -#define BCM2836_SPI0_INTERRUPT 0x56 -#define BCM2836_USB_INTERRUPT 0x69 -#define BCM2836_SDHOST_INTERRUPT 0x98 -#define BCM2836_MMCHS1_INTERRUPT 0x9E -#define BCM2836_MINI_UART_INTERRUPT 0x7D -#define BCM2836_PL011_UART_INTERRUPT 0x99 -#define GENET_INTERRUPT0 0xBD -#define GENET_INTERRUPT1 0xBE -#endif - -#endif // __ACPITABLES_H__ diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf b/Platform= /RaspberryPi/RPi4/AcpiTables/AcpiTables.inf deleted file mode 100644 index c95d75ed01bb..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf +++ /dev/null @@ -1,58 +0,0 @@ -#/** @file -# -# ACPI table data and ASL sources required to boot the platform. -# -# Copyright (c) 2019, ARM Limited. All rights reserved. -# Copyright (c) 2017, Andrey Warkentin -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -#**/ - -[Defines] - INF_VERSION =3D 0x0001001A - BASE_NAME =3D AcpiTables - FILE_GUID =3D 7E374E25-8E01-4FEE-87F2-390C23C606CD - MODULE_TYPE =3D USER_DEFINED - VERSION_STRING =3D 1.0 - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D AARCH64 -# - -[Sources] - AcpiTables.h - Madt.aslc - Fadt.aslc - Dbg2.aslc - Gtdt.aslc - Dsdt.asl - Csrt.aslc - Spcr.aslc - -[Packages] - ArmPkg/ArmPkg.dec - ArmPlatformPkg/ArmPlatformPkg.dec - EmbeddedPkg/EmbeddedPkg.dec - MdeModulePkg/MdeModulePkg.dec - MdePkg/MdePkg.dec - Silicon/Broadcom/Bcm27xx/Bcm27xx.dec - Silicon/Broadcom/Bcm283x/Bcm283x.dec - Silicon/Broadcom/Drivers/Net/BcmNet.dec - -[FixedPcd] - gArmTokenSpaceGuid.PcdArmArchTimerIntrNum - gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum - gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum - gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum - gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase - gArmTokenSpaceGuid.PcdGicDistributorBase - gBcm27xxTokenSpaceGuid.PcdBcm27xxPciCpuMmioAdr - gBcm27xxTokenSpaceGuid.PcdBcm27xxPciRegBase - gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress - gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate - gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Csrt.aslc b/Platform/Rasp= berryPi/RPi4/AcpiTables/Csrt.aslc deleted file mode 100644 index 03d888fffb8b..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Csrt.aslc +++ /dev/null @@ -1,330 +0,0 @@ -/** @file - * - * Core System Resource Table (CSRT) - * - * Copyright (c) 2019, ARM Ltd. All rights reserved. - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -#include -#include - -#include "AcpiTables.h" - -#define RPI_DMA_MAX_REQ_LINES 32 - -#pragma pack (push, 1) - -//------------------------------------------------------------------------ -// DMA Controller Vendor Data -//------------------------------------------------------------------------ -typedef struct -{ - UINT32 Length; - UINT32 Type; - UINT64 ChannelsBaseAddress; - UINT32 ChannelsBaseSize; - UINT64 ControllerBaseAddress; - UINT32 ControllerBaseSize; - UINT32 ChannelCount; - UINT32 ControllerInterrupt; - UINT32 MinimumRequestLine; - UINT32 MaximumRequestLine; - BOOLEAN CacheCoherent; -} DMA_CONTROLLER_VENDOR_DATA; - -//------------------------------------------------------------------------ -// DMA Controller -//------------------------------------------------------------------------ -typedef struct -{ - EFI_ACPI_5_1_CSRT_RESOURCE_DESCRIPTOR_HEADER DmaControllerHeader; - DMA_CONTROLLER_VENDOR_DATA ControllerVendorData; -} RD_DMA_CONTROLLER; - -//------------------------------------------------------------------------ -// DMA Channel Vendor Data -//------------------------------------------------------------------------ -typedef struct -{ - UINT32 ChannelNumber; - UINT32 ChannelInterrupt; - UINT16 IsReservedChannel; - UINT16 NoSrcNoDestAddrIncr; -} DMA_CHANNEL_VENDOR_DATA; - -//------------------------------------------------------------------------ -// DMA Channel -//------------------------------------------------------------------------ -typedef struct -{ - EFI_ACPI_5_1_CSRT_RESOURCE_DESCRIPTOR_HEADER DmaChannelHeader; - DMA_CHANNEL_VENDOR_DATA ChannelVendorData; -} RD_DMA_CHANNEL; - -//------------------------------------------------------------------------ -// DMA Resource Group -//------------------------------------------------------------------------ - -typedef struct -{ - EFI_ACPI_5_1_CSRT_RESOURCE_GROUP_HEADER ResGroupHeader; - RD_DMA_CONTROLLER DmaController; - RD_DMA_CHANNEL DmaChannels[RPI_DMA_CHANNEL_COUNT]; -} RG_DMA; - -//------------------------------------------------------------------------= ---- -// CSRT table structure - current revision only includes DMA -//------------------------------------------------------------------------= ---- -typedef struct -{ -// Standard ACPI Header - EFI_ACPI_DESCRIPTION_HEADER CsrtHeader; - -// DMA Resource Group - RG_DMA DmaResourceGroup; - -} EFI_ACPI_5_1_CSRT_TABLE; - -EFI_ACPI_5_1_CSRT_TABLE Csrt =3D -{ - //----------------------------------------------------------------------= -- - // ACPI Table Header - //----------------------------------------------------------------------= -- - { - EFI_ACPI_5_1_CORE_SYSTEM_RESOURCE_TABLE_SIGNATURE, // Signature = "CSRT" - sizeof (EFI_ACPI_DESCRIPTION_HEADER) + sizeof (RG_DMA), // Length - EFI_ACPI_5_1_CSRT_REVISION, // Revision - 0x00, // Checksum calculated at runtime. - EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field - EFI_ACPI_OEM_TABLE_ID, // OEM table identification (8 bytes l= ong) - EFI_ACPI_OEM_REVISION, // OEM revision number. - EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID. - EFI_ACPI_CREATOR_REVISION // ASL compiler revision number. - }, - - //----------------------------------------------------------------------= -- - // DMA Resource Group - //----------------------------------------------------------------------= -- - { - - //--------------------------------------------------------------------= ---- - // DMA Resource Group Header - //--------------------------------------------------------------------= ---- - { - sizeof (RG_DMA), // Resource Group Length - EFI_ACPI_VENDOR_ID, // VendorId - 0, // SubvendorId - EFI_ACPI_CSRT_DEVICE_ID_DMA, // DeviceId 9 - 0, // SubdeviceId - 0, // Revision - 0, // Reserved - 0 // SharedInfoLength - }, - - //--------------------------------------------------------------------= ----------- - // Resource Descriptor - DMA Controller - //--------------------------------------------------------------------= ----------- - { - { - sizeof (RD_DMA_CONTROLLER), // Length of this R= esource Descriptor - EFI_ACPI_CSRT_RESOURCE_TYPE_DMA, // Type for this re= source 3=3DDMA - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CONTROLLER, // Subtype for this= resource 1=3DDMA Controller - EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP + 0, // ResourceId - 1= st DMA controller - }, - { - sizeof (DMA_CONTROLLER_VENDOR_DATA), // Controller vendor data he= re - 1, - BCM2836_DMA0_BASE_ADDRESS, // Base address for channels - RPI_DMA_CHANNEL_COUNT * BCM2836_DMA_CHANNEL_LENGTH, // Base size = =3D Number of channels x channel size - BCM2836_DMA_CTRL_BASE_ADDRESS,// Base address for controller - 8, // Base size =3D two registers - RPI_DMA_USED_CHANNEL_COUNT, - 0, // cannot use controller interrupt - 0, // Minimum Request Line - RPI_DMA_MAX_REQ_LINES - 1, // Maximum Request Line - FALSE, - }, - }, - - //--------------------------------------------------------------------= ---- - // Resource Descriptor(s) - DMA Channels 0 to n-1 - //--------------------------------------------------------------------= ---- - { - - // Channel 0 - { - { - sizeof (RD_DMA_CHANNEL), // Length of this Re= source Descriptor - EFI_ACPI_CSRT_RESOURCE_TYPE_DMA, // Type for this res= ource 3=3DDMA - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CHANNEL, // Subtype for this = resource 0=3DDMA Channel - EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP + 1, // ResourceId - }, - { - 0, // Channel vendor data here - 0x30, // 16+32 dma_int[0] - 0, - 0 - }, - }, - - // Channel 1 reserved - { - { - sizeof (RD_DMA_CHANNEL), - EFI_ACPI_CSRT_RESOURCE_TYPE_DMA, - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CHANNEL, - EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP + 2, // ResourceId - }, - { - 1, // Channel vendor data here - 0x31, // 17+32 dma_int[1] - 1, - 0 - }, - }, - - // Channel 2 - VC4 use only - { - { - sizeof (RD_DMA_CHANNEL), - EFI_ACPI_CSRT_RESOURCE_TYPE_DMA, - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CHANNEL, - EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP + 3, // ResourceId - }, - { - 2, // Channel vendor data here - 0x32, // 18+32 dma_int[2] - 1, - 0 - }, - }, - - // Channel 3 - VC4 use only - { - { - sizeof (RD_DMA_CHANNEL), - EFI_ACPI_CSRT_RESOURCE_TYPE_DMA, - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CHANNEL, - EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP + 4, - }, - { - 3, // Channel vendor data here - 0x33, // 19+32 dma_int[3] - 1, - 0 - }, - }, - - // channel 4 - { - { - sizeof (RD_DMA_CHANNEL), - EFI_ACPI_CSRT_RESOURCE_TYPE_DMA, - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CHANNEL, - EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP + 5, - }, - { - 4, // Channel vendor data here - 0x34, // 20+32 dma_int[4] - 0, - 1 // SD host controller candidate - }, - }, - - // Channel 5 - { - { - sizeof (RD_DMA_CHANNEL), - EFI_ACPI_CSRT_RESOURCE_TYPE_DMA, - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CHANNEL, - EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP + 6, - }, - { - 5, // Channel vendor data here - 0x35, // 21+32 dma_int[5] - 0, - 0 - }, - }, - - // Channel 6 is reserved - { - { - sizeof (RD_DMA_CHANNEL), - EFI_ACPI_CSRT_RESOURCE_TYPE_DMA, - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CHANNEL, - EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP + 7, - }, - { - 6, // Channel vendor data here - 0x36, // 22+32 dma_int[6] - 1, - 0 - }, - }, - - // Channel 7 is reserved - { - { - sizeof (RD_DMA_CHANNEL), - EFI_ACPI_CSRT_RESOURCE_TYPE_DMA, - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CHANNEL, - EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP + 8, - }, - { - 7, // Channel vendor data here - 0x37, // 23+32 dma_int[7] - 1, - 0 - }, - }, - - // Channel 8 - { - { - sizeof (RD_DMA_CHANNEL), - EFI_ACPI_CSRT_RESOURCE_TYPE_DMA, - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CHANNEL, - EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP + 9, - }, - { - 8, // Channel vendor data here - 0x38, // 24+32 dma_int[8] - 0, - 0 - }, - }, - - // Channel 9 - { - { - sizeof (RD_DMA_CHANNEL), - EFI_ACPI_CSRT_RESOURCE_TYPE_DMA, - EFI_ACPI_CSRT_RESOURCE_SUBTYPE_DMA_CHANNEL, - EFI_ACPI_CSRT_RESOURCE_ID_IN_DMA_GRP + 10, - }, - { - 9, // channel vendor data here - 0x39, // 25+32 dma_int[9] - 0, - 0 - }, - } - - } // End DMA Channels 0 to 14 - - } // End DMA Resource group - -}; - -#pragma pack(pop) - -// -// Reference the table being generated to prevent the optimizer from remov= ing the -// data structure from the executable -// -VOID* CONST ReferenceAcpiTable =3D &Csrt; diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Dbg2.aslc b/Platform/Rasp= berryPi/RPi4/AcpiTables/Dbg2.aslc deleted file mode 100644 index c3d5994f8e97..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Dbg2.aslc +++ /dev/null @@ -1,105 +0,0 @@ -/** @file - * - * Debug Port Table (DBG2) - * - * Copyright (c) 2019, Pete Batard - * Copyright (c) 2012-2016, ARM Limited. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -#include -#include -#include -#include -#include - -#include "AcpiTables.h" - -#pragma pack(1) - -#define RPI_DBG2_NUM_DEBUG_PORTS 1 -#define RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1 -#define RPI_DBG2_NAMESPACESTRING_FIELD_SIZE 10 - -#if (RPI_MODEL =3D=3D 4) -#define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_ARM_PL011_UART -#define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART= _BASE_ADDRESS -#define RPI_UART_LENGTH BCM2836_PL011_UART= _LENGTH -#define RPI_UART_STR { '\\', '_', 'S', = 'B', '.', 'U', 'R', 'T', '0', 0x00 } -#else -#define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_BCM2835_UART -#define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_= BASE_ADDRESS -#define RPI_UART_LENGTH BCM2836_MINI_UART_= LENGTH -// -// RPI_UART_STR should match the value used Uart.asl -// -#define RPI_UART_STR { '\\', '_', 'S', = 'B', '.', 'U', 'R', 'T', 'M', 0x00 } -#endif - -typedef struct { - EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device; - EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE BaseAddressRegiste= r; - UINT32 AddressSize; - UINT8 NameSpaceString[RP= I_DBG2_NAMESPACESTRING_FIELD_SIZE]; -} DBG2_DEBUG_DEVICE_INFORMATION; - -typedef struct { - EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE Description; - DBG2_DEBUG_DEVICE_INFORMATION Dbg2DeviceInfo[RPI= _DBG2_NUM_DEBUG_PORTS]; -} DBG2_TABLE; - - -#define DBG2_DEBUG_PORT_DDI(NumReg, SubType, UartBase, UartAddrLen, UartNa= meStr) { \ - { = \ - EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, /* U= INT8 Revision */ \ - sizeof (DBG2_DEBUG_DEVICE_INFORMATION), /* U= INT16 Length */ \ - NumReg, /* U= INT8 NumberofGenericAddressRegisters */ \ - RPI_DBG2_NAMESPACESTRING_FIELD_SIZE, /* U= INT16 NameSpaceStringLength */ \ - OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, NameSpaceString), /* U= INT16 NameSpaceStringOffset */ \ - 0, /* U= INT16 OemDataLength */ \ - 0, /* U= INT16 OemDataOffset */ \ - EFI_ACPI_DBG2_PORT_TYPE_SERIAL, /* U= INT16 Port Type */ \ - SubType, /* U= INT16 Port Subtype */ \ - {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, /* U= INT8 Reserved[2] */ \ - OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister), /* U= INT16 BaseAddressRegister Offset */ \ - OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize) /* U= INT16 AddressSize Offset */ \ - }, = \ - ARM_GAS32 (UartBase), /* EFI_ACPI_5_1_GENER= IC_ADDRESS_STRUCTURE BaseAddressRegister */ \ - UartAddrLen, /* UINT32 AddressSiz= e */ \ - UartNameStr /* UINT8 NameSpaceS= tring[MAX_DBG2_NAME_LEN] */ \ - } - - -STATIC DBG2_TABLE Dbg2 =3D { - { - ACPI_HEADER ( - EFI_ACPI_5_1_DEBUG_PORT_2_TABLE_SIGNATURE, - DBG2_TABLE, - EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION - ), - OFFSET_OF (DBG2_TABLE, Dbg2DeviceInfo), - RPI_DBG2_NUM_DEBUG_PORTS /* U= INT32 NumberDbgDeviceInfo */ - }, - { - /* - * Kernel Debug Port - */ - DBG2_DEBUG_PORT_DDI ( - RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS, - RPI_UART_INTERFACE_TYPE, - RPI_UART_BASE_ADDRESS, - RPI_UART_LENGTH, - RPI_UART_STR - ), - } -}; - -#pragma pack() - -// -// Reference the table being generated to prevent the optimizer from remov= ing -// the data structure from the executable -// -VOID* CONST ReferenceAcpiTable =3D &Dbg2; diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Dsdt.asl deleted file mode 100644 index c2775088b5a2..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Dsdt.asl +++ /dev/null @@ -1,569 +0,0 @@ -/** @file - * - * Differentiated System Definition Table (DSDT) - * - * Copyright (c) 2020, Pete Batard - * Copyright (c) 2018, Andrey Warkentin - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -#include -#include -#include -#include -#include - -#include "AcpiTables.h" - -#define BCM_ALT0 0x4 -#define BCM_ALT1 0x5 -#define BCM_ALT2 0x6 -#define BCM_ALT3 0x7 -#define BCM_ALT4 0x3 -#define BCM_ALT5 0x2 - -DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) -{ - Scope (\_SB_) - { - include ("Sdhc.asl") - include ("Pep.asl") -#if (RPI_MODEL =3D=3D 4) - include ("Xhci.asl") -#endif - - Device (CPU0) - { - Name (_HID, "ACPI0007") - Name (_UID, 0x0) - Method (_STA) - { - Return (0xf) - } - } - - Device (CPU1) - { - Name (_HID, "ACPI0007") - Name (_UID, 0x1) - Method (_STA) - { - Return (0xf) - } - } - - Device (CPU2) - { - Name (_HID, "ACPI0007") - Name (_UID, 0x2) - Method (_STA) - { - Return (0xf) - } - } - - Device (CPU3) - { - Name (_HID, "ACPI0007") - Name (_UID, 0x3) - Method (_STA) - { - Return (0xf) - } - } - - // DWC OTG Controller - Device (USB0) - { - Name (_HID, "BCM2848") - Name (_CID, Package() { "DWC_OTG", "DWC2_OTG"}) - Name (_UID, 0x0) - Name (_CCA, 0x0) - Method (_STA) - { - Return (0xf) - } - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0, BCM2836_USB_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_USB_INTERRUPT } - }) - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_USB_OFFSET) - Return (^RBUF) - } - } - - // Video Core 4 GPU - Device (GPU0) - { - Name (_HID, "BCM2850") - Name (_CID, "VC4") - Name (_UID, 0x0) - Name (_CCA, 0x0) - Method (_STA) - { - Return(0xf) - } - Name (RBUF, ResourceTemplate () - { - // Memory and interrupt for the GPU - MEMORY32FIXED (ReadWrite, 0, BCM2836_V3D_BUS_LENGTH, RM01) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_V3D_BUS_INTERRUPT } - - // HVS - Hardware Video Scalar - MEMORY32FIXED (ReadWrite, 0, BCM2836_HVS_LENGTH, RM02) - // The HVS interrupt is reserved by the VPU - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_HVS_INTERRUPT } - - // PixelValve0 - DSI0 or DPI - // MEMORY32FIXED (ReadWrite, BCM2836_PV0_BASE_ADDRESS, BCM2836_PV0= _LENGTH, RM03) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_PV0_INTERRUPT } - - // PixelValve1 - DS1 or SMI - // MEMORY32FIXED (ReadWrite, BCM2836_PV1_BASE_ADDRESS, BCM2836_PV1= _LENGTH, RM04) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_PV1_INTERRUPT } - - // PixelValve2 - HDMI output - connected to HVS display FIFO 1 - MEMORY32FIXED (ReadWrite, 0, BCM2836_PV2_LENGTH, RM05) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_PV2_INTERRUPT } - - // HDMI registers - MEMORY32FIXED (ReadWrite, 0, BCM2836_HDMI0_LENGTH, RM06) - MEMORY32FIXED (ReadWrite, 0, BCM2836_HDMI1_LENGTH, RM07) - // hdmi_int[0] - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_HDMI0_INTERRUPT } - // hdmi_int[1] - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BC= M2836_HDMI1_INTERRUPT } - - // HDMI DDC connection - I2CSerialBus (0x50,, 100000,, "\\_SB.I2C2",,,,) // EDID - I2CSerialBus (0x30,, 100000,, "\\_SB.I2C2",,,,) // E-DDC Segment = Pointer - }) - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RM01, RB01, BCM2836_V3D_BUS_OFFSET) - MEMORY32SETBASE (RBUF, RM02, RB02, BCM2836_HVS_OFFSET) - MEMORY32SETBASE (RBUF, RM05, RB05, BCM2836_PV2_OFFSET) - MEMORY32SETBASE (RBUF, RM06, RB06, BCM2836_HDMI0_OFFSET) - MEMORY32SETBASE (RBUF, RM07, RB07, BCM2836_HDMI1_OFFSET) - Return (^RBUF) - } - - // GPU Power Management Component Data - // Reference : https://github.com/Microsoft/graphics-driver-samples/= wiki/Install-Driver-in-a-Windows-VM - Method (PMCD, 0, Serialized) - { - Name (RBUF, Package () - { - 1, // Version - 1, // Number of graphics power components - Package () // Power components package - { - Package () // GPU component package - { - 0, // Component Index - 0, // DXGK_POWER_COMPONENT_MAPPING.ComponentTyp= e (0 =3D DXGK_POWER_COMPONENT_ENGINE) - 0, // DXGK_POWER_COMPONENT_MAPPING.NodeIndex - - Buffer () // DXGK_POWER_RUNTIME_COMPONENT.ComponentGuid - { // 9B2D1E26-1575-4747-8FC0-B9EB4BAA2D2B - 0x26, 0x1E, 0x2D, 0x9B, 0x75, 0x15, 0x47, 0x47, - 0x8f, 0xc0, 0xb9, 0xeb, 0x4b, 0xaa, 0x2d, 0x2b - }, - - "VC4_Engine_00",// DXGK_POWER_RUNTIME_COMPONENT.ComponentName - 2, // DXGK_POWER_RUNTIME_COMPONENT.StateCount - - Package () // DXGK_POWER_RUNTIME_COMPONENT.States[] pac= kage - { - Package () // F0 - { - 0, // DXGK_POWER_RUNTIME_STATE.TransitionLatency - 0, // DXGK_POWER_RUNTIME_STATE.ResidencyRequirem= ent - 1210000, // DXGK_POWER_RUNTIME_STATE.NominalPower (mic= rowatt) - }, - - Package () // F1 - Placeholder - { - 10000, // DXGK_POWER_RUNTIME_STATE.TransitionLatency - 10000, // DXGK_POWER_RUNTIME_STATE.ResidencyRequirem= ent - 4, // DXGK_POWER_RUNTIME_STATE.NominalPower - }, - } - } - } - }) - Return (RBUF) - } - } - - // PiQ Mailbox Driver - Device (RPIQ) - { - Name (_HID, "BCM2849") - Name (_CID, "RPIQ") - Name (_UID, 0) - Name (_CCA, 0x0) - Method (_STA) - { - Return (0xf) - } - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0, BCM2836_MBOX_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_MBOX_INTERRUPT } - }) - - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_MBOX_OFFSET) - Return (^RBUF) - } - } - - // VCHIQ Driver - Device (VCIQ) - { - Name (_HID, "BCM2835") - Name (_CID, "VCIQ") - Name (_UID, 0) - Name (_CCA, 0x0) - Name (_DEP, Package() { \_SB.RPIQ }) - Method (_STA) - { - Return (0xf) - } - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0, BCM2836_VCHIQ_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_VCHIQ_INTERRUPT } - }) - - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_VCHIQ_OFFSET) - Return (^RBUF) - } - } - - // VC Shared Memory Driver - Device (VCSM) - { - Name (_HID, "BCM2856") - Name (_CID, "VCSM") - Name (_UID, 0) - Name (_CCA, 0x0) - Name (_DEP, Package() { \_SB.VCIQ }) - Method (_STA) - { - Return (0xf) - } - } - - // Description: GPIO - Device (GPI0) - { - Name (_HID, "BCM2845") - Name (_CID, "BCMGPIO") - Name (_UID, 0x0) - Name (_CCA, 0x0) - Method (_STA) - { - Return(0xf) - } - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0, GPIO_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2386_= GPIO_INTERRUPT0, BCM2386_GPIO_INTERRUPT1 } - }) - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, GPIO_OFFSET) - Return (^RBUF) - } - } - -#if (RPI_MODEL =3D=3D 4) - Device (ETH0) - { - Name (_HID, "BCM6E4E") - Name (_CID, "BCM6E4E") - Name (_UID, 0x0) - Name (_CCA, 0x0) - Method (_STA) - { - Return (0xf) - } - Method (_CRS, 0x0, Serialized) - { - Name (RBUF, ResourceTemplate () - { - // No need for MEMORY32SETBASE on Genet as we have a straight ba= se address constant - MEMORY32FIXED (ReadWrite, GENET_BASE_ADDRESS, GENET_LENGTH, ) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { GEN= ET_INTERRUPT0, GENET_INTERRUPT1 } - }) - Return (RBUF) - } - Name (_DSD, Package () { - ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "brcm,max-dma-burst-size", 0x08 }, - Package () { "phy-mode", "rgmii-rxid" }, - } - }) - } -#endif - - // Description: I2C - Device (I2C1) - { - Name (_HID, "BCM2841") - Name (_CID, "BCMI2C") - Name (_UID, 0x1) - Name (_CCA, 0x0) - Method (_STA) - { - Return(0xf) - } - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C1_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_= I2C1_INTERRUPT } - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", = 0, ResourceConsumer,) {2, 3} - // - VendorLong () // Length =3D 0x31 - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1D, 0x00, 0x01, 0x10, 0x00, 0x01, // = /....... - /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x16, 0x00, 0x20, // = ........ - /* 0020 */ 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x5C, // = ........ - /* 0028 */ 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, // = _SB.GPI0 - /* 0030 */ 0x00 // . - } - }) - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_I2C1_OFFSET) - Return (^RBUF) - } - } - - // I2C2 is the HDMI DDC connection - Device (I2C2) - { - Name (_HID, "BCM2841") - Name (_CID, "BCMI2C") - Name (_UID, 0x2) - Name (_CCA, 0x0) - Method (_STA) - { - Return (0xf) - } - Name (RBUF, ResourceTemplate() - { - MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C2_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_= I2C2_INTERRUPT } - }) - - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_I2C2_OFFSET) - Return (^RBUF) - } - } - - // SPI - Device (SPI0) - { - Name (_HID, "BCM2838") - Name (_CID, "BCMSPI0") - Name (_UID, 0x0) - Name (_CCA, 0x0) - Method (_STA) - { - Return (0xf) - } - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI0_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_= SPI0_INTERRUPT } - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig (Exclusive, PullDown, BCM_ALT0, "\\_SB.GPI0"= , 0, ResourceConsumer, ) {9, 10, 11} // MISO, MOSI, SCLK - VendorLong () // Length =3D 0x33 - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1F, 0x00, 0x01, 0x10, 0x00, 0x02, // = /....... - /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, // = ......." - /* 0020 */ 0x00, 0x00, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0B, // = ........ - /* 0028 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, // = .\_SB.GP - /* 0030 */ 0x49, 0x30, 0x00 // = I0. - } - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", = 0, ResourceConsumer, ) {8} // CE0 - VendorLong () // Length =3D 0x2F - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x01, // = /....... - /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, // = ........ - /* 0020 */ 0x00, 0x00, 0x00, 0x08, 0x00, 0x5C, 0x5F, 0x53, // = .....\_S - /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 // = B.GPI0. - } - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", = 0, ResourceConsumer, ) {7} // CE1 - VendorLong () // Length =3D 0x2F - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x01, // = /....... - /* 0018 */ 0x04, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, // = ........ - /* 0020 */ 0x00, 0x00, 0x00, 0x07, 0x00, 0x5C, 0x5F, 0x53, // = .....\_S - /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 // = B.GPI0. - } - }) - - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_SPI0_OFFSET) - Return (^RBUF) - } - } - - Device (SPI1) - { - Name (_HID, "BCM2839") - Name (_CID, "BCMAUXSPI") - Name (_UID, 0x1) - Name (_CCA, 0x0) - Name (_DEP, Package() { \_SB.RPIQ }) - Method (_STA) - { - Return (0xf) - } - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI1_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { BCM2836= _SPI1_INTERRUPT } - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0",= 0, ResourceConsumer, ) {19, 20, 21} // MISO, MOSI, SCLK - VendorLong () // Length =3D 0x33 - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1F, 0x00, 0x01, 0x10, 0x00, 0x02, // = /....... - /* 0018 */ 0x03, 0x00, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, // = ......." - /* 0020 */ 0x00, 0x00, 0x00, 0x13, 0x00, 0x14, 0x00, 0x15, // = ........ - /* 0028 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, // = .\_SB.GP - /* 0030 */ 0x49, 0x30, 0x00 // = I0. - } - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0",= 0, ResourceConsumer, ) {16} // CE2 - VendorLong () // Length =3D 0x2F - { - /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // = .`D....` - /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // = J...-#0. - /* 0010 */ 0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x02, // = /....... - /* 0018 */ 0x03, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, // = ........ - /* 0020 */ 0x00, 0x00, 0x00, 0x10, 0x00, 0x5C, 0x5F, 0x53, // = .....\_S - /* 0028 */ 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00 // = B.GPI0. - } - }) - - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_SPI1_OFFSET) - Return (^RBUF) - } - } - - // SPI2 has no pins on GPIO header - // Device (SPI2) - // { - // Name (_HID, "BCM2839") - // Name (_CID, "BCMAUXSPI") - // Name (_UID, 0x2) - // Name (_CCA, 0x0) - // Name (_DEP, Package() { \_SB.RPIQ }) - // Method (_STA) - // { - // Return (0xf) // Disabled - // } - // Method (_CRS, 0x0, Serialized) - // { - // Name (RBUF, ResourceTemplate () - // { - // MEMORY32FIXED (ReadWrite, BCM2836_SPI2_BASE_ADDRESS, BCM2836_= SPI2_LENGTH, RMEM) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { BC= M2836_SPI2_INTERRUPT } - // }) - // Return (RBUF) - // } - // } - - // PWM Driver - Device (PWM0) - { - Name (_HID, "BCM2844") - Name (_CID, "BCM2844") - Name (_UID, 0) - Name (_CCA, 0x0) - Method (_STA) - { - Return (0xf) - } - Name (RBUF, ResourceTemplate () - { - // DMA channel 11 control - MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_DMA_LENGTH, RM01) - // PWM control - MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_CTRL_LENGTH, RM02) - // PWM control bus - MEMORY32FIXED (ReadWrite, BCM2836_PWM_BUS_BASE_ADDRESS, BCM2836_PW= M_BUS_LENGTH, ) - // PWM control uncached - MEMORY32FIXED (ReadWrite, BCM2836_PWM_CTRL_UNCACHED_BASE_ADDRESS, = BCM2836_PWM_CTRL_UNCACHED_LENGTH, ) - // PWM clock control - MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_CLK_LENGTH, RM03) - // Interrupt DMA channel 11 - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM28= 36_DMA_INTERRUPT } - // DMA channel 11, DREQ 5 for PWM - FixedDMA (5, 11, Width32Bit, ) - }) - - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RM01, RB01, BCM2836_PWM_DMA_OFFSET) - MEMORY32SETBASE (RBUF, RM02, RB02, BCM2836_PWM_CTRL_OFFSET) - MEMORY32SETBASE (RBUF, RM03, RB03, BCM2836_PWM_CLK_OFFSET) - Return (^RBUF) - } - } - - include ("Uart.asl") - include ("Rhpx.asl") - } -} diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Fadt.aslc b/Platform/Rasp= berryPi/RPi4/AcpiTables/Fadt.aslc deleted file mode 100644 index ebf58fb7fc3c..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Fadt.aslc +++ /dev/null @@ -1,89 +0,0 @@ -/** @file - * - * Fixed ACPI Description Table (FADT) - * - * Copyright (c) 2019, Pete Batard - * Copyright (c) 2018, Andrey Warkentin - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -#include -#include -#include - -#include "AcpiTables.h" - -/* - * Note: Use ACPI 5.1 since we need to match MADT ACPI requirements - */ -EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE Fadt =3D { - 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 - 0, = // UINT32 Dsdt - 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 - 0, = // UINT8 PmTmrLen - 0, = // UINT8 Gpe0BlkLen - 0, = // UINT8 Gpe1BlkLen - 0, = // UINT8 Gpe1Base - 0, = // UINT8 CstCnt - 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_RESERVED_WORD, = // UINT16 IaPcBootArch (Reserved on ARM) - 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 - 0, = // UINT64 XDsdt - 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 -}; - -// -// Reference the table being generated to prevent the optimizer from remov= ing the -// data structure from the executable -// -VOID* CONST ReferenceAcpiTable =3D &Fadt; diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Gtdt.aslc b/Platform/Rasp= berryPi/RPi4/AcpiTables/Gtdt.aslc deleted file mode 100644 index 8453e487fb63..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Gtdt.aslc +++ /dev/null @@ -1,55 +0,0 @@ -/** @file -* Generic Timer Description Table (GTDT) -* -* Copyright (c) 2018, Linaro Limited. All rights reserved. -* Copyright (c) 2012 - 2016, ARM Limited. All rights reserved. -* -* SPDX-License-Identifier: BSD-2-Clause-Patent -* -**/ - -#include -#include -#include - -#include "AcpiTables.h" - -#define RPI_GTDT_GLOBAL_FLAGS 0 -#define RPI_GTDT_GTIMER_FLAGS EFI_ACPI_5_1_GTDT_TIMER_FLAG_TIMER= _INTERRUPT_POLARITY - -#pragma pack (1) - -typedef struct { - EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt; -} EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLES; - -#pragma pack () - -EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt =3D { - { - ACPI_HEADER( - EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, - EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLES, - EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION - ), - RPI_SYSTEM_TIMER_BASE_ADDRESS, // UINT64 PhysicalAddre= ss - 0, // UINT32 Reserved - FixedPcdGet32 (PcdArmArchTimerSecIntrNum), // UINT32 SecurePL1Time= rGSIV - RPI_GTDT_GTIMER_FLAGS, // UINT32 SecurePL1Time= rFlags - FixedPcdGet32 (PcdArmArchTimerIntrNum), // UINT32 NonSecurePL1T= imerGSIV - RPI_GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL1T= imerFlags - FixedPcdGet32 (PcdArmArchTimerVirtIntrNum), // UINT32 VirtualTimerG= SIV - RPI_GTDT_GTIMER_FLAGS, // UINT32 VirtualTimerF= lags - FixedPcdGet32 (PcdArmArchTimerHypIntrNum), // UINT32 NonSecurePL2T= imerGSIV - RPI_GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL2T= imerFlags - 0xFFFFFFFFFFFFFFFF, // UINT64 CntReadBasePh= ysicalAddress - 0, // UINT32 PlatformTimer= Count - 0 // UINT32 PlatfromTimerO= ffset - }, -}; - -// -// Reference the table being generated to prevent the optimizer -// from removing the data structure from the executable -// -VOID* CONST ReferenceAcpiTable =3D &Gtdt; diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Madt.aslc b/Platform/Rasp= berryPi/RPi4/AcpiTables/Madt.aslc deleted file mode 100644 index 4029cd191ab5..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Madt.aslc +++ /dev/null @@ -1,80 +0,0 @@ -/** @file -* Multiple APIC Description Table (MADT) -* -* Copyright (c) 2016 Linaro Ltd. All rights reserved. -* Copyright (c) 2012 - 2015, ARM Limited. All rights reserved. -* -* SPDX-License-Identifier: BSD-2-Clause-Patent -* -**/ - -#include -#include -#include -#include - -#include "AcpiTables.h" - -// -// Multiple APIC Description Table -// -#pragma pack (1) - -typedef struct { - EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header; - EFI_ACPI_5_1_GIC_STRUCTURE GicInterfaces[4]; -#if (RPI_MODEL !=3D 3) - EFI_ACPI_5_1_GIC_DISTRIBUTOR_STRUCTURE GicDistributor; -#endif -} PI_MULTIPLE_APIC_DESCRIPTION_TABLE; - -#pragma pack () - -PI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt =3D { - { - ACPI_HEADER ( - EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, - PI_MULTIPLE_APIC_DESCRIPTION_TABLE, - EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION - ), - // - // MADT specific fields - // - 0, // LocalApicAddress - 0, // Flags - }, - { -#if (RPI_MODEL =3D=3D 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), - 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), - 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), - 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 =3D=3D 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 - }, -#if (RPI_MODEL !=3D 3) - EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet64 (PcdGicDistributorBas= e), 0) -#endif -}; - -// -// Reference the table being generated to prevent the optimizer from remov= ing the -// data structure from the executable -// -VOID* CONST ReferenceAcpiTable =3D &Madt; diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Pep.asl b/Platform/Raspbe= rryPi/RPi4/AcpiTables/Pep.asl deleted file mode 100644 index 8a0a44e1c4c9..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Pep.asl +++ /dev/null @@ -1,90 +0,0 @@ -/** @file - * - * Platform Extension Plugin (PEP). - * - * Copyright (c) 2019, ARM Ltd. All rights reserved. - * Copyright (c) 2018, Andrey Warkentin - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -Device(PEPD) -{ - // - // PEP virtual device. - // - Name (_HID, "BCM2854") // Note: Since PEP on RPi is a virtual device, - Name (_CID, "BCM2854") // its device id needs to be generated by Microso= ft - Name (_UID, 0x0) - Name (_CRS, ResourceTemplate () - { - // No hardware resources for PEP driver are needed. - }) - - // - // Processor info. PEP proprietary method to return - // PEP_PROCESSOR_TABLE_PLAT structure. - // - // See Pep.h and Pep.c. - // - Name (_GPI, Buffer() - { - 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x5F, 0x00= , 0x53, - 0x00, 0x42, 0x00, 0x2E, 0x00, 0x43, 0x00, 0x50, 0x00, 0x55, 0x00, 0x30, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }) - - // - // Coordinated state info. PEP proprietary method to return - // PEP_COORDINATED_STATE_TABLE_PLAT structure. - // - // See Pep.h and Pep.c. - // - Name (_GCI, Buffer() - { - 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00= , 0x00, - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 - }) - - // - // Device info. PEP proprietary method to return - // PEP_DEVICE_TABLE_PLAT structure. - // - // See Pep.h and Pep.c. - // - Name (_GDI, Buffer() - { - 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x5F, 0x00= , 0x53, - 0x00, 0x42, 0x00, 0x2E, 0x00, 0x49, 0x00, 0x32, 0x00, 0x43, 0x00, 0x30, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }) -} diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Pep.c b/Platform/Raspberr= yPi/RPi4/AcpiTables/Pep.c deleted file mode 100644 index f452580c703d..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Pep.c +++ /dev/null @@ -1,79 +0,0 @@ -/** @file - * - * PEP device tables - * - * Copyright (c) 2019, ARM Ltd. All rights reserved. - * Copyright (c) 2018, Andrei Warkentin - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -#include "Pep.h" - -PEP_PROCESSOR_TABLE_PLAT RpiProcessors =3D { - 1, // Version - 1, // NumberProcessors - { // ProcessorInfo - { // [0] - L"\\_SB.CPU0", // DevicePath, wchar_t[16] - 0, // FeedbackCounterCount - 0x00000000, // Flags - 0, // NumberIdleStates - 0, // NumberPerfStates - { // IdleInfo - }, - { // perfinfo - } - } - } -}; - -PEP_COORDINATED_STATE_TABLE_PLAT RpiCoordinatedStates =3D { - 1, // Version - 1, // CoordinatedStateCount - { // CordinatedStates[] - { // [0] - { // DependencyInfo - { // [0] - 1, // ExpectedState - 0, // TargetProcessor - 0x0 | 0x2 | 0x4, // LooseDependency =3D FALSE, InitialState =3D = TRUE, DependentState =3D TRUE - } - }, - SOC_STATE_TYPE, // StateType - 0x1, // Flags - 0, // Latency - 0, // BreakEvenDuration - 1, // DependencyCount - 1, // MaximumDependencySize - } - } -}; - -PEP_DEVICE_TABLE_PLAT RpiDevices =3D { - 1, // Version - 1, // NumberDevices - { // DeviceInfo - { // [1] - L"\\_SB.I2C0", // DevicePath, wchar_t[16] - 0x1 | (1 << 3), // DStateSupportMask (D0 and D3) - 1, // NumberCompoenents - { // DStateRequirement - { // [0] - PowerDeviceD3 // DState - } - }, - { // FStateRequirement - { // [0] - { // FState - { // [0] - 0 - } - } - } - } - } - } -}; diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Pep.h b/Platform/Raspberr= yPi/RPi4/AcpiTables/Pep.h deleted file mode 100644 index 30f6768f12a5..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Pep.h +++ /dev/null @@ -1,121 +0,0 @@ -/** @file - * - * PEP device defines - * - * Copyright (c) 2019, ARM Ltd. All rights reserved. - * Copyright (c) 2018, Andrei Warkentin - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -/* - * Note: Not everything is here. At least SOC_STATE_TYPE is missing. - */ - -#ifndef _RPI_PEP_H_INCLUDED_ -#define _RPI_PEP_H_INCLUDED_ - -#include - -#define PEP_MAX_DEPENDENCIES_PER_STATE 16 -#define MAX_PROCESSOR_PATH_LENGTH 16 -#define MAX_DEVICE_PATH_LENGTH 32 -#define MAX_COMPONENT_COUNT 8 -#define P_NUMBER_PROCESSORS 1 -#define P_NUMBER_IDLE_STATES 1 -#define P_NUMBER_PERF_STATES 0 -#define P_NUMBER_DEVICES 1 -#define P_NUMBER_COORDINATED_STATS 1 - -typedef struct _PEP_PROCESSOR_IDLE_STATE_INFO { - UINT32 Ulong; - UINT32 Latency; - UINT32 BreakEvenDuration; -} PEP_PROCESSOR_IDLE_STATE_INFO, *PEP_PROCESSOR_IDLE_STATE_INFO; - -typedef struct _PEP_PROCESSOR_IDLE_INFO_PLAT { - // - // Processor idle states. - // - PEP_PROCESSOR_IDLE_STATE_INFO IdleStates[P_NUMBER_IDLE_STATES]; -} PEP_PROCESSOR_IDLE_INFO_PLAT, *PPEP_PROCESSOR_IDLE_INFO_PLAT; - -typedef struct COORDINATED_DEPENDENCY_INFO { - UINT32 ExpectedState; - UINT32 TargetProcessor; - UINT32 Ulong; -} COORDINATED_DEPENDENCY_INFO, *PCOORDINATED_DEPENDENCY_INFO; - -typedef struct { - COORDINATED_DEPENDENCY_INFO DependencyInfo[PEP_MAX_DEPENDENCIES_PER_STAT= E]; - UINT32 StateType; - UINT32 Ulong; - UINT32 Latency; - UINT32 BreakEvenDuration; - UINT32 DependencyCount; - UINT32 MaximumDependencySize; -} COORDINATED_STATE_INFO; - -typedef struct { - UINT32 Unused; -} PEP_PROCESSOR_PERF_INFO; - -typedef struct { - UINT32 FState[MAX_COMPONENT_COUNT]; -} COORDINATED_FSTATE_REQUIREMENT; - -typedef struct { - UINT32 DState; -} COORDINATED_DSTATE_REQUIREMENT; - -// -// Top level device table -// *N.B. The exact length of the structure is determined by the NumberIdle= States/NumberPerfStates variables. -// - -typedef struct _PEP_PROCESSOR_INFO_PLAT { - WCHAR DevicePath[MAX_PROCESSOR_PATH_LENGTH]; // Null-terminated ACPI name - ULONG FeedbackCounterCount; - ULONG Flags; - - // - // We are putting the idle/perf state count here (instead - // of the PEP_PROCESSOR_xxx_INFO structure for the ease of parsing. - // - ULONG NumberIdleStates; - ULONG NumberPerfStates; - - PEP_PROCESSOR_IDLE_INFO_PLAT IdleInfo; - PEP_PROCESSOR_PERF_INFO PerfInfo; -} PEP_PROCESSOR_INFO_PLAT, *PPEP_PROCESSOR_INFO_PLAT; - -typedef struct _PEP_PROCESSOR_TABLE_PLAT { - UINT32 Version; - UINT32 NumberProcessors; - PEP_PROCESSOR_INFO_PLAT ProcessorInfo[P_NUMBER_PROCESSORS]; -} PEP_PROCESSOR_TABLE_PLAT; - -typedef struct _PEP_COORDINATED_STATE_TABLE_PLAT { - ULONG Version; - ULONG CoordinatedStateCount; - COORDINATED_STATE_INFO CoordinatedStates[P_NUMBER_COORDINATED_STATS]; -} PEP_COORDINATED_STATE_TABLE_PLAT, *PPEP_COORDINATED_STATE_TABLE_PLAT; - -typedef struct _PEP_DEVICE_INFO_PLAT { - WCHAR DevicePath[MAX_DEVICE_PATH_LENGTH]; // Null-terminated ACPI name - ULONG DStateSupportMask; - ULONG NumberComponents; - - COORDINATED_DSTATE_REQUIREMENT DStateRequirement[P_NUMBER_COORDINATED_ST= ATS]; - COORDINATED_FSTATE_REQUIREMENT FStateRequirement[P_NUMBER_COORDINATED_ST= ATS]; -} PEP_DEVICE_INFO_PLAT, *PPEP_DEVICE_INFO_PLAT; - -typedef struct _PEP_DEVICE_TABLE_PLAT { - ULONG Version; - ULONG NumberDevices; - PEP_DEVICE_INFO_PLAT DeviceInfo[P_NUMBER_DEVICES]; -} PEP_DEVICE_TABLE_PLAT, *PPEP_DEVICE_TABLE_PLAT; - -#endif // _RPI_PEP_H_INCLUDED_ diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Rhpx.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Rhpx.asl deleted file mode 100644 index 0971e13ee013..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Rhpx.asl +++ /dev/null @@ -1,195 +0,0 @@ -/** @file - * - * [DSDT] RHProxy device to enable WinRT API (RHPX) - * - * Copyright (c) 2018, Andrey Warkentin - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -Device (RHPX) -{ - Name (_HID, "MSFT8000") - Name (_CID, "MSFT8000") - Name (_UID, 1) - - Name(_CRS, ResourceTemplate () - { - // Index 0 - SPISerialBus ( // SCKL - GPIO 11 - Pin 23 - // MOSI - GPIO 10 - Pin 19 - // MISO - GPIO 9 - Pin 21 - // CE0 - GPIO 8 - Pin 24 - 0, // Device selection (CE0) - PolarityLow, // Device selection polarity - FourWireMode, // WireMode - 8, // DataBit len - ControllerInitiated, // Slave mode - 4000000, // Connection speed - ClockPolarityLow, // Clock polarity - ClockPhaseFirst, // Clock phase - "\\_SB.SPI0", // ResourceSource: SPI bus controller name - 0, // ResourceSourceIndex - // Resource usage - // DescriptorName: creates name for offset of= resource descriptor - ) // Vendor Data - - // Index 1 - SPISerialBus ( // SCKL - GPIO 11 - Pin 23 - // MOSI - GPIO 10 - Pin 19 - // MISO - GPIO 9 - Pin 21 - // CE1 - GPIO 7 - Pin 26 - 1, // Device selection (CE1) - PolarityLow, // Device selection polarity - FourWireMode, // WireMode - 8, // DataBit len - ControllerInitiated, // Slave mode - 4000000, // Connection speed - ClockPolarityLow, // Clock polarity - ClockPhaseFirst, // Clock phase - "\\_SB.SPI0", // ResourceSource: SPI bus controller name - 0, // ResourceSourceIndex - // Resource usage - // DescriptorName: creates name for offset of= resource descriptor - ) // Vendor Data - - // Index 2 - I2CSerialBus ( // Pin 3 (GPIO2, SDA1), 5 (GPIO3, SCL1) - 0xFFFF, // SlaveAddress: placeholder - , // SlaveMode: default to ControllerInitiated - 0, // ConnectionSpeed: placeholder - , // Addressing Mode: default to 7 bit - "\\_SB.I2C1", // ResourceSource: I2C bus controller name - , - , - , // Descriptor Name: creates name for offset o= f resource descriptor - ) // Vendor Data - - // Index 3 - SPISerialBus ( // SPI1_SCLK - GPIO21 - // SPI1_MOSI - GPIO20 - // SPI1_MISO - GPIO19 - // SPI1_CE2_N - GPIO16 - 2, // Device selection (CE2) - PolarityLow, // Device selection polarity - FourWireMode, // WireMode - 8, // DataBit len - ControllerInitiated, // Slave mode - 4000000, // Connection speed - ClockPolarityLow, // Clock polarity - ClockPhaseFirst, // Clock phase - "\\_SB.SPI1", // ResourceSource: SPI bus controller name - 0, // ResourceSourceIndex - // Resource usage - // DescriptorName: creates name for offset of= resource descriptor - ) // Vendor Data - - // GPIO 2 - GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Reso= urceConsumer,,) { 2 } - GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GPI0",) = { 2 } - // GPIO 3 - GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Reso= urceConsumer,,) { 3 } - GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GPI0",) = { 3 } - // GPIO 4 - GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Reso= urceConsumer,,) { 4 } - GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GPI0",) = { 4 } - // GPIO 5 - GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Reso= urceConsumer,,) { 5 } - GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GPI0",) = { 5 } - // GPIO 6 - GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Reso= urceConsumer,,) { 6 } - GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GPI0",) = { 6 } - // GPIO 7 - GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Reso= urceConsumer,,) { 7 } - GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GPI0",) = { 7 } - // GPIO 8 - GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Reso= urceConsumer,,) { 8 } - GpioInt (Edge, ActiveBoth, Shared, PullUp, 0, "\\_SB.GPI0",) = { 8 } - // GPIO 9 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 9 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 9 } - // GPIO 10 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 10 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 10 } - // GPIO 11 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 11 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 11 } - // GPIO 12 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 12 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 12 } - // GPIO 13 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 13 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 13 } - // NTRAID#MSFT-7141401-2016/04/7-jordanrh - disable UART muxing - // until a proper solution can be created for the dmap conflict - // GPIO 14 - UART TX - // GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0,= ResourceConsumer,,) { 14 } - // GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 14 } - // GPIO 15 - UART RX - // GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0,= ResourceConsumer,,) { 15 } - // GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 15 } - // GPIO 16 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 16 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 16 } - // GPIO 17 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 17 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 17 } - // GPIO 18 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 18 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 18 } - // GPIO 19 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 19 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 19 } - // GPIO 20 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 20 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 20 } - // GPIO 21 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 21 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 21 } - // GPIO 22 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 22 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 22 } - // GPIO 23 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 23 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 23 } - // GPIO 24 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 24 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 24 } - // GPIO 25 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 25 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 25 } - // GPIO 26 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 26 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 26 } - // GPIO 27 - GpioIO (Shared, PullDown, 0, 0, IoRestrictionNone, "\\_SB.GPI0", 0, Re= sourceConsumer,,) { 27 } - GpioInt (Edge, ActiveBoth, Shared, PullDown, 0, "\\_SB.GPI0",) = { 27 } - }) - - Name (_DSD, Package() - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () - { - // Reference http://www.raspberrypi.org/documentation/hardware/raspb= errypi/spi/README.md - // SPI 0 - Package (2) { "bus-SPI-SPI0", Package() { 0, 1 } }, = // Index 0 & 1 - Package (2) { "SPI0-MinClockInHz", 7629 }, = // 7629 Hz - Package (2) { "SPI0-MaxClockInHz", 125000000 }, = // 125 MHz - Package (2) { "SPI0-SupportedDataBitLengths", Package() { 8 } }, = // Data Bit Length - // I2C1 - Package (2) { "bus-I2C-I2C1", Package() { 2 } }, - // GPIO Pin Count and supported drive modes - Package (2) { "GPIO-PinCount", 54 }, - Package (2) { "GPIO-UseDescriptorPinNumbers", 1 }, - Package (2) { "GPIO-SupportedDriveModes", 0xf }, = // InputHighImpedance, InputPullUp, InputPullDown, OutputCmos - // SPI 1 - Package (2) { "bus-SPI-SPI1", Package() { 3 }}, = // Index 3 - Package (2) { "SPI1-MinClockInHz", 30511 }, = // 30.5 kHz - Package (2) { "SPI1-MaxClockInHz", 20000000 }, = // 20 MHz - Package (2) { "SPI1-SupportedDataBitLengths", Package() { 8 } }, = // Data Bit Length - } - }) -} diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Sdhc.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Sdhc.asl deleted file mode 100644 index 0ab1ba27f2cf..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Sdhc.asl +++ /dev/null @@ -1,107 +0,0 @@ -/** @file - * - * [DSDT] SD controller/card definition (SDHC) - * - * Copyright (c) 2020, Pete Batard - * Copyright (c) 2018, Andrey Warkentin - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -#include -#include - -#include "AcpiTables.h" - -// -// Note: UEFI can use either SDHost or Arasan. We expose both to the OS. -// - -// ArasanSD 3.0 SD Host Controller. -Device (SDC1) -{ - Name (_HID, "BCM2847") - Name (_CID, "ARASAN") - Name (_UID, 0x0) - Name (_CCA, 0x0) - Name (_S1D, 0x1) - Name (_S2D, 0x1) - Name (_S3D, 0x1) - Name (_S4D, 0x1) - Method (_STA) - { - Return(0xf) - } - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0, MMCHS1_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_M= MCHS1_INTERRUPT } - }) - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, MMCHS1_OFFSET) - Return (^RBUF) - } - - // - // A child device that represents the - // sd card, which is marked as non-removable. - // - Device (SDMM) - { - Method (_ADR) - { - Return (0) - } - Method (_RMV) // Is removable - { - Return (0) // 0 - fixed - } - } -} - - -// Broadcom SDHost 2.0 SD Host Controller -Device (SDC2) -{ - Name (_HID, "BCM2855") - Name (_CID, "SDHST") - Name (_UID, 0x0) - Name (_CCA, 0x0) - Name (_S1D, 0x1) - Name (_S2D, 0x1) - Name (_S3D, 0x1) - Name (_S4D, 0x1) - Method (_STA) - { - Return (0xf) - } - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0, SDHOST_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_S= DHOST_INTERRUPT } - }) - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, SDHOST_OFFSET) - Return (^RBUF) - } - - // - // A child device that represents the - // sd card, which is marked as non-removable. - // - Device (SDMM) - { - Method (_ADR) - { - Return (0) - } - Method (_RMV) // Is removable - { - Return (0) // 0 - fixed - } - } -} diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Spcr.aslc b/Platform/Rasp= berryPi/RPi4/AcpiTables/Spcr.aslc deleted file mode 100644 index bec4ad660ec9..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Spcr.aslc +++ /dev/null @@ -1,97 +0,0 @@ -/** @file -* SPCR Table -* -* Copyright (c) 2019 Pete Batard -* Copyright (c) 2014-2016, ARM Limited. All rights reserved. -* -* SPDX-License-Identifier: BSD-2-Clause-Patent -* -**/ - -#include -#include -#include -#include -#include - -#include "AcpiTables.h" - -#define RPI_UART_FLOW_CONTROL_NONE 0 - -// Prefer PL011 serial output on the Raspberry Pi 4 -#if (RPI_MODEL =3D=3D 4) -#define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART -#define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART_BASE_ADDRE= SS -#define RPI_UART_INTERRUPT BCM2836_PL011_UART_INTERRUPT -#else -#define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_BCM2835_UART -#define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_BASE_ADDRESS -#define RPI_UART_INTERRUPT BCM2836_MINI_UART_INTERRUPT -#endif -STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr =3D { - ACPI_HEADER ( - EFI_ACPI_5_1_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE, - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION - ), - // UINT8 InterfaceType; - RPI_UART_INTERFACE_TYPE, - // UINT8 Reserved1[3]; - { - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE - }, - // EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE BaseAddress; - ARM_GAS32 (RPI_UART_BASE_ADDRESS), - // UINT8 InterruptType; - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC, - // UINT8 Irq; - 0, // Not used on ARM - // UINT32 GlobalSystemInterrupt; - RPI_UART_INTERRUPT, - // UINT8 BaudRate; -#if (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 9600) - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_9600, -#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 19200) - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_19200, -#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 57600) - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_57600, -#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 115200) - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200, -#else -#error Unsupported SPCR Baud Rate -#endif - // UINT8 Parity; - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY, - // UINT8 StopBits; - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1, - // UINT8 FlowControl; - RPI_UART_FLOW_CONTROL_NONE, - // UINT8 TerminalType; - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT_UTF8, - // UINT8 Reserved2; - EFI_ACPI_RESERVED_BYTE, - // UINT16 PciDeviceId; - 0xFFFF, - // UINT16 PciVendorId; - 0xFFFF, - // UINT8 PciBusNumber; - 0x00, - // UINT8 PciDeviceNumber; - 0x00, - // UINT8 PciFunctionNumber; - 0x00, - // UINT32 PciFlags; - 0x00000000, - // UINT8 PciSegment; - 0x00, - // UINT32 Reserved3; - EFI_ACPI_RESERVED_DWORD -}; - -// -// Reference the table being generated to prevent the optimizer from remov= ing the -// data structure from the executable -// -VOID* CONST ReferenceAcpiTable =3D &Spcr; diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Uart.asl deleted file mode 100644 index c466247bb33b..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl +++ /dev/null @@ -1,163 +0,0 @@ -/** @file - * - * [DSDT] Serial devices (UART). - * - * Copyright (c) 2020, Pete Batard - * Copyright (c) 2018, Andrey Warkentin - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -#include - -#include "AcpiTables.h" - -// PL011 based UART. -Device (URT0) -{ - Name (_HID, "BCM2837") - Name (_CID, "ARMH0011") - Name (_UID, 0x4) - Name (_CCA, 0x0) - Method (_STA) - { - Return (0xf) - } - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0, BCM2836_PL011_UART_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_P= L011_UART_INTERRUPT } - }) - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_PL011_UART_OFFSET) - Return (^RBUF) - } - - Name (CLCK, 48000000) - - Name (_DSD, Package () - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), Package () - { - Package (2) { "clock-frequency", CLCK }, - } - }) -} - -// -// UART Mini. -// -// This device is referenced in the DBG2 table, which will cause the syste= m to -// not start the driver when the debugger is enabled and to mark the device -// with problem code 53 (CM_PROB_USED_BY_DEBUGGER). -// - -Device (URTM) -{ - Name (_HID, "BCM2836") - Name (_CID, "MINIUART") - Name (_UID, 0x0) - Name (_CCA, 0x0) - Method (_STA) - { - Return (0xf) - } - Name (RBUF, ResourceTemplate () - { - MEMORY32FIXED (ReadWrite, 0, BCM2836_MINI_UART_LENGTH, RMEM) - Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_MINI_= UART_INTERRUPT } - - // NTRAID#MSFT-7141401-2016/04/7-jordanrh - disable UART muxing - // until a proper solution can be created for the dmap conflict. - // When muxing is enabled, must consider DBG2 table conflict. - // The alternate function resource needs to be reserved when - // the kernel debugger is enabled to prevent another client - // from muxing the pins away. - - // - // MsftFunctionConfig is encoded as the VendorLong. - // - // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0, = ResourceConsumer, ) {14, 15} - // VendorLong () // Length =3D 0x31 - // { - // /* 0000 */ 0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60, // .= `D....` - // /* 0008 */ 0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD, // J= ...-#0. - // /* 0010 */ 0x2F, 0x8D, 0x1D, 0x00, 0x01, 0x10, 0x00, 0x02, // /= ....... - // /* 0018 */ 0x02, 0x00, 0x12, 0x00, 0x00, 0x16, 0x00, 0x20, // .= ...... - // /* 0020 */ 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0F, 0x00, 0x5C, // .= ......\ - // /* 0028 */ 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, // _= SB.GPI0 - // /* 0030 */ 0x00 // . - //} - - }) - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, BCM2836_MINI_UART_OFFSET) - Return (^RBUF) - } -} - -// -// Multifunction serial bus device to support Bluetooth function. -// -Device(BTH0) -{ - Name (_HID, "BCM2EA6") - Name (_CID, "BCM2EA6") - Method (_STA) - { - Return (0xf) - } - Method (_CRS, 0x0, Serialized) - { - Name (RBUF, ResourceTemplate () - { - // BT UART: URT0 (PL011) or URTM (miniUART) - UARTSerialBus( - 115200, // InitialBaudRate: in BPS - , // BitsPerByte: default to 8 bits - , // StopBits: Defaults to one bit - 0x00, // LinesInUse: 8 1-bit flags to - // declare enabled control lines. - // Raspberry Pi does not exposed - // HW control signals -> not supported. - // Optional bits: - // - Bit 7 (0x80) Request To Send (RTS) - // - Bit 6 (0x40) Clear To Send (CTS) - // - Bit 5 (0x20) Data Terminal Ready (DTR) - // - Bit 4 (0x10) Data Set Ready (DSR) - // - Bit 3 (0x08) Ring Indicator (RI) - // - Bit 2 (0x04) Data Carrier Detect (DTD) - // - Bit 1 (0x02) Reserved. Must be 0. - // - Bit 0 (0x01) Reserved. Must be 0. - , // IsBigEndian: - // default to LittleEndian. - , // Parity: Defaults to no parity - , // FlowControl: Defaults to - // no flow control. - 16, // ReceiveBufferSize - 16, // TransmitBufferSize -#if (RPI_MODEL =3D=3D 4) - "\\_SB.URTM", // ResourceSource: -#else - "\\_SB.URT0", // ResourceSource: -#endif - // UART bus controller name - , // ResourceSourceIndex: assumed to be 0 - , // ResourceUsage: assumed to be - // ResourceConsumer - UAR0, // DescriptorName: creates name - // for offset of resource descriptor - ) // Vendor data - - // - // RPIQ connection for BT_ON/OFF - // - GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.RPIQ", 0, Re= sourceConsumer, , ) { 128 } - }) - Return (RBUF) - } -} diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Xhci.asl b/Platform/Raspb= erryPi/RPi4/AcpiTables/Xhci.asl deleted file mode 100644 index 0083d1992936..000000000000 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Xhci.asl +++ /dev/null @@ -1,136 +0,0 @@ -/** @file - * - * Copyright (c) 2019 Linaro, Limited. All rights reserved. - * Copyright (c) 2019 Andrei Warkentin - * - * SPDX-License-Identifier: BSD-2-Clause-Patent - * - **/ - -#include - -/* - * The following can be used to remove parenthesis from - * defined macros that the compiler complains about. - */ -#define ISOLATE_ARGS(...) __VA_ARGS__ -#define REMOVE_PARENTHESES(x) ISOLATE_ARGS x - -#define SANITIZED_PCIE_CPU_MMIO_WINDOW REMOVE_PARENTHESES(PCIE_CPU_MMIO_W= INDOW) -#define SANITIZED_PCIE_REG_BASE REMOVE_PARENTHESES(PCIE_REG_BASE) - -/* - * According to UEFI boot log for the VLI device on Pi 4. - */ -#define XHCI_REG_LENGTH 0x1000 - -Device (SCB0) { - Name (_HID, "ACPI0004") - Name (_UID, 0x0) - Name (_CCA, 0x0) - - Method (_CRS, 0, Serialized) { // _CRS: Current Resource Settings - /* - * Container devices with _DMA must have _CRS, meaning SCB0 - * to provide all resources that XHC0 consumes (except - * interrupts). - */ - Name (RBUF, ResourceTemplate () { - QWordMemory (ResourceProducer, - , - MinFixed, - MaxFixed, - NonCacheable, - ReadWrite, - 0x0, - SANITIZED_PCIE_CPU_MMIO_WINDOW, // MIN - SANITIZED_PCIE_CPU_MMIO_WINDOW, // MAX - 0x0, - 0x1, // LEN - , - , - MMIO - ) - }) - CreateQwordField (RBUF, MMIO._MAX, MMBE) - CreateQwordField (RBUF, MMIO._LEN, MMLE) - Add (MMBE, XHCI_REG_LENGTH - 1, MMBE) - Add (MMLE, XHCI_REG_LENGTH - 1, MMLE) - Return (RBUF) - } - - Name (_DMA, ResourceTemplate() { - /* - * XHC0 is limited to DMA to first 3GB. Note this - * only applies to PCIe, not GENET or other devices - * next to the A72. - */ - QWordMemory (ResourceConsumer, - , - MinFixed, - MaxFixed, - NonCacheable, - ReadWrite, - 0x0, - 0x0, // MIN - 0xbfffffff, // MAX - 0x0, // TRA - 0xc0000000, // LEN - , - , - ) - }) - - Device (XHC0) - { - Name (_HID, "PNP0D10") // _HID: Hardware ID - Name (_UID, 0x0) // _UID: Unique ID - Name (_CCA, 0x0) // _CCA: Cache Coherency Attribute - - Method (_CRS, 0, Serialized) { // _CRS: Current Resource Settings - Name (RBUF, ResourceTemplate () { - QWordMemory (ResourceConsumer, - , - MinFixed, - MaxFixed, - NonCacheable, - ReadWrite, - 0x0, - SANITIZED_PCIE_CPU_MMIO_WINDOW, // MIN - SANITIZED_PCIE_CPU_MMIO_WINDOW, // MAX - 0x0, - 0x1, // LEN - , - , - MMIO - ) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive,= ,, ) { - 175 - } - }) - CreateQwordField (RBUF, MMIO._MAX, MMBE) - CreateQwordField (RBUF, MMIO._LEN, MMLE) - Add (MMBE, XHCI_REG_LENGTH - 1, MMBE) - Add (MMLE, XHCI_REG_LENGTH - 1, MMLE) - Return (RBUF) - } - - Method (_INI, 0, Serialized) { - OperationRegion (PCFG, SystemMemory, SANITIZED_PCIE_REG_BASE += PCIE_EXT_CFG_DATA, 0x1000) - Field (PCFG, AnyAcc, NoLock, Preserve) { - Offset (0), - VNID, 16, // Vendor ID - DVID, 16, // Device ID - CMND, 16, // Command register - STAT, 16, // Status register - } - - // Set command register to: - // 1) decode MMIO (set bit 1) - // 2) enable DMA (set bit 2) - // 3) enable interrupts (clear bit 10) - Debug =3D "xHCI enable" - Store (0x6, CMND) - } - } -} diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index 09bd19e3b724..c039f6df2eb4 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -576,7 +576,7 @@ [Components.common] MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf - Platform/RaspberryPi/$(PLATFORM_NAME)/AcpiTables/AcpiTables.inf + Platform/RaspberryPi/AcpiTables/AcpiTables.inf =20 # # SMBIOS Support diff --git a/Platform/RaspberryPi/RPi4/RPi4.fdf b/Platform/RaspberryPi/RPi4= /RPi4.fdf index 52ae1e5b65cb..b2a6ac9e6c66 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.fdf +++ b/Platform/RaspberryPi/RPi4/RPi4.fdf @@ -238,7 +238,7 @@ [FV.FvMain] INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphic= sResourceTableDxe.inf - INF RuleOverride =3D ACPITABLE Platform/RaspberryPi/$(PLATFORM_NAME)/Acp= iTables/AcpiTables.inf + INF RuleOverride =3D ACPITABLE Platform/RaspberryPi/AcpiTables/AcpiTable= s.inf =20 # # SMBIOS Support --=20 2.21.0.windows.1 -=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 (#55078): https://edk2.groups.io/g/devel/message/55078 Mute This Topic: https://groups.io/mt/71605856/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-