From nobody Tue Nov 26 04:32:00 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+58209+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+58209+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=foxmail.com ARC-Seal: i=1; a=rsa-sha256; t=1588055653; cv=none; d=zohomail.com; s=zohoarc; b=bVZ3v2xqbEbc8AvlAT7OPGhmPrxyE9SmLfPTnjXKyYPy9c90MHJLPjs1o1O0BXG23avVdiG8U0onR/boWCWDoh4EenxX5TW6c3wXAdn+/AV2QCDTiOvUMJe52FfCLCQV75DtohbGkoZine+azHuqEUpNKkzX0TTmnMFg8wNZzkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588055653; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=UZf+2GGPUa61zfx8UTrRCWVjOFymzNps9O110akeNTU=; b=P4eniN8n3kddQfnM/hw9mjFpdAHbwpERKyLhs/wzvc6g3DRrH1IRhAb4jJE6Pa11ZXqY38vJnEvayG4JTzfosDqVyBs49GOHKc9xUwtrwCC8dq9yfWieUBwBPJsvSwrNsS8QEMZT4oJn+UGDSLEErqa0S5rRa/un1gusJvpgl1M= 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+58209+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1588055653732686.3433259106577; Mon, 27 Apr 2020 23:34:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rKwFYY1788612xxs0RqMsW2T; Mon, 27 Apr 2020 23:34:13 -0700 X-Received: from qq.com (qq.com [203.205.221.155]) by mx.groups.io with SMTP id smtpd.web11.2717.1588036997130616195 for ; Mon, 27 Apr 2020 18:23:17 -0700 X-Received: from driver1998-Laptop.localdomain ([112.96.70.88]) by newxmesmtplogicsvrsza7.qq.com (NewEsmtp) with SMTP id 5C60CA11; Tue, 28 Apr 2020 09:23:06 +0800 X-QQ-mid: xmsmtpt1588036986tkqwwumkp X-QQ-XMAILINFO: MYGzeLN4m+PuiYpKhAwfX5DUxiARNT1LvYVPX1ZQMOCEdMEienWE6IXkjHJszm ptunds6584BYlzVJQyqPT3ejpMZUKHsu+561dTsyjEskEfvDpSS+XiosMeC9JrZj9N0BdQviNDtu uWYUpIo0tnPiuJiK/5PU7jkdiqWbTa1/rM1DLrUNw6jVl5KL+ab7KXZrT4yRKKD+kx6AunJ7f57V H6beBQ/ySz6s6zj3K4HG+GCDu3XtYPeDn6T8K3FWX1wuqqW8ubd3xEXISnJ+jVsWeTenTRO8mUSV 8TWi54R9eEehM8N5NjPLpICulKwSgtdya3KypgNWgneOoRUVI6pyFJBW0ABPRDiqUSVltowI6gQy g1pu+CFj1NMAVCxFIflRXUi8h8Cmxp6sbc+wigs2x00dkIJJ774nJ7cr2zncOJxvvc+EyMddPuHR UvRwbR5vfG9GBwOYy23TUZwkmhzXWXIOz3JK1Cb3GSFzc2sliNdc4k0vQNMLMHiP16kWS4W42H40 X8iphkvBSK1q+3vexA/J7A3e5lqoEH/n7keevyNbzhfM62/0ni+EOHfG75vGWX5ECiUbvg3TknV7 +UMwriVy+jcU/mZHEnAQE+BSp1MqOEhwJHrwG2zEHCTtFFA6MC8v+0aFDf8oqoV4D7eVAGz+rFMb 9udVBaq2ZeYrlHJO2T0rRftzHrla47KglSQdX+mZqioz/ydAxJ7wrJYUw= From: GH Cao To: devel@edk2.groups.io Cc: GH Cao Subject: [edk2-devel] [edk2-platforms][PATCH] Platform/RaspberryPi: Fix VPU memory ranges in GPU device container Date: Tue, 28 Apr 2020 09:22:51 +0800 Message-Id: <20200428012251.24459-1-driver1998@foxmail.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: <27952.devel.edk2.groups.io> Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,driver1998@foxmail.com X-Gm-Message-State: H9tH1MgC4rSrvHNaVQM0qOirx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588055653; bh=ro7Sgly7jrY5s5kQlsh4CGKzHqPeRfNNhru2FuPhx9g=; h=Cc:Date:From:Reply-To:Subject:To; b=EWnOtspnffkyyStbqtNxIZfUfg2K4grCs6D7vP/7Yus+KMk2UIxTmuDnyioars/PL4V KyxJAXaSCtJG6pjsxoG7pKFAx0dSzxCIe+aTms9O6ycIQLBsCSF0KC9AwjFg2bCTA1KIR gAb3qv5uEAS3AvNu9G2Ii93rZM8qe26paPs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The PWM controller device specifies both CPU and VPU memory ranges. CPU base addresses are provided as offsets to BCM2836_SOC_REGISTERS, and VPU base addresses are constants. But in Dsdt.asl, both offsets and constant addresses are seen as offsets by QWORDMEMORYSET macro, result in incorrect VPU memory ranges. This commits adds a new QWORDBUSMEMORYSET macro to handle VPU memory ranges with constant base addresses. Signed-off-by: GH Cao --- Platform/RaspberryPi/AcpiTables/Dsdt.asl | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryP= i/AcpiTables/Dsdt.asl index 95766b0..ddaf1d4 100644 --- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl @@ -31,7 +31,11 @@ // 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. +// The three macros below help accomplish this. +// +// QWORDMEMORYSET specifies a CPU memory range (whose base address is +// BCM2836_SOC_REGISTERS + Offset), and QWORDBUSMEMORYSET specifies +// a VPU memory range (whose base address is provided directly). // #define QWORDMEMORYBUF(Index) \ QWordMemory (ResourceProducer,, \ @@ -46,6 +50,14 @@ Add (BCM2836_SOC_REGISTERS, Offset, MI ## Index) \ Add (MI ## Index, LE ## Index - 1, MA ## Index) =20 +#define QWORDBUSMEMORYSET(Index, Base, Length) \ + CreateQwordField (RBUF, RB ## Index._MIN, MI ## Index) \ + CreateQwordField (RBUF, RB ## Index._MAX, MA ## Index) \ + CreateQwordField (RBUF, RB ## Index._LEN, LE ## Index) \ + Store (Base, MI ## Index) \ + Store (Length, LE ## Index) \ + Add (MI ## Index, LE ## Index - 1, MA ## Index) + DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI", 2) { Scope (\_SB_) @@ -173,8 +185,8 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI"= , 2) // 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) + QWORDBUSMEMORYSET(19, BCM2836_PWM_BUS_BASE_ADDRESS, BCM2836_PWM_BU= S_LENGTH) + QWORDBUSMEMORYSET(20, BCM2836_PWM_CTRL_UNCACHED_BASE_ADDRESS, BCM2= 836_PWM_CTRL_UNCACHED_LENGTH) QWORDMEMORYSET(21, BCM2836_PWM_CLK_OFFSET, BCM2836_PWM_CLK_LENGTH) =20 // UART --=20 2.17.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 (#58209): https://edk2.groups.io/g/devel/message/58209 Mute This Topic: https://groups.io/mt/73322163/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-