From nobody Fri Apr 19 06:02:43 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+56395+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+56395+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1585223618; cv=none; d=zohomail.com; s=zohoarc; b=LBlovWTSaET39UAXAV18bTc0mp9hQPl1VaABI0EaUO4BGMW6C/zFyfTVgUiArMUpK0zWrm2d4lz90GbXGLijxrHOe04Aq9RpA8Rz7sbPHe88APIbDf4wnF/PIZOfCRY7YYxmEvqGWHMvYjNbSLg2CxdLbtz/UHWxkzFJyI2OVPY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585223618; 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=zZGLc4+wPG8r97aJNd7ogE0UU7QSwY4fz8RwwpWxnfk=; b=nU/M/v6D/pef+Mcs9/C1PnN6YYYmOl5MtOeW2o/tK6zsmiXGxQ81m8JDbRV1E+Ut46tglN94HExXzqTGPO5MR9yeGgK1U11X8SNbQJTyii7yJ+Wou0N5w8CxN9LsoIhsO+2/q7TpdIYvNM4XfxNW2SdRTxihn3nkijISYLxBCE4= 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+56395+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585223618220981.1834113683884; Thu, 26 Mar 2020 04:53:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tJrZYY1788612xgUG720quMp; Thu, 26 Mar 2020 04:53:37 -0700 X-Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by mx.groups.io with SMTP id smtpd.web10.35026.1585223616916999313 for ; Thu, 26 Mar 2020 04:53:37 -0700 X-Received: by mail-ed1-f67.google.com with SMTP id u59so6413298edc.12 for ; Thu, 26 Mar 2020 04:53:36 -0700 (PDT) X-Gm-Message-State: jLNSwOdmj62luECZ6BjkOM1cx1787277AA= X-Google-Smtp-Source: ADFU+vvHEQBC4XA3SMLY6zHJ4AU2kqNmJzX+tUHaXcAYsPeCI/1/uxUeU1LM1RITaOSQSfKLpkhzIg== X-Received: by 2002:a17:906:3e0c:: with SMTP id k12mr6924999eji.309.1585223615015; Thu, 26 Mar 2020 04:53:35 -0700 (PDT) X-Received: from localhost.localdomain ([84.203.78.33]) by smtp.gmail.com with ESMTPSA id bs8sm240534ejb.92.2020.03.26.04.53.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 04:53:34 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-devel] [edk2-platforms][PATCH 1/6] Platform/RPi/AcpiTables: Fix Pi 4 interrupts values Date: Thu, 26 Mar 2020 11:53:17 +0000 Message-Id: <20200326115322.2880-2-pete@akeo.ie> In-Reply-To: <20200326115322.2880-1-pete@akeo.ie> References: <20200326115322.2880-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=1585223617; bh=/u6ULN83P8Qv27laDf560EYtpUQGukQuEa2a+z2BxRQ=; h=Cc:Date:From:Reply-To:Subject:To; b=GUPqrPkQ5jwP3X0rRCsjfofUhxmIHXJH3DsbrYuyJttX+IvXKgHBWVQJNtqz8JiMSIY dT5J6Vt78gVL2e/6YishPBBM6gGuHy3kcQXbCqyZCeA7hPhziso9gZf5Yon+InXbxNTST Iiky3FZlWh3jsgm4ubHtbb/x74BibW+wcgk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Some of the Pi 4 interrupts were copied from Pi 3 and are incorrect. We fix the ones that can be found by decompiling the official .dtbs. We also add a couple more GPIO interrupts, that are used for both the Pi 3 and the Pi 4, as per the dtbs. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/AcpiTables/AcpiTables.h | 24 ++++++++++++-------- Platform/RaspberryPi/AcpiTables/Dsdt.asl | 6 ++++- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/AcpiTables.h b/Platform/Raspbe= rryPi/AcpiTables/AcpiTables.h index 0b8a8494450c..712a4a5806ae 100644 --- a/Platform/RaspberryPi/AcpiTables/AcpiTables.h +++ b/Platform/RaspberryPi/AcpiTables/AcpiTables.h @@ -125,7 +125,9 @@ typedef struct #define BCM2836_MBOX_INTERRUPT 0x61 #define BCM2836_VCHIQ_INTERRUPT 0x62 #define BCM2386_GPIO_INTERRUPT0 0x51 -#define BCM2386_GPIO_INTERRUPT1 0x53 +#define BCM2386_GPIO_INTERRUPT1 0x52 +#define BCM2386_GPIO_INTERRUPT2 0x53 +#define BCM2386_GPIO_INTERRUPT3 0x54 #define BCM2836_I2C1_INTERRUPT 0x55 #define BCM2836_I2C2_INTERRUPT 0x55 #define BCM2836_SPI0_INTERRUPT 0x56 @@ -137,21 +139,23 @@ typedef struct #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_SPI1_INTERRUPT 0x7D +#define BCM2836_SPI2_INTERRUPT 0x7D #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_MBOX_INTERRUPT 0x41 +#define BCM2836_VCHIQ_INTERRUPT 0x42 +#define BCM2386_GPIO_INTERRUPT0 0x91 +#define BCM2386_GPIO_INTERRUPT1 0x92 +#define BCM2386_GPIO_INTERRUPT2 0x93 +#define BCM2386_GPIO_INTERRUPT3 0x94 +#define BCM2836_I2C1_INTERRUPT 0x95 +#define BCM2836_I2C2_INTERRUPT 0x95 +#define BCM2836_SPI0_INTERRUPT 0x96 #define BCM2836_USB_INTERRUPT 0x69 #define BCM2836_SDHOST_INTERRUPT 0x98 #define BCM2836_MMCHS1_INTERRUPT 0x9E diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryP= i/AcpiTables/Dsdt.asl index 4a6fa6377d1b..2aa7d10bd40c 100644 --- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl @@ -279,7 +279,11 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2"= , 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, GPIO_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2386_= GPIO_INTERRUPT0, BCM2386_GPIO_INTERRUPT1 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) + { + BCM2386_GPIO_INTERRUPT0, BCM2386_GPIO_INTERRUPT1, + BCM2386_GPIO_INTERRUPT2, BCM2386_GPIO_INTERRUPT3 + } }) Method (_CRS, 0x0, Serialized) { --=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 (#56395): https://edk2.groups.io/g/devel/message/56395 Mute This Topic: https://groups.io/mt/72561823/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 Fri Apr 19 06:02:43 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+56396+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+56396+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1585223619; cv=none; d=zohomail.com; s=zohoarc; b=cBafe+BlOUR53PYp9SYp4BgLLFAfeX5xVVXpmOD8bIPJ9red2kCdR8EJQVb7bRspkjqzYl6YnseUQ0sW4WFEwr9HXyMCPOrMppVCQCMxNpP+2096AzyVuMKadBiUO6cCmIe+Qn1bdY1CAD3YroqWorJ1iz66Y47wpk192u/Qv4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585223619; 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=n9rsN/RxWEnVy0pDN6AY8iDYAuhabeOQ8Yrr//zh08k=; b=ixfFvs4rjmeuiz2TrvcROL8XEexm00ijqocobaBgcibzoSEqxIvoDWxS0wdHSsa+5wrLAqKXJVwlDwX3LvBq/qyV0t08yGh6X4lzRxmVuQ1Ejz9SRLbZLUAil9gmJCjJvPZPbYpyKd0O6zr4dIdYO9caIhs0Uh3QgZuDntcgTyQ= 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+56396+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585223619476741.8017831381378; Thu, 26 Mar 2020 04:53:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id PCE0YY1788612x6W0ME28vO4; Thu, 26 Mar 2020 04:53:39 -0700 X-Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by mx.groups.io with SMTP id smtpd.web12.35116.1585223618327229480 for ; Thu, 26 Mar 2020 04:53:38 -0700 X-Received: by mail-ed1-f66.google.com with SMTP id bd14so6426954edb.10 for ; Thu, 26 Mar 2020 04:53:38 -0700 (PDT) X-Gm-Message-State: EX5KCld7JRrzwgcRI7XIM4gkx1787277AA= X-Google-Smtp-Source: ADFU+vt7swgsmqaKaBdFaZixRqRpPAUZzGnJatJNI/aIGf24Y5oeHcCdaOB92ctbU/SNJy8i7wx6zA== X-Received: by 2002:a17:906:2443:: with SMTP id a3mr7207756ejb.291.1585223616256; Thu, 26 Mar 2020 04:53:36 -0700 (PDT) X-Received: from localhost.localdomain ([84.203.78.33]) by smtp.gmail.com with ESMTPSA id bs8sm240534ejb.92.2020.03.26.04.53.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 04:53:35 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-devel] [edk2-platforms][PATCH 2/6] Platform/RPi/AcpiTables: Replace VendorLong () blobs with PinFunction () Date: Thu, 26 Mar 2020 11:53:18 +0000 Message-Id: <20200326115322.2880-3-pete@akeo.ie> In-Reply-To: <20200326115322.2880-1-pete@akeo.ie> References: <20200326115322.2880-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=1585223619; bh=3hnlICQ1JahHkz3pSXCx9lDBeBQlgEQfHo65eMKNdx8=; h=Cc:Date:From:Reply-To:Subject:To; b=V7hlaRM1XFwlRWj7SLLMB7GO6u3OqsSbcmUvQv25ATY1kx7ZvJLE0BqKM4IqadaGMbU //Aau2UoBembSZLxwzVJgqJ5FGnjrEKqyjsnGTS1NNhTYhaVZw9DbrOc/HeFFK+dwliiF Xk9PsffdHNLF7i9dO5HDceimx5sXRNzD5es= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Andrei Warkentin Per https://github.com/MicrosoftDocs/windows-uwp/issues/1751, MsftFunctionConfig () calls can be replaced by PinFunction () calls. Since these had been converted to VendorLong () blobs due to lack of implementation of MsftFunctionConfig (), we replace them back now that PinFunction () is available. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/AcpiTables/Dsdt.asl | 94 ++------------------ Platform/RaspberryPi/AcpiTables/Uart.asl | 16 +--- 2 files changed, 7 insertions(+), 103 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryP= i/AcpiTables/Dsdt.asl index 2aa7d10bd40c..2e63091cdba0 100644 --- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl @@ -338,22 +338,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2"= , 2) { 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 // . - } + PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, Resourc= eConsumer, , ) { 2, 3 } }) Method (_CRS, 0x0, Serialized) { @@ -401,49 +386,9 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2"= , 2) { 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. - } + PinFunction (Exclusive, PullDown, BCM_ALT0, "\\_SB.GPI0", 0, Resou= rceConsumer, , ) { 9, 10, 11 } // MISO, MOSI, SCLK + PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, Resourc= eConsumer, , ) { 8 } // CE0 + PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, Resourc= eConsumer, , ) { 7 } // CE1 }) =20 Method (_CRS, 0x0, Serialized) @@ -468,35 +413,8 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2"= , 2) { 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. - } + PinFunction (Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0", 0, Resou= rceConsumer, , ) { 19, 20, 21 } // MISO, MOSI, SCLK + PinFunction (Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0", 0, Resou= rceConsumer, , ) { 16 } // CE2 }) =20 Method (_CRS, 0x0, Serialized) diff --git a/Platform/RaspberryPi/AcpiTables/Uart.asl b/Platform/RaspberryP= i/AcpiTables/Uart.asl index c466247bb33b..f6a14d6fd069 100644 --- a/Platform/RaspberryPi/AcpiTables/Uart.asl +++ b/Platform/RaspberryPi/AcpiTables/Uart.asl @@ -77,21 +77,7 @@ Device (URTM) // the kernel debugger is enabled to prevent another client // from muxing the pins away. =20 - // - // 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 // . - //} - + // PinFunction (Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0, Resour= ceConsumer, , ) { 14, 15 } }) Method (_CRS, 0x0, Serialized) { --=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 (#56396): https://edk2.groups.io/g/devel/message/56396 Mute This Topic: https://groups.io/mt/72561824/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 Fri Apr 19 06:02:43 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+56397+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+56397+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1585223620; cv=none; d=zohomail.com; s=zohoarc; b=KiNijk8LkbfOHP+vcP7meg1ZUn5WKD0iPiAx0Vxh+Uup51HRuRwhffaKkH4t3oSskzJ0/hacsGJ0acZOEfyKR5VI9SPuwtdkSmqIgLTVFLFc9NK5LmypR/JjfOw9N2CCYdhrH2WRirU3mOpKwA3cpGBmFEE050q8ZPRelAYe1yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585223620; 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=zD2sEVdkQ4jo6r/P9eELt0LUts+LjddrRArpchSiYK8=; b=X/lomujzfY/4Myyqn5cSplGHEr1omM6CpaH8z/beBrwqUvmRXwfck3dlWR801XSM2KIdGmNHjUAkhEEWtqqt7d60McIx5rhVaeNLoTTA2Rz4kDJ4milB6R6+y5/hpdrJ1rzaQyP3mGn7yu1gaziOH2DQbJe7UVT0WSGqR50ie88= 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+56397+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585223620216944.2440002233385; Thu, 26 Mar 2020 04:53:40 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id nfUaYY1788612xtBOlVmQpC2; Thu, 26 Mar 2020 04:53:39 -0700 X-Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by mx.groups.io with SMTP id smtpd.web10.35028.1585223619196593355 for ; Thu, 26 Mar 2020 04:53:39 -0700 X-Received: by mail-ed1-f67.google.com with SMTP id cw6so5741514edb.9 for ; Thu, 26 Mar 2020 04:53:38 -0700 (PDT) X-Gm-Message-State: draabgCE5QhO7eU2OVc6uD2vx1787277AA= X-Google-Smtp-Source: ADFU+vsNcYGvmcUQWeLbdFLgzJYKFrga4pTF409CcakZyTir062pfss+k/miPnsgE/eh6L9PTkvLhg== X-Received: by 2002:a17:906:dbd7:: with SMTP id yc23mr7424330ejb.97.1585223617443; Thu, 26 Mar 2020 04:53:37 -0700 (PDT) X-Received: from localhost.localdomain ([84.203.78.33]) by smtp.gmail.com with ESMTPSA id bs8sm240534ejb.92.2020.03.26.04.53.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 04:53:37 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-devel] [edk2-platforms][PATCH 3/6] Platform/RPi/AcpiTables: Use PCDs in MADT Date: Thu, 26 Mar 2020 11:53:19 +0000 Message-Id: <20200326115322.2880-4-pete@akeo.ie> In-Reply-To: <20200326115322.2880-1-pete@akeo.ie> References: <20200326115322.2880-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=1585223619; bh=bz8ZEgyF3FfSSwau7cb/eYf8D16SyiGst3jNyLiNlt0=; h=Cc:Date:From:Reply-To:Subject:To; b=l2XhfmeFr9iliAmmxzEAsAla+tFN3L3px5YbEkObx5lCiI2HGz/O32n5vTNFcfShZw+ Koo1obPNlaMfRxOLroVfy8n/XGrgXmt9ZFrnge+CAbJVhPuWe8GGO1PANkgrOPJLZbDAR 5cVaN+ktwISNn6BuxFWhUwBzxlo2VUMhbHg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Instead of going through a model #ifdef, the call to EFI_ACPI_5_1_GICC_STRUCTURE_INIT () is factorized by setting up a new set of PCDs. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/AcpiTables/AcpiTables.inf | 8 +++++ Platform/RaspberryPi/AcpiTables/Madt.aslc | 31 ++++++++------------ Platform/RaspberryPi/RPi3/RPi3.dsc | 9 ++++++ Platform/RaspberryPi/RPi4/RPi4.dsc | 7 +++++ Platform/RaspberryPi/RaspberryPi.dec | 7 +++++ 5 files changed, 43 insertions(+), 19 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf b/Platform/Rasp= berryPi/AcpiTables/AcpiTables.inf index 9ad5246d6bb6..6642541d6a0a 100644 --- a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf +++ b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf @@ -39,6 +39,7 @@ [Packages] EmbeddedPkg/EmbeddedPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + Platform/RaspberryPi/RaspberryPi.dec Silicon/Broadcom/Bcm27xx/Bcm27xx.dec Silicon/Broadcom/Bcm283x/Bcm283x.dec Silicon/Broadcom/Drivers/Net/BcmNet.dec @@ -56,6 +57,13 @@ [FixedPcd] gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress + gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceHBase + gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceVBase + gRaspberryPiTokenSpaceGuid.PcdGicGsivId + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq0 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq1 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq2 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq3 =20 [BuildOptions] GCC:*_*_*_ASL_FLAGS =3D -vw3133 -vw3150 diff --git a/Platform/RaspberryPi/AcpiTables/Madt.aslc b/Platform/Raspberry= Pi/AcpiTables/Madt.aslc index 4029cd191ab5..faf461814536 100644 --- a/Platform/RaspberryPi/AcpiTables/Madt.aslc +++ b/Platform/RaspberryPi/AcpiTables/Madt.aslc @@ -44,29 +44,22 @@ PI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt =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), + 0, 0, GET_MPID(0, 0), EFI_ACPI_5_1_GIC_ENABLED, FixedPcdGet32 (PcdGi= cPmuIrq0), + FixedPcdGet64 (PcdGicInterruptInterfaceBase), FixedPcdGet64 (PcdGicI= nterruptInterfaceVBase), + FixedPcdGet64 (PcdGicInterruptInterfaceHBase), FixedPcdGet32 (PcdGic= GsivId), 0), EFI_ACPI_5_1_GICC_STRUCTURE_INIT( - 1, 1, GET_MPID(0, 1), EFI_ACPI_5_1_GIC_ENABLED, 0x09, 0x40000000, = 0, 0, 0, 0), + 1, 1, GET_MPID(0, 1), EFI_ACPI_5_1_GIC_ENABLED, FixedPcdGet32 (PcdGi= cPmuIrq1), + FixedPcdGet64 (PcdGicInterruptInterfaceBase), FixedPcdGet64 (PcdGicI= nterruptInterfaceVBase), + FixedPcdGet64 (PcdGicInterruptInterfaceHBase), FixedPcdGet32 (PcdGic= GsivId), 0), EFI_ACPI_5_1_GICC_STRUCTURE_INIT( - 2, 2, GET_MPID(0, 2), EFI_ACPI_5_1_GIC_ENABLED, 0x09, 0x40000000, = 0, 0, 0, 0), + 2, 2, GET_MPID(0, 2), EFI_ACPI_5_1_GIC_ENABLED, FixedPcdGet32 (PcdGi= cPmuIrq2), + FixedPcdGet64 (PcdGicInterruptInterfaceBase), FixedPcdGet64 (PcdGicI= nterruptInterfaceVBase), + FixedPcdGet64 (PcdGicInterruptInterfaceHBase), FixedPcdGet32 (PcdGic= GsivId), 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 + 3, 3, GET_MPID(0, 3), EFI_ACPI_5_1_GIC_ENABLED, FixedPcdGet32 (PcdGi= cPmuIrq3), + FixedPcdGet64 (PcdGicInterruptInterfaceBase), FixedPcdGet64 (PcdGicI= nterruptInterfaceVBase), + FixedPcdGet64 (PcdGicInterruptInterfaceHBase), FixedPcdGet32 (PcdGic= GsivId), 0), }, #if (RPI_MODEL !=3D 3) EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet64 (PcdGicDistributorBas= e), 0) diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3= /RPi3.dsc index 7fb9a41f3d9a..1651def87ce1 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -403,6 +403,15 @@ [PcdsFixedAtBuild.common] gRaspberryPiTokenSpaceGuid.PcdCpuDefSpeedMHz|1200 gRaspberryPiTokenSpaceGuid.PcdCpuMaxSpeedMHz|1500 =20 + # + # ARM General Interrupt Controller + # + gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x40000000 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq0|0x09 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq1|0x09 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq2|0x09 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq3|0x09 + ## Default Terminal Type ## 0-PCANSI, 1-VT100, 2-VT00+, 3-UTF8, 4-TTYTERM gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4 diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index 1abb010469f5..4fe4d810a0bc 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -431,6 +431,13 @@ [PcdsFixedAtBuild.common] # gArmTokenSpaceGuid.PcdGicDistributorBase|0xFF841000 gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0xFF842000 + gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceHBase|0xFF844000 + gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceVBase|0xFF846000 + gRaspberryPiTokenSpaceGuid.PcdGicGsivId|0x19 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq0|0x30 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq1|0x31 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq2|0x32 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq3|0x33 =20 # # Fixed CPU settings. diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/Ra= spberryPi.dec index dc37541f3732..d59b548185e3 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -47,6 +47,13 @@ [PcdsFixedAtBuild.common] gRaspberryPiTokenSpaceGuid.PcdCpuLowSpeedMHz|600|UINT32|0x0000000a gRaspberryPiTokenSpaceGuid.PcdCpuDefSpeedMHz|800|UINT32|0x0000000b gRaspberryPiTokenSpaceGuid.PcdCpuMaxSpeedMHz|1000|UINT32|0x0000000c + gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceHBase|0x0|UINT64|0x00= 000030 + gRaspberryPiTokenSpaceGuid.PcdGicInterruptInterfaceVBase|0x0|UINT64|0x00= 000031 + gRaspberryPiTokenSpaceGuid.PcdGicGsivId|0x0|UINT32|0x00000032 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq0|0x0|UINT32|0x00000033 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq1|0x0|UINT32|0x00000034 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq2|0x0|UINT32|0x00000035 + gRaspberryPiTokenSpaceGuid.PcdGicPmuIrq3|0x0|UINT32|0x00000036 =20 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] gRaspberryPiTokenSpaceGuid.PcdCpuClock|0|UINT32|0x0000000d --=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 (#56397): https://edk2.groups.io/g/devel/message/56397 Mute This Topic: https://groups.io/mt/72561825/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 Fri Apr 19 06:02:43 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+56398+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+56398+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1585223622; cv=none; d=zohomail.com; s=zohoarc; b=a+NBZd91IWMqGbZi7QNPaEtM+LhocVGvnh8LL1t4xZRsnbn+apEyCo7PL7tS458MSccxo0c1ajOxJ/zuVZnRX1GCCUvBfWNsWq3M4WS3NfcQ2kD2UTYRyA/Cdy/wjfYABUSNiJ5T7q1Yg8JGTTkwMX4gmHfOoE9o1QSgYKcmxmw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585223622; 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=di6c+6h6+krdakq4nc5WK48/XW1ftl0ofSo3jrD9doI=; b=U6zdflJOxSwIAxjahs9fMKtFLnwRhPaFd/k/BNO5xIAJKE10xcg2i4buD40SjGwNipIF4Y5rH1fUaEI5kSKAXxsAQwoYU7oArhfoFg0A2efyuN1dR8MLXp+3ysIk75jZ0Jhxg+wVc3Ywf3GYeiY/feML5+XCcw+qoQR8TghBojM= 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+56398+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585223622249617.694503661611; Thu, 26 Mar 2020 04:53:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7HpxYY1788612xd3lmgesmEu; Thu, 26 Mar 2020 04:53:41 -0700 X-Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by mx.groups.io with SMTP id smtpd.web12.35117.1585223620676884260 for ; Thu, 26 Mar 2020 04:53:41 -0700 X-Received: by mail-ed1-f48.google.com with SMTP id cw6so5741580edb.9 for ; Thu, 26 Mar 2020 04:53:40 -0700 (PDT) X-Gm-Message-State: S4tddNFfebLi6VTO5ElKtRslx1787277AA= X-Google-Smtp-Source: ADFU+vvXTL2pggfGy7MGfC+f4qDqlYv8BjTkFxQ9WduEMfWjuHakh/qSOIAK8lViEG2Xm1v5lcl5NQ== X-Received: by 2002:a17:907:262a:: with SMTP id aq10mr7190482ejc.377.1585223618628; Thu, 26 Mar 2020 04:53:38 -0700 (PDT) X-Received: from localhost.localdomain ([84.203.78.33]) by smtp.gmail.com with ESMTPSA id bs8sm240534ejb.92.2020.03.26.04.53.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 04:53:38 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-devel] [edk2-platforms][PATCH 4/6] Platform/RPi/AcpiTables: Clean up ACPI IDs Date: Thu, 26 Mar 2020 11:53:20 +0000 Message-Id: <20200326115322.2880-5-pete@akeo.ie> In-Reply-To: <20200326115322.2880-1-pete@akeo.ie> References: <20200326115322.2880-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=1585223621; bh=cRkPsnRa8PE7v7fuec/54KBASUtBVmMtlT2Dku7MpTc=; h=Cc:Date:From:Reply-To:Subject:To; b=tb0ClUc5uJtfLFJjR5T/oe2KoCxLrlMnLsF7IgJgiXpv91ilfEiv+XMWwgyc+nQDq57 exssnOKBvqK5/y08Kz467qxkArMqgViYJ1JepFzzXWeQ1LLVUZg50EMFsmihVkL4UyiXR bFJK7yOo8kI3gbkWDU/JxaS1qYiSSFQvDJc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Only apply the "BC2836" override to the one table that needs it for Pi 3, instead of setting it globally. Use more appropriate OEM and Vendor IDs for hardware that is produced by the Raspberry Pi Foundation. Ensure that the Pi 3 and Pi 4 have different OEM IDs. Additionally fix a comment typo (MEMORY32SETBASE -> MEMORY32FIXED). Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/AcpiTables/AcpiTables.h | 22 ++++++++++---------- Platform/RaspberryPi/AcpiTables/Dsdt.asl | 2 +- Platform/RaspberryPi/AcpiTables/Fadt.aslc | 10 +++++++++ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/AcpiTables.h b/Platform/Raspbe= rryPi/AcpiTables/AcpiTables.h index 712a4a5806ae..dfae763d8107 100644 --- a/Platform/RaspberryPi/AcpiTables/AcpiTables.h +++ b/Platform/RaspberryPi/AcpiTables/AcpiTables.h @@ -16,25 +16,25 @@ =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. +// The ASL compiler can't perform arithmetic on MEMORY32FIXED () +// parameters so you can't pass a constant like BASE + OFFSET. +// We therefore define 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) =20 +#define EFI_ACPI_OEM_ID {'R','P','I','F','D','N'} #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'} +#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64 ('R','P','I','3= ',' ',' ',' ',' ') +#elif (RPI_MODEL =3D=3D 4) +#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64 ('R','P','I','4= ',' ',' ',' ',' ') #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_OEM_REVISION 0x00000200 #define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('E','D','K','2= ') -#define EFI_ACPI_CREATOR_REVISION 0x00000100 +#define EFI_ACPI_CREATOR_REVISION 0x00000200 =20 -#define EFI_ACPI_VENDOR_ID SIGNATURE_32 ('M','S','F','T= ') +#define EFI_ACPI_VENDOR_ID SIGNATURE_32 ('R','P','I','F= ') =20 // A macro to initialise the common header part of EFI ACPI tables as defi= ned by // EFI_ACPI_DESCRIPTION_HEADER structure. diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryP= i/AcpiTables/Dsdt.asl index 2e63091cdba0..1ca55ff12e35 100644 --- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl @@ -25,7 +25,7 @@ #define BCM_ALT4 0x3 #define BCM_ALT5 0x2 =20 -DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) +DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI", 2) { Scope (\_SB_) { diff --git a/Platform/RaspberryPi/AcpiTables/Fadt.aslc b/Platform/Raspberry= Pi/AcpiTables/Fadt.aslc index ebf58fb7fc3c..3e3d68703298 100644 --- a/Platform/RaspberryPi/AcpiTables/Fadt.aslc +++ b/Platform/RaspberryPi/AcpiTables/Fadt.aslc @@ -16,6 +16,16 @@ =20 #include "AcpiTables.h" =20 +/* + * Windows 10 on the Raspberry Pi 3 requires a specific OEM Id for FADT. + * We replace the one that was defined in "AcpiTables.h", so that it is + * picked by the ACPI_HEADER () macro. + */ +#if (RPI_MODEL =3D=3D 3) +#undef EFI_ACPI_OEM_ID +#define EFI_ACPI_OEM_ID {'B','C','2','8','3','6'} +#endif + /* * Note: Use ACPI 5.1 since we need to match MADT ACPI requirements */ --=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 (#56398): https://edk2.groups.io/g/devel/message/56398 Mute This Topic: https://groups.io/mt/72561826/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 Fri Apr 19 06:02:43 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+56399+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+56399+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1585223624; cv=none; d=zohomail.com; s=zohoarc; b=DezwiZhbM7DBiVxhgHfHV/dg91NEvSDu8TUijchmLST/raVNQq+A4fBX6Ki/PMpZJHTcyIDOk7rgQw+BDlINUBYsnjpkQmAmyUu+IjYH0R3duR7p2e19XjJY15quXoHiHPGbJ5AprifWVPaWf/Qm8xY6GqKZle2DVsWN58F4/pY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585223624; 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=fN2p547DVYohGo9Z3T2T+HeBP8nzLxK6cI+72sfszeY=; b=ifdt0kqUlkjw7Kny/Bj48Aa+pRvwxn2haRv7ZlVo/TwLuFEiqNYHU7aCvg7pjIG6A+C2wTNDhzUcsKnLMbdqeTVAYtT7awDHTsa/z3ccmMv3tOdzzMVJuTjADeTQAcfdkLvB1SFdRnWhY6mlHleq6hmOLryWaW8Av8r54ibbyWY= 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+56399+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585223624919537.7015483814396; Thu, 26 Mar 2020 04:53:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id xsw0YY1788612xkCYYf3wUvP; Thu, 26 Mar 2020 04:53:44 -0700 X-Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mx.groups.io with SMTP id smtpd.web11.35102.1585223623543478808 for ; Thu, 26 Mar 2020 04:53:44 -0700 X-Received: by mail-ed1-f46.google.com with SMTP id cw6so5741729edb.9 for ; Thu, 26 Mar 2020 04:53:43 -0700 (PDT) X-Gm-Message-State: ZMGVJPALPavSCbZo8ORTLe5gx1787277AA= X-Google-Smtp-Source: ADFU+vsyR4JNzhVI19Zggv+NA/xU3oSJ1Csynz9r18Wcda1zAuIcuRvKdIp/SEHqnXZFcD5tfFSM+Q== X-Received: by 2002:a17:906:af6e:: with SMTP id os14mr7638467ejb.34.1585223621298; Thu, 26 Mar 2020 04:53:41 -0700 (PDT) X-Received: from localhost.localdomain ([84.203.78.33]) by smtp.gmail.com with ESMTPSA id bs8sm240534ejb.92.2020.03.26.04.53.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 04:53:40 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-devel] [edk2-platforms][PATCH 5/6] Platform/RPi/AcpiTables: Move GPU devices into a separate ASL file Date: Thu, 26 Mar 2020 11:53:21 +0000 Message-Id: <20200326115322.2880-6-pete@akeo.ie> In-Reply-To: <20200326115322.2880-1-pete@akeo.ie> References: <20200326115322.2880-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=1585223624; bh=43BLnVM+JYawTZo1cnjwchM1hyStkBYOqY9nZL3Yh6M=; h=Cc:Date:From:Reply-To:Subject:To; b=MBJqg++SDi/y3OSgjMkF0b3G6xqsrKjzBeGgz7JyfuhUYw+KS5IYg58IRP5L+w/Wx6i Qem4aQaKIHDXagbE5gtIfOUVCMgMuvw0Yd3kmfz3CziTSK7KDazD544DEXuKKxODKRpj0 Q3aRHo2E3QgoHQ4kmmh2z6qVUXIUHeh34wo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Andrei Warkentin In order to describe the DMA constraints of legacy devices behind the Raspberry Pi GPU/VideoCore, we move them into their own separate ASL file. This is a straight copy of the existing content from Dsdt.asl, with no alteration, so that the changes applied in the next patch are made more obvious. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/AcpiTables/Dsdt.asl | 382 +------------------ Platform/RaspberryPi/AcpiTables/GpuDevs.asl | 393 ++++++++++++++++++++ 2 files changed, 394 insertions(+), 381 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryP= i/AcpiTables/Dsdt.asl index 1ca55ff12e35..6b0fb7161718 100644 --- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl @@ -29,7 +29,6 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI", = 2) { Scope (\_SB_) { - include ("Sdhc.asl") include ("Pep.asl") #if (RPI_MODEL =3D=3D 4) include ("Xhci.asl") @@ -75,222 +74,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI"= , 2) } } =20 - // 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, - BCM2386_GPIO_INTERRUPT2, BCM2386_GPIO_INTERRUPT3 - } - }) - Method (_CRS, 0x0, Serialized) - { - MEMORY32SETBASE (RBUF, RMEM, RBAS, GPIO_OFFSET) - Return (^RBUF) - } - } + include ("GpuDevs.asl") =20 #if (RPI_MODEL =3D=3D 4) Device (ETH0) @@ -323,169 +107,5 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RP= I", 2) } #endif =20 - // 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 } - PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, Resourc= eConsumer, , ) { 2, 3 } - }) - 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 } - PinFunction (Exclusive, PullDown, BCM_ALT0, "\\_SB.GPI0", 0, Resou= rceConsumer, , ) { 9, 10, 11 } // MISO, MOSI, SCLK - PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, Resourc= eConsumer, , ) { 8 } // CE0 - PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, Resourc= eConsumer, , ) { 7 } // CE1 - }) - - 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 } - PinFunction (Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0", 0, Resou= rceConsumer, , ) { 19, 20, 21 } // MISO, MOSI, SCLK - PinFunction (Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0", 0, Resou= rceConsumer, , ) { 16 } // CE2 - }) - - 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/AcpiTables/GpuDevs.asl b/Platform/Raspber= ryPi/AcpiTables/GpuDevs.asl new file mode 100644 index 000000000000..99f03333abcf --- /dev/null +++ b/Platform/RaspberryPi/AcpiTables/GpuDevs.asl @@ -0,0 +1,393 @@ +/** @file + * + * [DSDT] Devices behind the GPU. + * + * Copyright (c) 2018-2020, Andrey Warkentin + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + **/ + +// 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) { BCM2836_U= SB_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) { BCM2836_V= 3D_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) { BCM283= 6_HVS_INTERRUPT } + + // PixelValve0 - DSI0 or DPI + // MEMORY32FIXED (ReadWrite, BCM2836_PV0_BASE_ADDRESS, BCM2836_PV0_LEN= GTH, RM03) + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM283= 6_PV0_INTERRUPT } + + // PixelValve1 - DS1 or SMI + // MEMORY32FIXED (ReadWrite, BCM2836_PV1_BASE_ADDRESS, BCM2836_PV1_LEN= GTH, RM04) + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM283= 6_PV1_INTERRUPT } + + // PixelValve2 - HDMI output - connected to HVS display FIFO 1 + MEMORY32FIXED (ReadWrite, 0, BCM2836_PV2_LENGTH, RM05) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_P= V2_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) { BCM283= 6_HDMI0_INTERRUPT } + // hdmi_int[1] + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM283= 6_HDMI1_INTERRUPT } + + // HDMI DDC connection + I2CSerialBus (0x50,, 100000,, "\\_SB.I2C2",,,,) // EDID + I2CSerialBus (0x30,, 100000,, "\\_SB.I2C2",,,,) // E-DDC Segment Poin= ter + }) + 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.ComponentType (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[] package + { + Package () // F0 + { + 0, // DXGK_POWER_RUNTIME_STATE.TransitionLatency + 0, // DXGK_POWER_RUNTIME_STATE.ResidencyRequirement + 1210000, // DXGK_POWER_RUNTIME_STATE.NominalPower (microwa= tt) + }, + + Package () // F1 - Placeholder + { + 10000, // DXGK_POWER_RUNTIME_STATE.TransitionLatency + 10000, // DXGK_POWER_RUNTIME_STATE.ResidencyRequirement + 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) { BCM2836_M= BOX_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) { BCM2836_V= CHIQ_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, + BCM2386_GPIO_INTERRUPT2, BCM2386_GPIO_INTERRUPT3 + } + }) + Method (_CRS, 0x0, Serialized) + { + MEMORY32SETBASE (RBUF, RMEM, RBAS, GPIO_OFFSET) + Return (^RBUF) + } +} + +// 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 } + PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, ResourceCon= sumer, , ) { 2, 3 } + }) + 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 } + PinFunction (Exclusive, PullDown, BCM_ALT0, "\\_SB.GPI0", 0, ResourceC= onsumer, , ) { 9, 10, 11 } // MISO, MOSI, SCLK + PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, ResourceCon= sumer, , ) { 8 } // CE0 + PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, ResourceCon= sumer, , ) { 7 } // CE1 + }) + + 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_SPI= 1_INTERRUPT } + PinFunction (Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0", 0, ResourceC= onsumer, , ) { 19, 20, 21 } // MISO, MOSI, SCLK + PinFunction (Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0", 0, ResourceC= onsumer, , ) { 16 } // CE2 + }) + + 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,) { BCM283= 6_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_PWM_BU= S_LENGTH, ) + // PWM control uncached + MEMORY32FIXED (ReadWrite, BCM2836_PWM_CTRL_UNCACHED_BASE_ADDRESS, BCM2= 836_PWM_CTRL_UNCACHED_LENGTH, ) + // PWM clock control + MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_CLK_LENGTH, RM03) + // Interrupt DMA channel 11 + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_D= MA_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") +include ("Sdhc.asl") --=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 (#56399): https://edk2.groups.io/g/devel/message/56399 Mute This Topic: https://groups.io/mt/72561828/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 Fri Apr 19 06:02:43 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+56400+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+56400+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1585223626; cv=none; d=zohomail.com; s=zohoarc; b=i2EuBEk5WqxCVfyXj/3F5nPJ4Mc/RE9Iq+JiDwTxh000S8ieq438h27W66P25Myl3XLPR/hW9degqfjwIQXVmF6GsodLMXnkUWXbaU0NTWm+ONKtL0bFsKXfGQw5a4ePV/FsEbhfxIckDbkWJPw4jQLnRMFwswBn7CI422P2pQQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585223626; 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=8wY1j7X9fudTLbXsDEkGCmUlB8JClJ14Zy6wECTf/zE=; b=dD4QFd8BN0g9HXpY2OQfAxKQsVDYDRN95KZzn37HRB7gAdi6IU64RMedDDtKmAQ4E7LVEqC9Qjnrpy9S9pO80J/2cben8oIa/oOOpCeRdwKl+CkqeV8h/YgLIg6SV6dYxctiN7v0VzQqh0fqjvKWVJg0VS2N2mI6QjVOAl9naZw= 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+56400+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585223626258725.8233618658837; Thu, 26 Mar 2020 04:53:46 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id LyXFYY1788612xeaJZjRnSQU; Thu, 26 Mar 2020 04:53:45 -0700 X-Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by mx.groups.io with SMTP id smtpd.web11.35104.1585223624756359499 for ; Thu, 26 Mar 2020 04:53:45 -0700 X-Received: by mail-ed1-f68.google.com with SMTP id i24so6486372eds.1 for ; Thu, 26 Mar 2020 04:53:44 -0700 (PDT) X-Gm-Message-State: VnpxqpFZ8kzh73QIXKD0QDBPx1787277AA= X-Google-Smtp-Source: ADFU+vvIUiKPnpaTdGBEX6wS08ZpHbERezgH+EoPMwCnERa5ddI5q2fPJvlWGaZ5W+d6GHTuSw8NIA== X-Received: by 2002:aa7:c64a:: with SMTP id z10mr7811901edr.126.1585223622671; Thu, 26 Mar 2020 04:53:42 -0700 (PDT) X-Received: from localhost.localdomain ([84.203.78.33]) by smtp.gmail.com with ESMTPSA id bs8sm240534ejb.92.2020.03.26.04.53.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 04:53:42 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com, awarkentin@vmware.com Subject: [edk2-devel] [edk2-platforms][PATCH 6/6] Platform/RPi/AcpiTables: Describe DMA constraints for devices behind GPU Date: Thu, 26 Mar 2020 11:53:22 +0000 Message-Id: <20200326115322.2880-7-pete@akeo.ie> In-Reply-To: <20200326115322.2880-1-pete@akeo.ie> References: <20200326115322.2880-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=1585223625; bh=pcUUABDbcXLI+Uqfg5DcFhlGDs8WanGa/S3uDvoiLws=; h=Cc:Date:From:Reply-To:Subject:To; b=ZPqZCeapcLM60qXu+8et4PFbR7yPVXv+26dN6GI+YfxQIpb485x1YPxpf6rTNElu4Nc T/wQ96NeJ3WWeHl6lm9xLlxKNkdIKqpBeCfG+Q/Qw+2l1UpZCbkcB6aW/38mEXzRDQ0Wi qOIkpSpcuxRKK2S55/b0jZ54zhhoB1DKSPU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Andrei Warkentin Legacy devices on a Raspberry Pi sit behind GPU/VideoCore and can only address the first GB of RAM. This address range of 0xc0000000-0xffffffff requires a translation, since it is aliased to the first GB of memory 0x00000000-0x3fffffff, which is what this commit accomplishes by introducing a new "GDV0" device along with a "_DMA" ResourceTemplate that performs the address translation. Note that this translation does not apply to the ARM cores, PCIe, GENET, and 40-bit DMA channels, that all have a wider view of the address space. Signed-off-by: Pete Batard Reviewed-by: Ard Biesheuvel --- Platform/RaspberryPi/AcpiTables/Dsdt.asl | 139 +++++++++++++++++++- Platform/RaspberryPi/AcpiTables/GpuDevs.asl | 24 ++-- 2 files changed, 149 insertions(+), 14 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryP= i/AcpiTables/Dsdt.asl index 6b0fb7161718..95766b007404 100644 --- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl @@ -3,7 +3,7 @@ * Differentiated System Definition Table (DSDT) * * Copyright (c) 2020, Pete Batard - * Copyright (c) 2018, Andrey Warkentin + * Copyright (c) 2018-2020, Andrey Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include =20 #include "AcpiTables.h" @@ -25,6 +27,25 @@ #define BCM_ALT4 0x3 #define BCM_ALT5 0x2 =20 +// +// The ASL compiler does not support argument arithmetic in functions +// like QWordMemory (). So we need to instantiate dummy qword regions +// that we can then update the Min, Max and Length attributes of. +// The two macros below help accomplish this. +// +#define QWORDMEMORYBUF(Index) \ + QWordMemory (ResourceProducer,, \ + MinFixed, MaxFixed, NonCacheable, ReadWrite, \ + 0x0, 0x0, 0x0, 0x0, 0x1,,, RB ## Index) + +#define QWORDMEMORYSET(Index, Offset, Length) \ + CreateQwordField (RBUF, RB ## Index._MIN, MI ## Index) \ + CreateQwordField (RBUF, RB ## Index._MAX, MA ## Index) \ + CreateQwordField (RBUF, RB ## Index._LEN, LE ## Index) \ + Store (Length, LE ## Index) \ + Add (BCM2836_SOC_REGISTERS, Offset, MI ## Index) \ + Add (MI ## Index, LE ## Index - 1, MA ## Index) + DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI", 2) { Scope (\_SB_) @@ -74,7 +95,121 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI"= , 2) } } =20 - include ("GpuDevs.asl") + // + // GPU device container describes the DMA translation required + // when a device behind the GPU wants to access Arm memory. + // Only the first GB can be addressed. + // + Device (GDV0) + { + Name (_HID, "ACPI0004") + Name (_UID, 0x1) + Name (_CCA, 0x0) + + Method (_CRS, 0, Serialized) { + // + // Container devices with _DMA must have _CRS, meaning GDV0 + // to provide all resources that GpuDevs.asl consume (except + // interrupts). + // + Name (RBUF, ResourceTemplate () { + QWORDMEMORYBUF(01) + QWORDMEMORYBUF(02) + QWORDMEMORYBUF(03) + // QWORDMEMORYBUF(04) + // QWORDMEMORYBUF(05) + QWORDMEMORYBUF(06) + QWORDMEMORYBUF(07) + QWORDMEMORYBUF(08) + QWORDMEMORYBUF(09) + QWORDMEMORYBUF(10) + QWORDMEMORYBUF(11) + QWORDMEMORYBUF(12) + QWORDMEMORYBUF(13) + QWORDMEMORYBUF(14) + QWORDMEMORYBUF(15) + // QWORDMEMORYBUF(16) + QWORDMEMORYBUF(17) + QWORDMEMORYBUF(18) + QWORDMEMORYBUF(19) + QWORDMEMORYBUF(20) + QWORDMEMORYBUF(21) + QWORDMEMORYBUF(22) + QWORDMEMORYBUF(23) + QWORDMEMORYBUF(24) + QWORDMEMORYBUF(25) + }) + + // USB + QWORDMEMORYSET(01, BCM2836_USB_OFFSET, BCM2836_USB_LENGTH) + + // GPU + QWORDMEMORYSET(02, BCM2836_V3D_BUS_OFFSET, BCM2836_V3D_BUS_LENGTH) + QWORDMEMORYSET(03, BCM2836_HVS_OFFSET, BCM2836_HVS_LENGTH) + // QWORDMEMORYSET(04, BCM2836_PV0_OFFSET, BCM2836_PV0_LENGTH) + // QWORDMEMORYSET(05, BCM2836_PV1_OFFSET, BCM2836_PV1_LENGTH) + QWORDMEMORYSET(06, BCM2836_PV2_OFFSET, BCM2836_PV2_LENGTH) + QWORDMEMORYSET(07, BCM2836_HDMI0_OFFSET, BCM2836_HDMI0_LENGTH) + QWORDMEMORYSET(08, BCM2836_HDMI1_OFFSET, BCM2836_HDMI1_LENGTH) + + // Mailbox + QWORDMEMORYSET(09, BCM2836_MBOX_OFFSET, BCM2836_MBOX_LENGTH) + + // VCHIQ + QWORDMEMORYSET(10, BCM2836_VCHIQ_OFFSET, BCM2836_VCHIQ_LENGTH) + + // GPIO + QWORDMEMORYSET(11, GPIO_OFFSET, GPIO_LENGTH) + + // I2C + QWORDMEMORYSET(12, BCM2836_I2C1_OFFSET, BCM2836_I2C1_LENGTH) + QWORDMEMORYSET(13, BCM2836_I2C2_OFFSET, BCM2836_I2C2_LENGTH) + + // SPI + QWORDMEMORYSET(14, BCM2836_SPI0_OFFSET, BCM2836_SPI0_LENGTH) + QWORDMEMORYSET(15, BCM2836_SPI1_OFFSET, BCM2836_SPI1_LENGTH) + // QWORDMEMORYSET(16, BCM2836_SPI2_OFFSET, BCM2836_SPI2_LENGTH) + + // PWM + QWORDMEMORYSET(17, BCM2836_PWM_DMA_OFFSET, BCM2836_PWM_DMA_LENGTH) + QWORDMEMORYSET(18, BCM2836_PWM_CTRL_OFFSET, BCM2836_PWM_CTRL_LENGT= H) + QWORDMEMORYSET(19, BCM2836_PWM_BUS_BASE_ADDRESS, BCM2836_PWM_BUS_L= ENGTH) + QWORDMEMORYSET(20, BCM2836_PWM_CTRL_UNCACHED_BASE_ADDRESS, BCM2836= _PWM_CTRL_UNCACHED_LENGTH) + QWORDMEMORYSET(21, BCM2836_PWM_CLK_OFFSET, BCM2836_PWM_CLK_LENGTH) + + // UART + QWORDMEMORYSET(22, BCM2836_PL011_UART_OFFSET, BCM2836_PL011_UART_L= ENGTH) + QWORDMEMORYSET(23, BCM2836_MINI_UART_OFFSET, BCM2836_MINI_UART_LEN= GTH) + + // SDC + QWORDMEMORYSET(24, MMCHS1_OFFSET, MMCHS1_LENGTH) + QWORDMEMORYSET(25, SDHOST_OFFSET, SDHOST_LENGTH) + + Return (RBUF) + } + + Name (_DMA, ResourceTemplate() { + // + // Only the first GB is available. + // Bus 0xC0000000 -> CPU 0x00000000. + // + QWordMemory (ResourceConsumer, + , + MinFixed, + MaxFixed, + NonCacheable, + ReadWrite, + 0x0, + 0x00000000C0000000, // MIN + 0x00000000FFFFFFFF, // MAX + 0xFFFFFFFF40000000, // TRA + 0x0000000040000000, // LEN + , + , + ) + }) + include ("GpuDevs.asl") + } =20 #if (RPI_MODEL =3D=3D 4) Device (ETH0) diff --git a/Platform/RaspberryPi/AcpiTables/GpuDevs.asl b/Platform/Raspber= ryPi/AcpiTables/GpuDevs.asl index 99f03333abcf..966a94cdb5b5 100644 --- a/Platform/RaspberryPi/AcpiTables/GpuDevs.asl +++ b/Platform/RaspberryPi/AcpiTables/GpuDevs.asl @@ -75,8 +75,8 @@ Device (GPU0) // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM283= 6_HDMI1_INTERRUPT } =20 // HDMI DDC connection - I2CSerialBus (0x50,, 100000,, "\\_SB.I2C2",,,,) // EDID - I2CSerialBus (0x30,, 100000,, "\\_SB.I2C2",,,,) // E-DDC Segment Poin= ter + I2CSerialBus (0x50,, 100000,, "\\_SB.GDV0.I2C2",,,,) // EDID + I2CSerialBus (0x30,, 100000,, "\\_SB.GDV0.I2C2",,,,) // E-DDC Segment= Pointer }) Method (_CRS, 0x0, Serialized) { @@ -167,7 +167,7 @@ Device (VCIQ) Name (_CID, "VCIQ") Name (_UID, 0) Name (_CCA, 0x0) - Name (_DEP, Package() { \_SB.RPIQ }) + Name (_DEP, Package() { \_SB.GDV0.RPIQ }) Method (_STA) { Return (0xf) @@ -192,7 +192,7 @@ Device (VCSM) Name (_CID, "VCSM") Name (_UID, 0) Name (_CCA, 0x0) - Name (_DEP, Package() { \_SB.VCIQ }) + Name (_DEP, Package() { \_SB.GDV0.VCIQ }) Method (_STA) { Return (0xf) @@ -241,7 +241,7 @@ Device (I2C1) { MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C1_LENGTH, RMEM) Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_I2C1= _INTERRUPT } - PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, ResourceCon= sumer, , ) { 2, 3 } + PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GDV0.GPI0", 0, Resour= ceConsumer, , ) { 2, 3 } }) Method (_CRS, 0x0, Serialized) { @@ -289,9 +289,9 @@ Device (SPI0) { MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI0_LENGTH, RMEM) Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_SPI0= _INTERRUPT } - PinFunction (Exclusive, PullDown, BCM_ALT0, "\\_SB.GPI0", 0, ResourceC= onsumer, , ) { 9, 10, 11 } // MISO, MOSI, SCLK - PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, ResourceCon= sumer, , ) { 8 } // CE0 - PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, ResourceCon= sumer, , ) { 7 } // CE1 + PinFunction (Exclusive, PullDown, BCM_ALT0, "\\_SB.GDV0.GPI0", 0, Reso= urceConsumer, , ) { 9, 10, 11 } // MISO, MOSI, SCLK + PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GDV0.GPI0", 0, Resour= ceConsumer, , ) { 8 } // CE0 + PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GDV0.GPI0", 0, Resour= ceConsumer, , ) { 7 } // CE1 }) =20 Method (_CRS, 0x0, Serialized) @@ -307,7 +307,7 @@ Device (SPI1) Name (_CID, "BCMAUXSPI") Name (_UID, 0x1) Name (_CCA, 0x0) - Name (_DEP, Package() { \_SB.RPIQ }) + Name (_DEP, Package() { \_SB.GDV0.RPIQ }) Method (_STA) { Return (0xf) @@ -316,8 +316,8 @@ Device (SPI1) { MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI1_LENGTH, RMEM) Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { BCM2836_SPI= 1_INTERRUPT } - PinFunction (Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0", 0, ResourceC= onsumer, , ) { 19, 20, 21 } // MISO, MOSI, SCLK - PinFunction (Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0", 0, ResourceC= onsumer, , ) { 16 } // CE2 + PinFunction (Exclusive, PullDown, BCM_ALT4, "\\_SB.GDV0.GPI0", 0, Reso= urceConsumer, , ) { 19, 20, 21 } // MISO, MOSI, SCLK + PinFunction (Exclusive, PullDown, BCM_ALT4, "\\_SB.GDV0.GPI0", 0, Reso= urceConsumer, , ) { 16 } // CE2 }) =20 Method (_CRS, 0x0, Serialized) @@ -334,7 +334,7 @@ Device (SPI1) // Name (_CID, "BCMAUXSPI") // Name (_UID, 0x2) // Name (_CCA, 0x0) -// Name (_DEP, Package() { \_SB.RPIQ }) +// Name (_DEP, Package() { \_SB.GDV0.RPIQ }) // Method (_STA) // { // Return (0xf) // Disabled --=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 (#56400): https://edk2.groups.io/g/devel/message/56400 Mute This Topic: https://groups.io/mt/72561829/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-