From nobody Sat May 4 04:02:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+76396+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76396+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1623426744; cv=none; d=zohomail.com; s=zohoarc; b=Vr+l/bzEL6js5unXySx/cPuj/hS6963aWjV6fcWfQ7rabeXqKFnnnCi+Ow4wzzWdVnn6K2/y9gXEfyN+VK1BVbZafcm9nShqnWWHIV9nl1l33xH0M12Y5EwW0xFu3zAmHwWAuM5x+4aFM4Tb1acI2Zlk+kveAq4qvR7wt6lwvsI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623426744; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=uUKwJniwJuj1dLxNEOxsPlKQLXI3N5XtJb3un0/a8Ok=; b=gW9LIomjScNFTK5Kpo7te+zXiL+e9L5FFDsV4qmlyasVIJS3OxDQ3k1u9TWEA5duQ2U+SuJArR9K/LWTnnQRDnG0Jid4yUT7HfmnVF9XbXJERQrXjm9VNrozYgI6I+j+lxGL8sEsM3XRiREasubvCjkzAw5StllrLFvE52X8W3s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76396+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1623426744490571.1901402563133; Fri, 11 Jun 2021 08:52:24 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id xOrqYY1788612xQRDs5Xrbax; Fri, 11 Jun 2021 08:52:24 -0700 X-Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mx.groups.io with SMTP id smtpd.web11.10459.1623426743566688914 for ; Fri, 11 Jun 2021 08:52:23 -0700 X-Received: by mail-pf1-f178.google.com with SMTP id k15so4788829pfp.6 for ; Fri, 11 Jun 2021 08:52:23 -0700 (PDT) X-Gm-Message-State: f9UKxzn1BTYstSRvxQkHNZLGx1787277AA= X-Google-Smtp-Source: ABdhPJywdiCoEhmYH+OqNxIMEd80na0v/1pICZdPJFww2dXdPfuCMceJ288LFH0Gm//sZ7UL2KlTpA== X-Received: by 2002:a65:5684:: with SMTP id v4mr4163601pgs.218.1623426742982; Fri, 11 Jun 2021 08:52:22 -0700 (PDT) X-Received: from embedded-PC.puresoft.int ([125.63.92.170]) by smtp.gmail.com with ESMTPSA id h8sm5458689pjf.7.2021.06.11.08.52.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jun 2021 08:52:22 -0700 (PDT) From: "Vikas Singh via groups.io" To: devel@edk2.groups.io Cc: sami.mujawar@arm.com, leif@nuviainc.com, meenakshi.aggarwal@nxp.com, samer.el-haj-mahmoud@arm.com, v.sethi@nxp.com, arokia.samy@puresoftware.com, kuldip.dwivedi@puresoftware.com, ard.biesheuvel@arm.com, vikas.singh@nxp.com, Sunny.Wang@arm.com Subject: [edk2-devel] [PATCH V1 1/4] Platform/NXP: Add generic log in CM to print SoC version Date: Fri, 11 Jun 2021 21:21:57 +0530 Message-Id: <20210611155200.15535-2-vikas.singh@puresoftware.com> In-Reply-To: <20210611155200.15535-1-vikas.singh@puresoftware.com> References: <20210611155200.15535-1-vikas.singh@puresoftware.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,vikas.singh@puresoftware.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1623426744; bh=Ki+Hivm4Vgz1WitOwHm6RQnrlxCV3Me0HqkzMbzhMrA=; h=Cc:Date:From:Reply-To:Subject:To; b=l5QlVK2T3ELibYtzINNDjy7edePJ3ThYmsIUN5fj9Q9CCCjV86mqSGMJ9vvK7UR6tQx RJZQ0jCj2xWa4y7MEFbDqkNBSwtPMoba88xro/e5FGL/H2Nc2qPIGYN/tyloI0nOEgoFr vERI32wr7jU4IL8ubEELxf0d9KrEmIvE5UA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Summary - 1.Configuration Manager(CM) is a common implementation and should not evaluate the SoC version using macro's However CM must directly consume SoC ver string from platfrom who is extending CM services for ACPI table generation. 2.Platforms who extends CM services for themselves must notify their SoC details to CM. 3.This patch will update the lx2160ardb platform header also with PLAT_SOC_NAME, this will be consumed by CM. Signed-off-by: Vikas Singh --- Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/Configuration= Manager.c | 10 +++------- Platform/NXP/LX2160aRdbPkg/Include/Platform.h = | 5 ++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/C= onfigurationManager.c b/Platform/NXP/ConfigurationManagerPkg/ConfigurationM= anagerDxe/ConfigurationManager.c index 80ce8412c4..dc1a7f5f85 100644 --- a/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/Configur= ationManager.c +++ b/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/Configur= ationManager.c @@ -2,7 +2,7 @@ Configuration Manager Dxe =20 Copyright 2020 NXP - Copyright 2020 Puresoftware Ltd + Copyright 2020-2021 Puresoftware Ltd =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -170,12 +170,8 @@ InitializePlatformRepository ( PlatformRepo =3D This->PlatRepoInfo; =20 Svr =3D SocGetSvr (); - if (SVR_SOC_VER(Svr) =3D=3D SVR_LX2160A) { - PlatformRepo->FslBoardRevision =3D SVR_MAJOR(Svr); - DEBUG ((DEBUG_INFO, "Fsl : SoC LX2160A Rev =3D 0x%x\n", PlatformRepo->= FslBoardRevision)); - } else { - DEBUG ((DEBUG_INFO, "Fsl : SoC Unknown Rev =3D 0x%x\n", PlatformRepo->= FslBoardRevision)); - } + PlatformRepo->FslBoardRevision =3D SVR_MAJOR(Svr); + DEBUG ((DEBUG_INFO, "Fsl : SoC =3D %s Rev =3D 0x%x\n", PLAT_SOC_NAME, Pl= atformRepo->FslBoardRevision)); =20 return EFI_SUCCESS; } diff --git a/Platform/NXP/LX2160aRdbPkg/Include/Platform.h b/Platform/NXP/L= X2160aRdbPkg/Include/Platform.h index 76a41d4369..c18faf28cd 100644 --- a/Platform/NXP/LX2160aRdbPkg/Include/Platform.h +++ b/Platform/NXP/LX2160aRdbPkg/Include/Platform.h @@ -2,7 +2,7 @@ * Platform headers * * Copyright 2020 NXP - * Copyright 2020 Puresoftware Ltd + * Copyright 2020-2021 Puresoftware Ltd * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -15,12 +15,11 @@ #define EFI_ACPI_ARM_OEM_REVISION 0x00000000 =20 // Soc defines +#define PLAT_SOC_NAME "LX2160ARDB" #define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFFFFE) #define SVR_MAJOR(svr) (((svr) >> 4) & 0xf) #define SVR_MINOR(svr) (((svr) >> 0) & 0xf) =20 -#define SVR_LX2160A 0x873600 - // PCLK #define DCFG_BASE 0x1E00000 #define DCFG_LEN 0x1FFFF --=20 2.25.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 (#76396): https://edk2.groups.io/g/devel/message/76396 Mute This Topic: https://groups.io/mt/83471705/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 Sat May 4 04:02:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+76397+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76397+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1623426753; cv=none; d=zohomail.com; s=zohoarc; b=nMULiUsTmgxMxjnfRXCn+zcpEUzgAUWdLTOwtEvDfS0FjPMRjZjqn7inv588jmVDT1icbkftEQD92Drd7L5N40QrKlnNsaKvwuwgC/a/PkXI78hGG4b3+fyraymjTAkSWboa5idyio3/0aBHRWkI8jVmixBvEAGSg9HDWwpappM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623426753; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=NhlknpkgjObQJ0Jo9Fhk+E67RUeaReDL927KMVCH1j4=; b=VvzA3owr3XpLHEf4yuJYgIYX/N/vbMy5RWwPVE7J/Bimk9aoGQwiQlh756yKyjI1UxeRPSskxlmnwVfaLJkqdwWV1cLNyhwuAWcKp6JV80WDXmlV10TBe9IW9QMns6pdqYUF8xquko8It81B7rcyLYZgXfjuxQDfQSTQytwhcQA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76397+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16234267534611012.4862456348001; Fri, 11 Jun 2021 08:52:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id uZvTYY1788612xbaORG40Xzo; Fri, 11 Jun 2021 08:52:33 -0700 X-Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mx.groups.io with SMTP id smtpd.web10.10391.1623426747655469244 for ; Fri, 11 Jun 2021 08:52:27 -0700 X-Received: by mail-pl1-f174.google.com with SMTP id x10so3044775plg.3 for ; Fri, 11 Jun 2021 08:52:27 -0700 (PDT) X-Gm-Message-State: fhGxaQHoZImPDFHFsCc25Aunx1787277AA= X-Google-Smtp-Source: ABdhPJxraVGg/c/a2QKO2WdOYZqfsYLCCBtjwvYrHP3mJ27V00YHeXFQKs9YE7l4LDJxOFabeFOO2w== X-Received: by 2002:a17:90a:1a:: with SMTP id 26mr9598689pja.187.1623426746996; Fri, 11 Jun 2021 08:52:26 -0700 (PDT) X-Received: from embedded-PC.puresoft.int ([125.63.92.170]) by smtp.gmail.com with ESMTPSA id h8sm5458689pjf.7.2021.06.11.08.52.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jun 2021 08:52:26 -0700 (PDT) From: "Vikas Singh via groups.io" To: devel@edk2.groups.io Cc: sami.mujawar@arm.com, leif@nuviainc.com, meenakshi.aggarwal@nxp.com, samer.el-haj-mahmoud@arm.com, v.sethi@nxp.com, arokia.samy@puresoftware.com, kuldip.dwivedi@puresoftware.com, ard.biesheuvel@arm.com, vikas.singh@nxp.com, Sunny.Wang@arm.com Subject: [edk2-devel] [PATCH V1 2/4] Silicon/NXP: Add support of SVR handling for LS1046FRWY Date: Fri, 11 Jun 2021 21:21:58 +0530 Message-Id: <20210611155200.15535-3-vikas.singh@puresoftware.com> In-Reply-To: <20210611155200.15535-1-vikas.singh@puresoftware.com> References: <20210611155200.15535-1-vikas.singh@puresoftware.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,vikas.singh@puresoftware.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1623426753; bh=Mi76JSVejADX+LRypU4iF3qM0Z2wAL/r58mrT+7zpkc=; h=Cc:Date:From:Reply-To:Subject:To; b=LOgWbuzEfzsUB8vtlVjt+wFjR39VfV4tyI0gdmInmOv7iGbW97N3DdntzSYAgIpCv+0 9sAMR+6c8+HkHsBLYMbmmNrYF0AqHS1U81mz8kmC+hGT7V/VJADI4q95J9TdUl7VedTWu 8VcI5QWV2KBDtldMVqAwiEqk0mZK0l3+g20= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" This change set intend to add a generic method to get access to SoC's Silicon Version Register (SVR) and its handling for LS1046aFrwy platform. Signed-off-by: Vikas Singh --- Silicon/NXP/LS1046A/Library/SocLib/SocLib.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c b/Silicon/NXP/LS10= 46A/Library/SocLib/SocLib.c index 8fa6a7dd00..003f5bd82f 100644 --- a/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c +++ b/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c @@ -2,6 +2,7 @@ SoC specific Library containg functions to initialize various SoC compon= ents =20 Copyright 2017-2020 NXP + Copyright 2021 Puresoftware Ltd =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -64,6 +65,21 @@ SocGetClock ( return ReturnValue; } =20 +/** + Function to get SoC's System Version Register(SVR) + **/ +UINT32 +SocGetSvr ( + VOID + ) +{ + LS1046A_DEVICE_CONFIG *Dcfg; + + Dcfg =3D (LS1046A_DEVICE_CONFIG *)LS1046A_DCFG_ADDRESS; + + return DcfgRead32 ((UINTN)&Dcfg->Svr); +} + /** Function to select pins depending upon pcd using supplemental configuration unit(SCFG) extended RCW controlled pinmux control --=20 2.25.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 (#76397): https://edk2.groups.io/g/devel/message/76397 Mute This Topic: https://groups.io/mt/83471706/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 Sat May 4 04:02:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+76398+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76398+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1623426757; cv=none; d=zohomail.com; s=zohoarc; b=btdIkgBDk8t9LKc0vvx/gdUBTiCoWC9x3va/ooaKqW/Ue8G74kVo+Xdv05hr8IBTaM0u8xP07J8jLSnY5imaCAIpbGJI5qwe4GcVEx/3pI5suFvG+GVf7pQ4aft7xQ81LMnmfzTJbprO4SGdtDAb5cFDhjpyvUhRuzBWY+kg/qI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623426757; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=YCYBeO4d9N45Yxp1ksZMT4MsNWyfaejD0/cpouvc4YA=; b=hig62BRUneoaCetddIiZp5WEuPntppZrXxtKjLr7cFdvK++vQ5vD9zk69WSu39jdnZI6F2wEBVXOJAQBby4cgSpD7bGQ5qNWYuDALMTNitvImXf5JA1JUgbRsL1ZT57+X3E3Ctnofi7wQsRWC0RO8RgkHhC9m9Fo4E6KrJFTOYc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76398+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1623426757629860.5284520352601; Fri, 11 Jun 2021 08:52:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id gob1YY1788612xFiltwXdwQm; Fri, 11 Jun 2021 08:52:37 -0700 X-Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by mx.groups.io with SMTP id smtpd.web09.10358.1623426751681008346 for ; Fri, 11 Jun 2021 08:52:31 -0700 X-Received: by mail-pg1-f194.google.com with SMTP id 27so2817311pgy.3 for ; Fri, 11 Jun 2021 08:52:31 -0700 (PDT) X-Gm-Message-State: hPtWP3oLFEBDzTzUiXZdhWWDx1787277AA= X-Google-Smtp-Source: ABdhPJz49tHI+DZNYuhJdB8q7zW7te/KCb1PawpKZyq8OITNXvlouLuZgYeXtrOPuf2wMm0g3+vmOg== X-Received: by 2002:a62:7b4c:0:b029:2e9:cec2:e252 with SMTP id w73-20020a627b4c0000b02902e9cec2e252mr8769354pfc.56.1623426751001; Fri, 11 Jun 2021 08:52:31 -0700 (PDT) X-Received: from embedded-PC.puresoft.int ([125.63.92.170]) by smtp.gmail.com with ESMTPSA id h8sm5458689pjf.7.2021.06.11.08.52.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jun 2021 08:52:30 -0700 (PDT) From: "Vikas Singh via groups.io" To: devel@edk2.groups.io Cc: sami.mujawar@arm.com, leif@nuviainc.com, meenakshi.aggarwal@nxp.com, samer.el-haj-mahmoud@arm.com, v.sethi@nxp.com, arokia.samy@puresoftware.com, kuldip.dwivedi@puresoftware.com, ard.biesheuvel@arm.com, vikas.singh@nxp.com, Sunny.Wang@arm.com Subject: [edk2-devel] [PATCH V1 3/4] Platform/NXP/LS1046aFrwyPkg: Extend Dynamic ACPI support Date: Fri, 11 Jun 2021 21:21:59 +0530 Message-Id: <20210611155200.15535-4-vikas.singh@puresoftware.com> In-Reply-To: <20210611155200.15535-1-vikas.singh@puresoftware.com> References: <20210611155200.15535-1-vikas.singh@puresoftware.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,vikas.singh@puresoftware.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1623426757; bh=LDK4FA44kCg8nG1eA8yJro91i43u8pM1PlO6vA4fjbY=; h=Cc:Date:From:Reply-To:Subject:To; b=LkvH4LoFBe9gDPpBamy/vv1sr49A8upnNmMpCx0nd6Jpy4iSQ+q96e3Nem1e1ubUMfC h8E2vsawwEP+8nx5wJy6aWiC1zSswcF8tAHfcripMnhEmQ9dY+dpQoUnVB3KYIpa4JsYd SUYADPjUs/usah1ypJ/+dGC6r+lLU/34l8M= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" This patch set extends Configuration Manager (CM) and its services to leverage the Dynamic ACPI support for NXP's LS1046aFrwy platform. Refer-https://edk2.groups.io/g/devel/message/71710 Signed-off-by: Vikas Singh --- Platform/NXP/LS1046aFrwyPkg/Include/Platform.h | 155 ++++++++++++++++++++ Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc | 28 ++++ Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf | 13 ++ Silicon/NXP/LS1046A/LS1046A.dsc.inc | 10 ++ 4 files changed, 206 insertions(+) diff --git a/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h b/Platform/NXP/= LS1046aFrwyPkg/Include/Platform.h new file mode 100644 index 0000000000..19e879ec6d --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h @@ -0,0 +1,155 @@ +/** @file + * Platform headers + * + * Copyright 2021 NXP + * Copyright 2021 Puresoftware Ltd + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * +**/ + + +#ifndef LS1046AFRWY_PLATFORM_H +#define LS1046AFRWY_PLATFORM_H + +#define EFI_ACPI_ARM_OEM_REVISION 0x00000000 + +// Soc defines +#define PLAT_SOC_NAME "LS1046AFRWY" +#define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFFFFE) +#define SVR_MAJOR(svr) (((svr) >> 4) & 0xf) +#define SVR_MINOR(svr) (((svr) >> 0) & 0xf) + +// Gic +#define GIC_VERSION 2 +#define GICD_BASE 0x1410000 +#define GICC_BASE 0x142f000 +#define GICH_BASE 0x1440000 +#define GICV_BASE 0x1460000 + +// UART +#define UART0_BASE 0x21C0500 +#define UART0_IT 86 +#define UART0_LENGTH 0x100 +#define SPCR_FLOW_CONTROL_NONE 0 + +// Timer +#define TIMER_BLOCK_COUNT 1 +#define TIMER_FRAME_COUNT 4 +#define TIMER_WATCHDOG_COUNT 1 +#define TIMER_BASE_ADDRESS 0x23E0000 // a.k.a CNTControlBase +#define TIMER_READ_BASE_ADDRESS 0x23F0000 // a.k.a CNTReadBase +#define TIMER_SEC_IT 29 +#define TIMER_NON_SEC_IT 30 +#define TIMER_VIRT_IT 27 +#define TIMER_HYP_IT 26 +#define TIMER_FRAME0_IT 78 +#define TIMER_FRAME1_IT 79 +#define TIMER_FRAME2_IT 92 + +// Mcfg +#define LS1046A_PCI_SEG0_CONFIG_BASE 0x4000000000 +#define LS1046A_PCI_SEG0 0x0 +#define LS1046A_PCI_SEG_BUSNUM_MIN 0x0 +#define LS1046A_PCI_SEG_BUSNUM_MAX 0xff +#define LS1046A_PCI_SEG1_CONFIG_BASE 0x4800000000 +#define LS1046A_PCI_SEG2_CONFIG_BASE 0x5000000000 +#define LS1046A_PCI_SEG1 0x1 +#define LS1046A_PCI_SEG2 0x2 + +// Platform specific info needed by Configuration Manager + +#define CFG_MGR_TABLE_ID SIGNATURE_64 ('L','S','1','0','4','6',' ',' ') + +// Specify the OEM defined tables +#define OEM_ACPI_TABLES 0 + +#define PLAT_PCI_SEG0 LS1046A_PCI_SEG0 +#define PLAT_PCI_SEG1_CONFIG_BASE LS1046A_PCI_SEG1_CONFIG_BASE +#define PLAT_PCI_SEG1 LS1046A_PCI_SEG1 +#define PLAT_PCI_SEG_BUSNUM_MIN LS1046A_PCI_SEG_BUSNUM_MIN +#define PLAT_PCI_SEG_BUSNUM_MAX LS1046A_PCI_SEG_BUSNUM_MAX +#define PLAT_PCI_SEG2_CONFIG_BASE LS1046A_PCI_SEG2_CONFIG_BASE +#define PLAT_PCI_SEG2 LS1046A_PCI_SEG2 + +#define PLAT_GIC_VERSION GIC_VERSION +#define PLAT_GICD_BASE GICD_BASE +#define PLAT_GICI_BASE GICI_BASE +#define PLAT_GICR_BASE GICR_BASE +#define PLAT_GICR_LEN GICR_LEN +#define PLAT_GICC_BASE GICC_BASE +#define PLAT_GICH_BASE GICH_BASE +#define PLAT_GICV_BASE GICV_BASE + +#define PLAT_CPU_COUNT 4 +#define PLAT_GTBLOCK_COUNT 0 +#define PLAT_GTFRAME_COUNT 0 +#define PLAT_PCI_CONFG_COUNT 2 + +#define PLAT_WATCHDOG_COUNT 0 +#define PLAT_GIC_REDISTRIBUTOR_COUNT 0 +#define PLAT_GIC_ITS_COUNT 0 + +/* GIC CPU Interface information + GIC_ENTRY (CPUInterfaceNumber, Mpidr, PmuIrq, VGicIrq, EnergyEfficiency) + */ +#define PLAT_GIC_CPU_INTERFACE { \ + GICC_ENTRY (0, GET_MPID (0, 0), 138, 0x19, 0), \ + GICC_ENTRY (1, GET_MPID (0, 1), 139, 0x19, 0), \ + GICC_ENTRY (2, GET_MPID (0, 2), 127, 0x19, 0), \ + GICC_ENTRY (3, GET_MPID (0, 3), 129, 0x19, 0), \ +} + +#define PLAT_WATCHDOG_INFO \ + { \ + } \ + +#define PLAT_TIMER_BLOCK_INFO \ + { \ + } \ + +#define PLAT_TIMER_FRAME_INFO \ + { \ + } \ + +#define PLAT_GIC_DISTRIBUTOR_INFO \ + { \ + PLAT_GICD_BASE, /* UINT64 PhysicalBaseAddress */ \ + 0, /* UINT32 SystemVectorBase */ \ + PLAT_GIC_VERSION /* UINT8 GicVersion */ \ + } \ + +#define PLAT_GIC_REDISTRIBUTOR_INFO \ + { \ + } \ + +#define PLAT_GIC_ITS_INFO \ + { \ + } \ + +#define PLAT_MCFG_INFO \ + { \ + { \ + PLAT_PCI_SEG1_CONFIG_BASE, \ + PLAT_PCI_SEG1, \ + PLAT_PCI_SEG_BUSNUM_MIN, \ + PLAT_PCI_SEG_BUSNUM_MAX, \ + }, \ + { \ + PLAT_PCI_SEG2_CONFIG_BASE, \ + PLAT_PCI_SEG2, \ + PLAT_PCI_SEG_BUSNUM_MIN, \ + PLAT_PCI_SEG_BUSNUM_MAX, \ + } \ + } \ + +#define PLAT_SPCR_INFO = \ + { = \ + UART0_BASE, = \ + UART0_IT, = \ + 115200, = \ + 0, = \ + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_16550 = \ + } = \ + +#endif // LS1046AFRWY_PLATFORM_H diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc b/Platform/NXP/= LS1046aFrwyPkg/LS1046aFrwyPkg.dsc index 67cf15cbe4..20111e6037 100755 --- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc +++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc @@ -3,6 +3,7 @@ # LS1046AFRWY Board package. # # Copyright 2019-2020 NXP +# Copyright 2021 Puresoftware Ltd # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -22,10 +23,18 @@ OUTPUT_DIRECTORY =3D Build/LS1046aFrwyPkg FLASH_DEFINITION =3D Platform/NXP/LS1046aFrwyPkg/LS1046aFr= wyPkg.fdf =20 + # This flag controls the dynamic acpi generation + # + DEFINE DYNAMIC_ACPI_ENABLE =3D TRUE + !include Silicon/NXP/NxpQoriqLs.dsc.inc !include MdePkg/MdeLibs.dsc.inc !include Silicon/NXP/LS1046A/LS1046A.dsc.inc =20 +!if $(DYNAMIC_ACPI_ENABLE) =3D=3D TRUE + !include DynamicTablesPkg/DynamicTables.dsc.inc +!endif + [LibraryClasses.common] ArmPlatformLib|Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPla= tformLib.inf RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualReal= TimeClockLib.inf @@ -46,4 +55,23 @@ =20 Silicon/NXP/Drivers/UsbHcdInitDxe/UsbHcd.inf =20 + # + # Dynamic Table Factory + !if $(DYNAMIC_ACPI_ENABLE) =3D=3D TRUE + DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe= .inf { + + NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibA= rm.inf + NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibA= rm.inf + NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibA= rm.inf + NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibA= rm.inf + NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibA= rm.inf + } + !endif + + # + # Acpi Support + # + MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf + MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf + ## diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf b/Platform/NXP/= LS1046aFrwyPkg/LS1046aFrwyPkg.fdf index 34c4e5a025..f3cac033bc 100755 --- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf +++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf @@ -3,6 +3,7 @@ # FLASH layout file for LS1046a board. # # Copyright 2019-2020 NXP +# Copyright 2021 Puresoftware Ltd # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -99,6 +100,18 @@ READ_LOCK_STATUS =3D TRUE INF MdeModulePkg/Universal/Metronome/Metronome.inf INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf =20 + + # + # Acpi Support + # + INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf + INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf + + !if $(DYNAMIC_ACPI_ENABLE) =3D=3D TRUE + INF Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/Confi= gurationManagerDxe.inf + !include DynamicTablesPkg/DynamicTables.fdf.inc + !endif + # # Multiple Console IO support # diff --git a/Silicon/NXP/LS1046A/LS1046A.dsc.inc b/Silicon/NXP/LS1046A/LS10= 46A.dsc.inc index 7004533ed5..98f999edfd 100644 --- a/Silicon/NXP/LS1046A/LS1046A.dsc.inc +++ b/Silicon/NXP/LS1046A/LS1046A.dsc.inc @@ -2,6 +2,7 @@ # LS1046A Soc package. # # Copyright 2017-2020 NXP +# Copyright 2021 Puresoftware Ltd # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -48,4 +49,13 @@ [Components.common] MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf =20 +# +# Configuration Manager +!if $(DYNAMIC_ACPI_ENABLE) =3D=3D TRUE + Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/Configurati= onManagerDxe.inf { + + *_*_*_PLATFORM_FLAGS =3D -I$(WORKSPACE)/Platform/NXP/LS1046aFrwyPkg/= Include + } +!endif + ## --=20 2.25.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 (#76398): https://edk2.groups.io/g/devel/message/76398 Mute This Topic: https://groups.io/mt/83471709/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 Sat May 4 04:02:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+76399+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76399+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1623426762; cv=none; d=zohomail.com; s=zohoarc; b=UB2TFlrsh5gHtdVNA7Y+BUNro2PvwekIOzB5OBKM65+VHGO8EiDEwjBTft0xSEDiHrWIf9ppd1q7e+JZvpsjHH7E//5Ro4CTcSUEpLX9v7Plzuv+oDv17kdrq9T4bUwflWWWL2jCp+o7JzuCnoGh27jnz5d2N1hDDKTYrZRfiXc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623426762; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=bONpaOwqA3RyqVO9VdjYyZgVOg3p2SmjXDMTEn04rqQ=; b=YGgrzPwr5St94xpvNAB54Lx91DW6wkCNwtF7NiXa4/IvY4BnrlocDYNZzOIo6YKaFsNkxecBlH14a40vCb/hCBtIz9n+4nS7IJeot/0A2I+F3FXI4aHXLpH0oJc5VndjzqlSrT4WksftVeE1M+sDKBx3Sl5ivAdlpE3phoxz1+4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76399+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1623426762016348.0452243904217; Fri, 11 Jun 2021 08:52:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8sytYY1788612xcqu4CeFwhI; Fri, 11 Jun 2021 08:52:41 -0700 X-Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mx.groups.io with SMTP id smtpd.web08.10579.1623426755543765496 for ; Fri, 11 Jun 2021 08:52:35 -0700 X-Received: by mail-pl1-f173.google.com with SMTP id v12so3033672plo.10 for ; Fri, 11 Jun 2021 08:52:35 -0700 (PDT) X-Gm-Message-State: atZTSFO5tWK22uBgaClY3QdDx1787277AA= X-Google-Smtp-Source: ABdhPJxoFeyRJGxiidjNM605eC2LXbfvn/6tOYs6mC9+/O4eB6AlNMSBOIX+dn2xMI5kFKsoXjkdOA== X-Received: by 2002:a17:90b:3584:: with SMTP id mm4mr9842031pjb.171.1623426754857; Fri, 11 Jun 2021 08:52:34 -0700 (PDT) X-Received: from embedded-PC.puresoft.int ([125.63.92.170]) by smtp.gmail.com with ESMTPSA id h8sm5458689pjf.7.2021.06.11.08.52.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jun 2021 08:52:34 -0700 (PDT) From: "Vikas Singh via groups.io" To: devel@edk2.groups.io Cc: sami.mujawar@arm.com, leif@nuviainc.com, meenakshi.aggarwal@nxp.com, samer.el-haj-mahmoud@arm.com, v.sethi@nxp.com, arokia.samy@puresoftware.com, kuldip.dwivedi@puresoftware.com, ard.biesheuvel@arm.com, vikas.singh@nxp.com, Sunny.Wang@arm.com Subject: [edk2-devel] [PATCH V1 4/4] Platform/NXP/LS1046aFrwyPkg: Add OEM specific DSDT generator Date: Fri, 11 Jun 2021 21:22:00 +0530 Message-Id: <20210611155200.15535-5-vikas.singh@puresoftware.com> In-Reply-To: <20210611155200.15535-1-vikas.singh@puresoftware.com> References: <20210611155200.15535-1-vikas.singh@puresoftware.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,vikas.singh@puresoftware.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1623426761; bh=Aav0nK+NWvNJh1mQ0/vzTPjAAbt7c5BplfZ/PEoSxks=; h=Cc:Date:From:Reply-To:Subject:To; b=WvVgxWH5tygzmXU3U5Zu/o0RKgDhVljgJCdLz3PHgTe5B3OCVpljcjFtCIfMlEzzoTv gi/5oLzGMCm0XViH/wnRt/Z1eWCK8xkkkjxKOIBi5ndbsO8T1zlQ2QX/mIjDCCdJk9XF9 LsQNju2JJL+FtKLOm5Bqyto5FKP4TKx18js= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" This patch adds platform specific DSDT generator and Clk dsdt properties for LS1046AFRWY platform. Signed-off-by: Vikas Singh Reviewed-by: Leif Lindholm --- Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl = | 60 +++++++++ Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl = | 15 +++ Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf = | 39 ++++++ Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/RawDsdtG= enerator.c | 138 ++++++++++++++++++++ Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h = | 23 ++++ Platform/NXP/LS1046aFrwyPkg/Include/Platform.h = | 6 +- Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc = | 1 + 7 files changed, 281 insertions(+), 1 deletion(-) diff --git a/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl b/P= latform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl new file mode 100644 index 0000000000..58541c3019 --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.asl @@ -0,0 +1,60 @@ +/** @file +* DSDT : Dynamic Clock ACPI Information +* +* Copyright 2021 NXP +* Copyright 2021 Puresoftware Ltd. +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +Scope(_SB) +{ + Device(PCLK) { + Name(_HID, "NXP0017") + Name(CLK, 0) // Maximum Platform Clock (Hz) + Name(CCLK, 0) // Maximum CPU Core Clock (MHz) + Name(AVBL, 0) + OperationRegion(RCWS, SystemMemory, DCFG_BASE, DCFG_LEN) + Method(_REG,2) { + if (Arg0 =3D=3D "RCWS") { + Store(Arg1, AVBL) + } + } + Field (RCWS, ByteAcc, NoLock, Preserve) { + /* The below table provides the func of diff bits in 512 bits RCW da= ta: + SYS_PLL_CFG : 0-1 bits + SYS_PLL_RAT : 2-6 bits + SYSCLK_FREQ : 472-481 bits etc. + Refer LS1046ARM for more info. + For LS1046 RCWSRs are read as RCW[0:31] . + */ + offset(0x100), + RESV, 1, + PRAT, 5, + PCFG, 2, + offset(0x103), + CPRT, 6, // Cluster Group PLL Multiplier ratio + offset(0x13B), + HFRQ, 8, // Higher 8 bits of SYSCLK_FREQ + RESX, 6, + LFRQ, 2 // Lower bits of SYSCLK_FREQ + } + + Method(_INI, 0, NotSerialized) { + /* Calculating Platform Clock */ + Local0 =3D (HFRQ<<2 | LFRQ) // Concatinating LFRQ at end of HFRQ + Multiply(Local0, 500000, Local0) + Multiply(Local0, PRAT, Local0) + Divide(Local0, 3, , Local0) + Store(Local0, CLK) + + /* Calculating Maximum Core Clock */ + Local0 =3D (HFRQ<<2 | LFRQ) // Concatinating LFRQ at end of HFRQ + Multiply(Local0, 500000, Local0) + Divide(Local0, 3, , Local0) + Divide(Local0, 1000000, , Local0) //Just the MHz part of SYSCLK. + Multiply(Local0, CPRT, CCLK) // PLL_Ratio * SYSCLK, Max freq of clus= ter + } + } // end of device PCLK +} diff --git a/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl b/= Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl new file mode 100644 index 0000000000..19f3f1c0e8 --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt.asl @@ -0,0 +1,15 @@ +/** @file + Differentiated System Description Table Fields (DSDT) + + Copyright 2021 NXP + Copyright 2021 Puresoftware Ltd. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "Platform.h" + +DefinitionBlock("DsdtTable.aml", "DSDT", 2, "NXP ", "LS1046 ", EFI_ACPI_= ARM_OEM_REVISION) { + include ("Clk.asl") +} diff --git a/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdt= Lib.inf b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib= .inf new file mode 100644 index 0000000000..ed5f9dd442 --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf @@ -0,0 +1,39 @@ +## @file +# Raw Table Generator +# +# Copyright 2021 NXP +# Copyright 2021 Puresoftware Ltd +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x00010019 + BASE_NAME =3D PlatformAcpiDsdtLib + FILE_GUID =3D A97F70AC-3BB4-4596-B4D2-9F948EC12D17 + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D DXE_DRIVER + LIBRARY_CLASS =3D NULL|DXE_DRIVER + CONSTRUCTOR =3D AcpiDsdtLibConstructor + DESTRUCTOR =3D AcpiDsdtLibDestructor + +[Sources] + PlatformAcpiDsdtLib/RawDsdtGenerator.c + Dsdt/Dsdt.asl + +[Packages] + DynamicTablesPkg/DynamicTablesPkg.dec + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dec + Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerPkg.dec + +[LibraryClasses] + BaseLib + +[Pcd] + +[Protocols] + +[Guids] diff --git a/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdt= Lib/RawDsdtGenerator.c b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Plat= formAcpiDsdtLib/RawDsdtGenerator.c new file mode 100644 index 0000000000..7d886396ca --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsdtLib/Raw= DsdtGenerator.c @@ -0,0 +1,138 @@ +/** @file + Raw DSDT Table Generator + + Copyright 2021 NXP + Copyright 2021 Puresoftware Ltd. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include + +// Module specific include files. +#include +#include +#include +#include +#include + +#include "PlatformAcpiLib.h" + +/** Construct the ACPI table using the ACPI table data provided. + This function invokes the Configuration Manager protocol interface + to get the required hardware information for generating the ACPI + table. + If this function allocates any resources then they must be freed + in the FreeXXXXTableResources function. + @param [in] This Pointer to the table generator. + @param [in] AcpiTableInfo Pointer to the ACPI Table Info. + @param [in] CfgMgrProtocol Pointer to the Configuration Manager + Protocol Interface. + @param [out] Table Pointer to the constructed ACPI Table. + @retval EFI_SUCCESS Table generated successfully. + @retval EFI_INVALID_PARAMETER A parameter is invalid. +**/ +STATIC +EFI_STATUS +EFIAPI +BuildRawDsdtTable ( + IN CONST ACPI_TABLE_GENERATOR * CONST This, + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, + OUT EFI_ACPI_DESCRIPTION_HEADER ** CONST Table + ) +{ + ASSERT (This !=3D NULL); + ASSERT (AcpiTableInfo !=3D NULL); + ASSERT (CfgMgrProtocol !=3D NULL); + ASSERT (Table !=3D NULL); + ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); + + if (AcpiTableInfo->AcpiTableData =3D=3D NULL) { + // Add the dsdt aml code here. + *Table =3D (EFI_ACPI_DESCRIPTION_HEADER *)&dsdt_aml_code; + } + + return EFI_SUCCESS; +} + +/** This macro defines the Raw Generator revision. +*/ +#define DSDT_GENERATOR_REVISION CREATE_REVISION (1, 0) + +/** The interface for the Raw Table Generator. +*/ +STATIC +CONST +ACPI_TABLE_GENERATOR RawDsdtGenerator =3D { + // Generator ID + CREATE_OEM_ACPI_TABLE_GEN_ID (PlatAcpiTableIdDsdt), + // Generator Description + L"ACPI.OEM.RAW.DSDT.GENERATOR", + // ACPI Table Signature - Unused + 0, + // ACPI Table Revision - Unused + 0, + // Minimum ACPI Table Revision - Unused + 0, + // Creator ID + TABLE_GENERATOR_CREATOR_ID_ARM, + // Creator Revision + DSDT_GENERATOR_REVISION, + // Build Table function + BuildRawDsdtTable, + // No additional resources are allocated by the generator. + // Hence the Free Resource function is not required. + NULL, + // Extended build function not needed + NULL, + // Extended build function not implemented by the generator. + // Hence extended free resource function is not required. + NULL +}; + +/** Register the Generator with the ACPI Table Factory. + @param [in] ImageHandle The handle to the image. + @param [in] SystemTable Pointer to the System Table. + @retval EFI_SUCCESS The Generator is registered. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_ALREADY_STARTED The Generator for the Table ID + is already registered. +**/ +EFI_STATUS +EFIAPI +AcpiDsdtLibConstructor ( + IN CONST EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE * CONST SystemTable + ) +{ + EFI_STATUS Status; + Status =3D RegisterAcpiTableGenerator (&RawDsdtGenerator); + DEBUG ((DEBUG_INFO, "OEM: Register DSDT Generator. Status =3D %r\n", Sta= tus)); + ASSERT_EFI_ERROR (Status); + return Status; +} + +/** Deregister the Generator from the ACPI Table Factory. + @param [in] ImageHandle The handle to the image. + @param [in] SystemTable Pointer to the System Table. + @retval EFI_SUCCESS The Generator is deregistered. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_NOT_FOUND The Generator is not registered. +**/ +EFI_STATUS +EFIAPI +AcpiDsdtLibDestructor ( + IN CONST EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE * CONST SystemTable + ) +{ + EFI_STATUS Status; + Status =3D DeregisterAcpiTableGenerator (&RawDsdtGenerator); + DEBUG ((DEBUG_INFO, "OEM: Deregister DSDT Generator. Status =3D %r\n", S= tatus)); + ASSERT_EFI_ERROR (Status); + return Status; +} diff --git a/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.= h b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h new file mode 100644 index 0000000000..e5f907a7d4 --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiLib.h @@ -0,0 +1,23 @@ +/** @file + * Acpi lib headers + * + * Copyright 2021 NXP + * Copyright 2021 Puresoftware Ltd + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * +**/ + + +#ifndef LS1046AFRWY_PLATFORM_ACPI_LIB_H +#define LS1046AFRWY_PLATFORM_ACPI_LIB_H + +#include + +/** C array containing the compiled AML template. + These symbols are defined in the auto generated C file + containing the AML bytecode array. +*/ +extern CHAR8 dsdt_aml_code[]; + +#endif diff --git a/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h b/Platform/NXP/= LS1046aFrwyPkg/Include/Platform.h index 19e879ec6d..b21e875f20 100644 --- a/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h +++ b/Platform/NXP/LS1046aFrwyPkg/Include/Platform.h @@ -20,6 +20,10 @@ #define SVR_MAJOR(svr) (((svr) >> 4) & 0xf) #define SVR_MINOR(svr) (((svr) >> 0) & 0xf) =20 +// PCLK : Dynamic Clock +#define DCFG_BASE 0x1EE0000 /* Device configuration da= ta Base Address */ +#define DCFG_LEN 0xFFF /* Device configuration da= ta length */ + // Gic #define GIC_VERSION 2 #define GICD_BASE 0x1410000 @@ -62,7 +66,7 @@ #define CFG_MGR_TABLE_ID SIGNATURE_64 ('L','S','1','0','4','6',' ',' ') =20 // Specify the OEM defined tables -#define OEM_ACPI_TABLES 0 +#define OEM_ACPI_TABLES 1 // Added DSDT =20 #define PLAT_PCI_SEG0 LS1046A_PCI_SEG0 #define PLAT_PCI_SEG1_CONFIG_BASE LS1046A_PCI_SEG1_CONFIG_BASE diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc b/Platform/NXP/= LS1046aFrwyPkg/LS1046aFrwyPkg.dsc index 20111e6037..7041d15da5 100755 --- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc +++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc @@ -65,6 +65,7 @@ NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibA= rm.inf NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibA= rm.inf NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibA= rm.inf + NULL|Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformAcpiDsd= tLib.inf } !endif =20 --=20 2.25.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 (#76399): https://edk2.groups.io/g/devel/message/76399 Mute This Topic: https://groups.io/mt/83471710/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-