From nobody Thu May 16 21:12:16 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+75911+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+75911+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1622555463; cv=none; d=zohomail.com; s=zohoarc; b=lCfXuyoUpuI0vnEH2RJ4Tl29RGr600NNMQiJEvSELdEbg+kqlPfAeb0c4vm8bS98w5NiWDSOaOwMYW3JX3tzqbLEEVJOQVo3Dad/+1oHvElcg8snp6IJCOFxhnaX5RElPdVeR66ml1uYKRH9EnDY4y9DPD5a2edFHj1g9tRmLOQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622555463; 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=NKzRudX28qnvSJH061QMBwbb1n+Z1loPR7Oo2XocAaw=; b=Vqai3ZpELlMKUsM6X7Vkir/jxWJCZORqtbUG6TOEVOm3UnvO6mEKcIVNUib+Gd6TWT4Q0A5eezKgEybV4Wowj5YcvhrmtQdFgRi5mQLJ1XSA9nyY9mAIwx9hw4MVDbQNFASINO0InIApsPxKnZOkrDANKnFfvyaf5snpLU7U3ic= 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+75911+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162255546329476.3168412845888; Tue, 1 Jun 2021 06:51:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id VJgsYY1788612xTmUBXibykm; Tue, 01 Jun 2021 06:51:02 -0700 X-Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mx.groups.io with SMTP id smtpd.web11.58156.1622555452337649422 for ; Tue, 01 Jun 2021 06:50:52 -0700 X-Received: by mail-pf1-f173.google.com with SMTP id u18so1236427pfk.11 for ; Tue, 01 Jun 2021 06:50:52 -0700 (PDT) X-Gm-Message-State: 8BccZOp5zmOSWu0SMBDQgLd7x1787277AA= X-Google-Smtp-Source: ABdhPJyH0o2riUtgt12rVvI37383MomI8rwZemwmobtZbVP4rUv5D9UXDy42m7cgXRRi+j9j1hJgnw== X-Received: by 2002:aa7:8ecc:0:b029:2e8:df63:9bc3 with SMTP id b12-20020aa78ecc0000b02902e8df639bc3mr22178684pfr.5.1622555451658; Tue, 01 Jun 2021 06:50:51 -0700 (PDT) X-Received: from embedded-PC.puresoft.int ([125.63.92.170]) by smtp.gmail.com with ESMTPSA id d22sm14504798pgb.15.2021.06.01.06.50.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Jun 2021 06:50:51 -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 V0 1/4] Platform/NXP: Add generic log in CM to print SoC version Date: Tue, 1 Jun 2021 19:20:31 +0530 Message-Id: <20210601135034.22386-2-vikas.singh@puresoftware.com> In-Reply-To: <20210601135034.22386-1-vikas.singh@puresoftware.com> References: <20210601135034.22386-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=1622555462; bh=eAgycqWe1OU38iQK7LWq0Y9ql29TbGUw9cxYF+bI8vY=; h=Cc:Date:From:Reply-To:Subject:To; b=n0/EdgsjkrHI+XddWcwtKhA47eBumM1aaOocLzMVM98qXlizRzeW77hKxgVbF+bDwTN 62NJoszIUkjB6V+1nL7R9AzlWkHVbcy8XEXMvHCj6xYgibX+g2vWY7ewWf5rW4vrwPoH7 oOaC4+6KRF30fdXrgIR8Rs5EFp8F41AYRLs= 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 --- .../ConfigurationManagerDxe/ConfigurationManager.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 (#75911): https://edk2.groups.io/g/devel/message/75911 Mute This Topic: https://groups.io/mt/83233132/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 Thu May 16 21:12:16 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+75912+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+75912+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1622555457; cv=none; d=zohomail.com; s=zohoarc; b=AC3XsJKAwiIlHZLS1O4IupIXobv9+pDbNAKzZt/x+g0SnqbxPH4RbjumgpkwGkHDk27omZRb/M7fJ74HsbIlQOouB/QungczCZXEUdEGhzcgZRR5brPg6HoVAhGlMIhBGSa2CaOCQPzWWoKwkPhLv/hJySr80NhoIoMbt+Ld6pk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622555457; 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=d2NmcdWSF22g3HySzh+JgMcoaL3POdLQHWe/vIjHgkQ=; b=X0nClG6ui0VptGvs1N56x5zPV7m7fgBw6pXVE8yVlQwMILfD6UhHrTxe+1pOPzeF1h9gPOpNycYG3hw4r5gN5u3M4Na2iFrh3t/k41Pv71cAMxoIvF2qeMeC3yXxb2NjfK9MHgDVvQSbDqU09XaXV2PCt6oGWTNygo7xJzn3m84= 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+75912+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162255545711029.22416732614738; Tue, 1 Jun 2021 06:50:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id siBeYY1788612x6PuGgdqWsk; Tue, 01 Jun 2021 06:50:56 -0700 X-Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mx.groups.io with SMTP id smtpd.web10.57959.1622555456104188503 for ; Tue, 01 Jun 2021 06:50:56 -0700 X-Received: by mail-pg1-f177.google.com with SMTP id 27so10760115pgy.3 for ; Tue, 01 Jun 2021 06:50:56 -0700 (PDT) X-Gm-Message-State: j48OCZlFiM4VwXesVGZV8ERWx1787277AA= X-Google-Smtp-Source: ABdhPJx9kWX1w+6SAhBfpA+sabx5wgPAe1IeqDf/+6WDuO1V1Q0cxLLXcFGiribKgFEE4pmvsYfNXA== X-Received: by 2002:a63:b30a:: with SMTP id i10mr28113630pgf.306.1622555455543; Tue, 01 Jun 2021 06:50:55 -0700 (PDT) X-Received: from embedded-PC.puresoft.int ([125.63.92.170]) by smtp.gmail.com with ESMTPSA id d22sm14504798pgb.15.2021.06.01.06.50.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Jun 2021 06:50:55 -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 V0 2/4] Silicon/NXP: Add support of SVR handling for LS1046FRWY Date: Tue, 1 Jun 2021 19:20:32 +0530 Message-Id: <20210601135034.22386-3-vikas.singh@puresoftware.com> In-Reply-To: <20210601135034.22386-1-vikas.singh@puresoftware.com> References: <20210601135034.22386-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=1622555456; bh=xmmMwixvZkUCclIHj2zESw8dsaoe+KmBFBEvKrrgKx0=; h=Cc:Date:From:Reply-To:Subject:To; b=mUjBMrzf0832lsMj1stvU/fAbDSiUCINn6aIZkARxGVAJOKU2DfXY8R9L1ndZqpHkNZ hDxSRfq8huwj/oIuDGILmId8FnWKqhrkw+ZLCeT6JjX3APoebd7q+JISCuMcXk5KlUgte ZOertZyhSn4qY7h6QkM653HaYK6CZIh25wA= 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 (#75912): https://edk2.groups.io/g/devel/message/75912 Mute This Topic: https://groups.io/mt/83233134/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 Thu May 16 21:12:16 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+75913+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+75913+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1622555466; cv=none; d=zohomail.com; s=zohoarc; b=L1HiTpRiS/FFw0WhmP81r3AZ5d8rsCkQBOmKWsv3W8llB1ML6kU12eUx1NOjH4EpjhDzwRME5vIeitM5MYNU5Mc9ti0iqUCyred3KhE85iq3dkci+KxHRcElYzeS/oomct+xgk3MwHf8byTGuHRv4AJS03oVr28g1IKiLTuggBE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622555466; 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=uXLpQ2Yh06RpRFOYVzdg+urcteQ5IC3Ot1kzd3WMUWY=; b=dx2wIpYjubKcnuHocVVwbFGJBsp4dYnOxb3D1kDyk4l7gc56TJM/VGzpY1tqie1VEiH1ERI04x7BsYNaEdnoxPKudqYJnMaRw74eZHoC2Gqm2yJz4wIM+a/TSuPAjqU0/8yOaPAtQluU2RS8/KyXXlHLBPEQ3xrITnEDMO9s44g= 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+75913+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622555466187208.09668386456144; Tue, 1 Jun 2021 06:51:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id IHsmYY1788612x0ZC1lBSFKk; Tue, 01 Jun 2021 06:51:05 -0700 X-Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by mx.groups.io with SMTP id smtpd.web08.58282.1622555460145372742 for ; Tue, 01 Jun 2021 06:51:00 -0700 X-Received: by mail-pl1-f196.google.com with SMTP id e1so2636270pld.13 for ; Tue, 01 Jun 2021 06:51:00 -0700 (PDT) X-Gm-Message-State: z3Di1rmbdmPjZk2Uf2rUj94bx1787277AA= X-Google-Smtp-Source: ABdhPJwka42GckKD8+F00PC9KbpPa+5hHhKkTLYA8feDZxzRMm9asTLkVHi5GmEjHVpNRS7LPCUBaQ== X-Received: by 2002:a17:90b:1094:: with SMTP id gj20mr15966841pjb.45.1622555459464; Tue, 01 Jun 2021 06:50:59 -0700 (PDT) X-Received: from embedded-PC.puresoft.int ([125.63.92.170]) by smtp.gmail.com with ESMTPSA id d22sm14504798pgb.15.2021.06.01.06.50.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Jun 2021 06:50:59 -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 V0 3/4] Platform/NXP/LS1046aFrwyPkg: Extend Dynamic ACPI support Date: Tue, 1 Jun 2021 19:20:33 +0530 Message-Id: <20210601135034.22386-4-vikas.singh@puresoftware.com> In-Reply-To: <20210601135034.22386-1-vikas.singh@puresoftware.com> References: <20210601135034.22386-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=1622555465; bh=+H5ZidiaJpbS3Sew+OMqxF3+9alhNsSuOHpCFLf/cVs=; h=Cc:Date:From:Reply-To:Subject:To; b=is7eAIoUSMTYZlu0TWulyB9BC1R81SN7AZyHYCjHiwRwMH4kOe3GtPnwYDl8tAavQwk d0oNXtlG3z0u7Z1wG+TNPaWZVpLnSaNk/EonvmKG9riRwUBsJqcS5zxH0gsHYqh6sdA5c qYUxXJtJyQr4IyAjvFrlqChoSfQyqq6q9o8= 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 --- .../NXP/LS1046aFrwyPkg/Include/Platform.h | 155 ++++++++++++++++++ .../NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc | 28 ++++ .../NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf | 13 ++ Silicon/NXP/LS1046A/LS1046A.dsc.inc | 10 ++ 4 files changed, 206 insertions(+) create mode 100644 Platform/NXP/LS1046aFrwyPkg/Include/Platform.h 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 (#75913): https://edk2.groups.io/g/devel/message/75913 Mute This Topic: https://groups.io/mt/83233137/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 Thu May 16 21:12:16 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+75914+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+75914+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1622555470; cv=none; d=zohomail.com; s=zohoarc; b=gWXdHvxIHvmYO1kHonHcQaRAlP7SFkdnYOtHmOwd+MGHkYlDr5Bs9k7cI6l1oWXzd3aG34+IlpyTnuwr9q8zYDY5M96SEtpDYE7+DCaMI++up7ICK4+E96wSF1zJDMz5AjcooGYWAhVHmrYtZVLCi8PHGX2tatQ1i4xoNa2Xr5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622555470; 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=xE0Ns85qFc7pvK4jraDz3CmZpoxe+3/iC9QXjIanmDA=; b=b7NrzwyZaO4KsKA8l6Zm19KxMlTUd8bAUmTHb/9fJoyKDCLPNYepp5onfUsUKMPZQcIFfmRniNb3kiRg/PGNwHStQeH9GQUt1+Wcxgzf5W68ybaVX9WbsnGnU6VdcuBM+W3m0t+yd0dV9QqnpLOBletwBrqafsPleIKSEIXfRRI= 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+75914+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622555470263974.3843424834304; Tue, 1 Jun 2021 06:51:10 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8mPAYY1788612xC12IoeuGUc; Tue, 01 Jun 2021 06:51:09 -0700 X-Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mx.groups.io with SMTP id smtpd.web11.58162.1622555464249241362 for ; Tue, 01 Jun 2021 06:51:04 -0700 X-Received: by mail-pg1-f171.google.com with SMTP id e22so10730671pgv.10 for ; Tue, 01 Jun 2021 06:51:04 -0700 (PDT) X-Gm-Message-State: IxszLDwp2TzDgn5NQ3O0P7D7x1787277AA= X-Google-Smtp-Source: ABdhPJzqQMjkxNqNWsjCJIyn/Svwjrugoz5vKM0+FrBK+D11Fsu33qXXDS5FuMiNWiXx8pYSknr3+g== X-Received: by 2002:aa7:8556:0:b029:2e2:45aa:d01e with SMTP id y22-20020aa785560000b02902e245aad01emr22043168pfn.14.1622555463328; Tue, 01 Jun 2021 06:51:03 -0700 (PDT) X-Received: from embedded-PC.puresoft.int ([125.63.92.170]) by smtp.gmail.com with ESMTPSA id d22sm14504798pgb.15.2021.06.01.06.50.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Jun 2021 06:51:03 -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 V0 4/4] Platform/NXP/LS1046aFrwyPkg: Add OEM specific DSDT generator Date: Tue, 1 Jun 2021 19:20:34 +0530 Message-Id: <20210601135034.22386-5-vikas.singh@puresoftware.com> In-Reply-To: <20210601135034.22386-1-vikas.singh@puresoftware.com> References: <20210601135034.22386-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=1622555469; bh=QYvr6LZe3QBRSNtSS96cab+nyysyThb94TYnLkCFVIU=; h=Cc:Date:From:Reply-To:Subject:To; b=QjPxlvdB9JCYUr80aW62wqLbZwwgxJ3U5yTqptpadiAwXCKmjX+kWK31p3L5b3QQTZY BVZIeZ/D0HZae1lEZulodzpqz3QX4NzqY5t0SOvZFcFPBWts0JByyyHXtBWA9WWbr41lY pIXVYYbkRBe0id7UcQ45P9GlEGGeC1cZypg= 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 --- .../AcpiTablesInclude/Dsdt/Clk.asl | 60 ++++++++ .../AcpiTablesInclude/Dsdt/Dsdt.asl | 15 ++ .../AcpiTablesInclude/PlatformAcpiDsdtLib.inf | 39 +++++ .../PlatformAcpiDsdtLib/RawDsdtGenerator.c | 138 ++++++++++++++++++ .../AcpiTablesInclude/PlatformAcpiLib.h | 23 +++ .../NXP/LS1046aFrwyPkg/Include/Platform.h | 6 +- .../NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc | 1 + 7 files changed, 281 insertions(+), 1 deletion(-) create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Clk.= asl create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/Dsdt/Dsdt= .asl create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformA= cpiDsdtLib.inf create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformA= cpiDsdtLib/RawDsdtGenerator.c create mode 100644 Platform/NXP/LS1046aFrwyPkg/AcpiTablesInclude/PlatformA= cpiLib.h 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 (#75914): https://edk2.groups.io/g/devel/message/75914 Mute This Topic: https://groups.io/mt/83233140/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-