From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510934970061356.4081583434787; Fri, 17 Nov 2017 08:09:30 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B6B292035BB1E; Fri, 17 Nov 2017 08:05:16 -0800 (PST) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4E4502035BB1C for ; Fri, 17 Nov 2017 08:05:14 -0800 (PST) Received: by mail-wm0-x244.google.com with SMTP id v186so7405319wma.2 for ; Fri, 17 Nov 2017 08:09:25 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:22 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::244; helo=mail-wm0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gN89ZOUtoJ0kYY2bMYNYhMXMhYxbPHNRw1Qq6SkO0mk=; b=NEsXJ+Z4rXtFyD/GT5xcpdvPs7bgFDKy7ul52mlR6Q/oOojTHVTtyboumnVq3oters aQ3kpaKk4baw+rUAx7XUTXGkQFIW17wis6pbX+rZd38/UOwMBY7gx9dLWUoD9WF/Dd77 euAiwlmE5zWNxXQjAuc+B0QG7ME/J1a2bi2ys= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gN89ZOUtoJ0kYY2bMYNYhMXMhYxbPHNRw1Qq6SkO0mk=; b=dhmgFrP5ZFtU3sXhWG8dmOj8e0lTM4o/gBFN0NAX5cispmXAEAMnMIdNIUSVY92qsx lf8t9VAfYt235VvWL4F/AZC+XSCjtEWVUozHzaO9TBnDDvBaRIoMCvX/8yZwn3ly0Ow2 NABWOzU5OA8NyGS8rNV211g94+uvf8vZ+eg6Ki1CsHgQQZgWup32D/csszaYyUSrfJEF e8vnhTuHDnWSCEeZXSw2w58TdCVZDWkxV1G+BnzAkqX4ACNdhlUf3eiynQ3zMYcD9NBI EqCOkkg8S+rCh52hcIAaO52RG+u7BHuPyLqPQZx9OV+zoqruUMj+g/jeRMco3gwFqIWi LFhg== X-Gm-Message-State: AJaThX7ZujBWKaXGyppcqGC79sjl/zdUxNiNtJEDSlEn/YzOTGEmubvU MMbsnQrsRt7OM+70x9+WhT5TFu5gVKo= X-Google-Smtp-Source: AGs4zMa29wkj9G+LGljtcUOf+B9a/qGUxMS4rTbeXcpyVOouu6mmP7AGGzYGNvS+RFuriUekc4SF4Q== X-Received: by 10.28.134.73 with SMTP id i70mr4323053wmd.107.1510934963621; Fri, 17 Nov 2017 08:09:23 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:08:59 +0000 Message-Id: <20171117160913.17292-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 01/15] ArmPlatformPkg/ArmPlatformLibNull: remove bogus PCD dependencies X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Remove dependencies on gArmTokenSpaceGuid.PcdSystemMemoryBase and gArmTokenSpaceGuid.PcdSystemMemorySize, the presence of which in a [FixedPcd] section makes this module unusable for ArmVirtQemu. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf | 3 --- 1 file changed, 3 deletions(-) diff --git a/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.i= nf b/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf index 97b2a4b6e495..e59aef611a3c 100644 --- a/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf +++ b/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf @@ -41,9 +41,6 @@ [Sources.AArch64] AArch64/ArmPlatformHelper.S =20 [FixedPcd] - gArmTokenSpaceGuid.PcdSystemMemoryBase - gArmTokenSpaceGuid.PcdSystemMemorySize - gArmTokenSpaceGuid.PcdArmPrimaryCoreMask gArmTokenSpaceGuid.PcdArmPrimaryCore =20 --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510934971077548.1650477888683; Fri, 17 Nov 2017 08:09:31 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0241921B00DDB; Fri, 17 Nov 2017 08:05:18 -0800 (PST) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 12A2D21B00DD4 for ; Fri, 17 Nov 2017 08:05:15 -0800 (PST) Received: by mail-wm0-x241.google.com with SMTP id r68so7494262wmr.3 for ; Fri, 17 Nov 2017 08:09:26 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:24 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::241; helo=mail-wm0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/ZFPBiJLG3sYptaNjreo3zpVKelVxQrCTQmswfFSSo0=; b=IOeipAys4uBe8dL1a8YGTk6pbLnrXRSvoXElBYsSO/h5CMvPYKEi5PAfIZtcL+oPVk JmuGE7Y/Et3V60fpd4nXtJIp6eSZvEZ7rWr2qK3Q9k4ZAVhBHwh16r2uGtJg6BJb4vfI ZrPbd6sLL9hgh5AVZ7Q4/JLnSV6wewsnyXzQs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/ZFPBiJLG3sYptaNjreo3zpVKelVxQrCTQmswfFSSo0=; b=jOZqslx8cgUqCMJKzcSd1arsNFvNycME+m4bnipg6FLAto8dopNd6UhFovK22sEvFx iB9QdXet1wrTuq8WqgMnvxFF4PTfTVR+yAjpMKYjPUWJ+hDYyoG5ABUDu4wlArYBQYDB AoB0q5g7Czj2IZ55EqYs23LG2zpUcybIQDE5ZFXa664sXZrjs05Uu43zCoH7DxmaapHr QWwRYC26+23BHWjgz89Ne/A1LOv/4qzwDRwZZXfFr/8/pGlSFgvUjdxtFfPvpRzFm64L MfoQQ/A9Etjhht5SK/lgwI6KXWOySpnofsn8ze+9jx/5ElqoG+l5WXEEmAUZIR3VhryF QuXA== X-Gm-Message-State: AJaThX4OLFzysXM++cugtMSzEwSRunSS3hvUUjvrMCDxzB1JCrmehk0K +Fw9BjQaHDnctn4zEJPlMChmZAPfgaI= X-Google-Smtp-Source: AGs4zMYZoqM4xLsVctL2B5ShuxVA3pUwF6nbtCvLFJT6CaRc3Y3+auE1HFfmHmd1piEWxfBu1IIvsA== X-Received: by 10.28.131.2 with SMTP id f2mr4207961wmd.137.1510934965358; Fri, 17 Nov 2017 08:09:25 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:00 +0000 Message-Id: <20171117160913.17292-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 02/15] ArmVirtPkg/PrePi: run all library constructors by hand X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Instead of invoking the library constructors of some libraries by hand, invoke the generated function ProcessLibraryConstructorList in AutoGen.c so all constructors are executed. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- ArmVirtPkg/PrePi/PrePi.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/ArmVirtPkg/PrePi/PrePi.c b/ArmVirtPkg/PrePi/PrePi.c index c69cff249e80..3679087aec4d 100755 --- a/ArmVirtPkg/PrePi/PrePi.c +++ b/ArmVirtPkg/PrePi/PrePi.c @@ -29,15 +29,9 @@ #include "PrePi.h" #include "LzmaDecompress.h" =20 -EFI_STATUS -EFIAPI -ExtractGuidedSectionLibConstructor ( - VOID - ); - -EFI_STATUS +VOID EFIAPI -LzmaDecompressLibConstructor ( +ProcessLibraryConstructorList ( VOID ); =20 @@ -125,8 +119,7 @@ PrePiMain ( PERF_START (NULL, "PEI", NULL, StartTimeStamp); =20 // SEC phase needs to run library constructors by hand. - ExtractGuidedSectionLibConstructor (); - LzmaDecompressLibConstructor (); + ProcessLibraryConstructorList (); =20 // Build HOBs to pass up our version of stuff the DXE Core needs to save= space BuildPeCoffLoaderHob (); --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510934973807248.98916389558065; Fri, 17 Nov 2017 08:09:33 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3BCE821B00DE6; Fri, 17 Nov 2017 08:05:20 -0800 (PST) Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D50682035BB1D for ; Fri, 17 Nov 2017 08:05:17 -0800 (PST) Received: by mail-wr0-x244.google.com with SMTP id w95so2548990wrc.2 for ; Fri, 17 Nov 2017 08:09:28 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:26 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vRyNhqyzKprfA8ce0aaw0Mtf7qTWwAZkGmqp6Lxp4ms=; b=c3fU9vrWp6hrxSQ3Am8pzRvT45WlkGAVzqE06igVPhTuka9FgNCep7fYT1SzgeEkz0 kvzQ6oLw2o0A9CDMI/WKoSU9W+tOFK4ab7pqezAWMGJX9fCu62rcMqWI5QFS0PbX/13h Z0neJ+rc51Xe/0BYHRKDX72Y+fcQnOBkb7RWo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vRyNhqyzKprfA8ce0aaw0Mtf7qTWwAZkGmqp6Lxp4ms=; b=Xsb1sBZNsBy2WMMIkBvY6gyXPvjhNZUqQY3Y1aSDAqcYd3yKF/A0myf3Eklwp0EYG7 6IkrgXNX9YTJbMUTUeaYVDxGQyclSe/r8dcdc3TNPHZ8rD1cCzsA9xOs2w8pOWVGVvth +9UlfpgmxgxUVOYJ+IJ/Kj2qm1c54dhdv6iKR1za0SnL9vNk01TenhIWGpM1jtdvahvw 5OcNVfUdoh/PNIIUSg2ue7hHXoKLd6T8BPBBs1cXehWBYu7I+KObLFmnT5prg0IvK0EG NFcQahF2dknrbQ+ZmpSqFwnBHG8CGqTYL/EKUEbjFWx83Y74NZB5M/3R+jcj7GgHso1P KbXA== X-Gm-Message-State: AJaThX7caqE1Z0EfYyArlyCs4YY28Gs2TjtHtT28uKVu2raATAIqYfT6 GyjSWNoZxa0C6vKmyf+e65NTfL39ZmA= X-Google-Smtp-Source: AGs4zMYMs4VajhK/00ZGbbVEERFtrnjbUdlt8d51C/9cSAsQYPe7oQW2/acnUH5lF/n3Rq/U6aRIgw== X-Received: by 10.223.165.67 with SMTP id j3mr5147961wrb.181.1510934967092; Fri, 17 Nov 2017 08:09:27 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:01 +0000 Message-Id: <20171117160913.17292-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 03/15] ArmVirtPkg/PrePi: remove unused GetPlatformPpi() function X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Remove GetPlatformPpi() from PrePi: it is not used anywhere. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- ArmVirtPkg/PrePi/PrePi.c | 24 -------------------- 1 file changed, 24 deletions(-) diff --git a/ArmVirtPkg/PrePi/PrePi.c b/ArmVirtPkg/PrePi/PrePi.c index 3679087aec4d..c4fa979c43ef 100755 --- a/ArmVirtPkg/PrePi/PrePi.c +++ b/ArmVirtPkg/PrePi/PrePi.c @@ -35,30 +35,6 @@ ProcessLibraryConstructorList ( VOID ); =20 -EFI_STATUS -GetPlatformPpi ( - IN EFI_GUID *PpiGuid, - OUT VOID **Ppi - ) -{ - UINTN PpiListSize; - UINTN PpiListCount; - EFI_PEI_PPI_DESCRIPTOR *PpiList; - UINTN Index; - - PpiListSize =3D 0; - ArmPlatformGetPlatformPpiList (&PpiListSize, &PpiList); - PpiListCount =3D PpiListSize / sizeof(EFI_PEI_PPI_DESCRIPTOR); - for (Index =3D 0; Index < PpiListCount; Index++, PpiList++) { - if (CompareGuid (PpiList->Guid, PpiGuid) =3D=3D TRUE) { - *Ppi =3D PpiList->Ppi; - return EFI_SUCCESS; - } - } - - return EFI_NOT_FOUND; -} - VOID PrePiMain ( IN UINTN UefiMemoryBase, --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510934976855882.1476556319709; Fri, 17 Nov 2017 08:09:36 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7C33321B00DEB; Fri, 17 Nov 2017 08:05:21 -0800 (PST) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B2BFA2035BB1C for ; Fri, 17 Nov 2017 08:05:19 -0800 (PST) Received: by mail-wm0-x241.google.com with SMTP id g130so3957053wme.0 for ; Fri, 17 Nov 2017 08:09:30 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:28 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::241; helo=mail-wm0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fmr6hK/LcgcK41uLIDdd13QraJfHkDsodJP7FpJYPe4=; b=Elga6eon/xYbu/q3Rnap8PhQgu6AyNzjQYqJQdgG2edQrNTwMXRUA2KrK04kdl6UfI quACD9efYd9B1uFls8DNh2ILkmzfCtt0SJ5fgHXbdeRzSuwRxBQG47bYI/3J8YhZuGzG VcY5Z9KrOdzMlhiuKljPQ7lkDf79zZ2++6HUM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fmr6hK/LcgcK41uLIDdd13QraJfHkDsodJP7FpJYPe4=; b=RIEBDjrMcSv6mbNaVH/cRhpzOHXMr4JALGZuZKKVItND2NMF3NwcBEi4XLIpLNooPm 3gtdJqVsbyOhfAIgwgTViVBMzRYCHLZRQmNt6fG480sVg44sI4ST8MqWfIvNFdozQMt1 +XjlzZzjIW+4KMlsldOj5obCfYpy9iGEbw7aMoCje3+aADYYoQsyOhOBwR8D4EFQzl5S GCGB76GDMQfU/Wkjt7QAdPRNj3kegTP9Fx5tGMMpiXO1/RE0wQgkvbaxbHzC+M59OrtQ E8LUOJDI0GOUuGwIcNsxqxsg9eaIM/9fdrhkQ2UOkyKsosvohTd4pX6Z7K/1i6l35QPy z7RA== X-Gm-Message-State: AJaThX6EB8VFaZFdbWEKQ9i0yyME7Gpm7JFayiF1AgBQA+KDysqa0YUu EINU+s/T48GJ7cVUGriv1WKG0Vfcv0g= X-Google-Smtp-Source: AGs4zMbyWNyk4kcuyIDjqhqlIMshxB7ciizY8NxwRF1evlxM630XNH+9d1p8GEfT26Fj7RoneLaA2g== X-Received: by 10.28.72.9 with SMTP id v9mr4762300wma.102.1510934969059; Fri, 17 Nov 2017 08:09:29 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:02 +0000 Message-Id: <20171117160913.17292-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 04/15] ArmVirtPkg/PrePi: remove bogus primary core check X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" QEMU and KVM based ARM/AARCH64 virtual machines only enter UEFI on a single core, so ArmPlatformIsPrimaryCore() always returns true. And even if it didn't, our code does absolutely nothing meaningful based on its return value, so don't bother calling it, and remove another frivolous dependency on ArmPlatformLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S | 7 ------- ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S | 7 ------- 2 files changed, 14 deletions(-) diff --git a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S b/ArmVirtPkg/PrePi= /AArch64/ModuleEntryPoint.S index cc8b47e69026..7a9c0c3787cc 100644 --- a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S +++ b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S @@ -128,13 +128,6 @@ _GetStackBase: MOV32 (x3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) bl ASM_PFX(ArmPlatformStackSet) =20 - // Is it the Primary Core ? - mov x0, x10 - bl ASM_PFX(ArmPlatformIsPrimaryCore) - cmp x0, #1 - bne _PrepareArguments - -_PrepareArguments: mov x0, x20 mov x1, x21 mov x2, x22 diff --git a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/Arm= /ModuleEntryPoint.S index 59028d0a553e..eebf660acdb2 100644 --- a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S +++ b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S @@ -136,13 +136,6 @@ _GetStackBase: MOV32 (r3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) bl ASM_PFX(ArmPlatformStackSet) =20 - // Is it the Primary Core ? - mov r0, r10 - bl ASM_PFX(ArmPlatformIsPrimaryCore) - cmp r0, #1 - bne _PrepareArguments - -_PrepareArguments: mov r0, r10 mov r1, r11 mov r2, r9 --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510934980425316.9177874370055; Fri, 17 Nov 2017 08:09:40 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BB52321B00DEE; Fri, 17 Nov 2017 08:05:23 -0800 (PST) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C85482035BB1B for ; Fri, 17 Nov 2017 08:05:21 -0800 (PST) Received: by mail-wm0-x244.google.com with SMTP id z3so7449277wme.5 for ; Fri, 17 Nov 2017 08:09:32 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:30 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::244; helo=mail-wm0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oL0wDEvRjCDBiSTHsLQ65UUjTXVVm3EPcmMG3kQua9Q=; b=APpzHszJdU4HyzCVdILG99gG5wvsKNVJSctTw3Qj2VdHHEKTkh3Zf6yBAcRjGBFsx8 ibpKaYnoILW80E9RmCcWJD1eDvnHs8G6tziJRYxpiUmp8M4O0AXhu4Aprq8dYhjQnIvk mVHLTJUlFoqzptV/0lVFSsKV6J6+mzeiD8tR0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oL0wDEvRjCDBiSTHsLQ65UUjTXVVm3EPcmMG3kQua9Q=; b=fN8zAuX25IY5DvNOnpaho2+qpeqZKZfzQo5S/IFaB+uaw0LgarN4QFLbIZe4nMDuLF 2fGiHkcmiGEQ0xrL9o/n2T73xvt48kXi99lmKM8gs+pTfdNmJMY1ewKwuv9pThb4EXZ/ ugaE2IIQiRVYN+soSgqqhzGN+P2xKLY1Er+BS6oaKauCWykXX/5OYeVZ9Fx+4bXl9h4O 0xGklzH/CHHwjZcXZIe2DiaMcQQAUqW4AxOiCdJqGrKxRQFrnK/GSqY+/sT2XmzBaKky TsChPIY1CeAR8mop7XvFNhVzwxFgBKLFo0+MS+DqvJm6veB3U0RXfQNWUFY84zxZo3m3 Kn+g== X-Gm-Message-State: AJaThX4ILZxb1XL9cumhPPS8lyHGBDTYF2QULw+ZPrbj0+r/rM8rQDpn RwGCMoq49AqcvC+XVU8LNNJGjAyEPrQ= X-Google-Smtp-Source: AGs4zMYKkswC21EUUbPjtP1bOgpP89r2LcssfDSwtc1JiWQENXemV1BcxPtRlPk3+Px4Qv9sDVGoIw== X-Received: by 10.28.167.86 with SMTP id q83mr4422268wme.102.1510934971082; Fri, 17 Nov 2017 08:09:31 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:03 +0000 Message-Id: <20171117160913.17292-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 05/15] ArmVirtPkg/PrePi: remove dependency on ArmPlatformLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Remove the pointless dependency on ArmPlatformLib: none of the code we call from it actually does anything useful. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 1 - ArmVirtPkg/PrePi/PrePi.c | 6 ++---- ArmVirtPkg/PrePi/PrePi.h | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf b/ArmVirtP= kg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf index 5e706934f69f..1d79b1360c22 100755 --- a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf +++ b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf @@ -52,7 +52,6 @@ [LibraryClasses] LzmaDecompressLib PeCoffGetEntryPointLib PrePiLib - ArmPlatformLib ArmPlatformStackLib MemoryAllocationLib HobLib diff --git a/ArmVirtPkg/PrePi/PrePi.c b/ArmVirtPkg/PrePi/PrePi.c index c4fa979c43ef..fce4ab9428a5 100755 --- a/ArmVirtPkg/PrePi/PrePi.c +++ b/ArmVirtPkg/PrePi/PrePi.c @@ -13,6 +13,7 @@ **/ =20 #include +#include =20 #include #include @@ -85,7 +86,7 @@ PrePiMain ( BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize= )); =20 // Set the Boot Mode - SetBootMode (ArmPlatformGetBootMode ()); + SetBootMode (BOOT_WITH_FULL_CONFIGURATION); =20 // Initialize Platform HOBs (CpuHob and FvHob) Status =3D PlatformPeim (); @@ -123,9 +124,6 @@ CEntryPoint ( { UINT64 StartTimeStamp; =20 - // Initialize the platform specific controllers - ArmPlatformInitialize (MpId); - if (PerformanceMeasurementEnabled ()) { // Initialize the Timer Library to setup the Timer HW controller TimerConstructor (); diff --git a/ArmVirtPkg/PrePi/PrePi.h b/ArmVirtPkg/PrePi/PrePi.h index d3189c0b8a6f..1ba88e0506cb 100644 --- a/ArmVirtPkg/PrePi/PrePi.h +++ b/ArmVirtPkg/PrePi/PrePi.h @@ -25,7 +25,6 @@ #include #include #include -#include =20 #define SerialPrint(txt) SerialPortWrite (txt, AsciiStrLen(txt)+1); =20 --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 15109349833924.810895452042587; Fri, 17 Nov 2017 08:09:43 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 037FE21B00DEF; Fri, 17 Nov 2017 08:05:26 -0800 (PST) Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C0B8D21B00DEF for ; Fri, 17 Nov 2017 08:05:23 -0800 (PST) Received: by mail-wr0-x241.google.com with SMTP id u40so2513188wrf.10 for ; Fri, 17 Nov 2017 08:09:34 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:32 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::241; helo=mail-wr0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JJFCtmCP2dUBYG/+mXY5uNl/YF1w85LZWnWs/Onula8=; b=O3xXEDEgChI1q9Xj1nmPI2qC3bgar4mH6zCKtQocZwdWK5iGlh0VSIEIRzKkqlGrIQ Cflgf0fe1pMtOLn/yS2zUx6ZocOa/qVjZQByMeWomkRBuzWwUJrvn90pDHBRGASgERtZ AU/YgD7uJ/o5w9ebnrxgbhwxJWGe+oaHo9nWs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JJFCtmCP2dUBYG/+mXY5uNl/YF1w85LZWnWs/Onula8=; b=ubQWaB8M6oN7ajTDUOnAiFjrbFtBV6TLyVXCejyurJqp1ZB2YD2lejLLvXFO95BSGZ satIIlSXJMyjeSRy8XqLaWPKhqFWUO2kQrOL452cxtmGA76pbMcSeq6V3/4ecFlveGcu 6di1AxMLdWslU8uoUXilx77k1YXQuoag90gAXAjP3CFymR197Uj4S/bWhyG8T5bEXhzN T7TTjxGOWAXk7DxDTAeFUEm0JDOyMFxoVNrrSb4yCwDd5PLCmgjRed9hf/HWpK3kUjR0 4qd3UzPVAoHF/blWsEn3uNRiwqpJpSCMnVgphV4gs6/Eh68Rq1RpGqhmEFLDXWOgiwy6 6MUQ== X-Gm-Message-State: AJaThX4/bMGETos0/QoPSFeNxW4cWJodzp+e3igvV/G5BdIm3JsiA9S+ cf4VYCkvn8e+/D0aPWhRs+hRgHZd6bI= X-Google-Smtp-Source: AGs4zMamDCoi5MjKlBCvTHIJqywL7dMOvLrW+HQHOo+tyT0Cl48tyoQoKoJeyThl35W6isLYrHc08w== X-Received: by 10.223.177.220 with SMTP id r28mr4729032wra.83.1510934972900; Fri, 17 Nov 2017 08:09:32 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:04 +0000 Message-Id: <20171117160913.17292-7-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 06/15] ArmVirtPkg/PrePi: move DRAM discovery code into PrePi X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" ArmVirtQemuKernel and ArmVirtXen use essentially the same code to retrieve DRAM information from the DT /memory node at early boot, and invoke it via the ArmPlatformPeiBootAction () hook exposed by ArmPlatformLib. Let's move this code into the PrePi implementation these platforms share between them (and not with any other platforms) so we can eliminate another dependency on the messy ArmPlatformLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Acked-by: Laszlo Ersek --- ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S | 77 ++++++++++++++++- ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S | 71 +++++++++++++++ ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 2 + ArmVirtPkg/PrePi/FdtParser.c | 90 +++++++++++++++++= +++ 4 files changed, 238 insertions(+), 2 deletions(-) diff --git a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S b/ArmVirtPkg/PrePi= /AArch64/ModuleEntryPoint.S index 7a9c0c3787cc..3296aedfe9aa 100644 --- a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S +++ b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S @@ -49,8 +49,7 @@ ASM_FUNC(_ModuleEntryPoint) b .Lreloc_loop .Lreloc_done: =20 - // Do early platform specific actions - bl ASM_PFX(ArmPlatformPeiBootAction) + bl ASM_PFX(DiscoverDramFromDt) =20 // Get ID of this CPU in Multicore system bl ASM_PFX(ArmReadMpidr) @@ -140,3 +139,77 @@ _GetStackBase: =20 _NeverReturn: b _NeverReturn + +// VOID +// DiscoverDramFromDt ( +// VOID *DeviceTreeBaseAddress, // passed by loader in x0 +// VOID *ImageBase // passed by FDF trampoline in x1 +// ); +ASM_PFX(DiscoverDramFromDt): + // + // If we are booting from RAM using the Linux kernel boot protocol, x0 w= ill + // point to the DTB image in memory. Otherwise, use the default value de= fined + // by the platform. + // + cbnz x0, 0f + ldr x0, PcdGet64 (PcdDeviceTreeInitialBaseAddress) + +0:mov x29, x30 // preserve LR + mov x28, x0 // preserve DTB pointer + mov x27, x1 // preserve base of image pointer + + // + // The base of the runtime image has been preserved in x1. Check whether + // the expected magic number can be found in the header. + // + ldr w8, .LArm64LinuxMagic + ldr w9, [x1, #0x38] + cmp w8, w9 + bne .Lout + + // + // + // OK, so far so good. We have confirmed that we likely have a DTB and a= re + // booting via the arm64 Linux boot protocol. Update the base-of-image P= CD + // to the actual relocated value, and add the shift of PcdFdBaseAddress = to + // PcdFvBaseAddress as well + // + adr x8, PcdGet64 (PcdFdBaseAddress) + adr x9, PcdGet64 (PcdFvBaseAddress) + ldr x6, [x8] + ldr x7, [x9] + sub x7, x7, x6 + add x7, x7, x1 + str x1, [x8] + str x7, [x9] + + // + // Discover the memory size and offset from the DTB, and record in the + // respective PCDs. This will also return false if a corrupt DTB is + // encountered. Since we are calling a C function, use the window at the + // beginning of the FD image as a temp stack. + // + adr x1, PcdGet64 (PcdSystemMemoryBase) + adr x2, PcdGet64 (PcdSystemMemorySize) + mov sp, x7 + bl FindMemnode + cbz x0, .Lout + + // + // Copy the DTB to the slack space right after the 64 byte arm64/Linux s= tyle + // image header at the base of this image (defined in the FDF), and reco= rd the + // pointer in PcdDeviceTreeInitialBaseAddress. + // + adr x8, PcdGet64 (PcdDeviceTreeInitialBaseAddress) + add x27, x27, #0x40 + str x27, [x8] + + mov x0, x27 + mov x1, x28 + bl CopyFdt + +.Lout: + ret x29 + +.LArm64LinuxMagic: + .byte 0x41, 0x52, 0x4d, 0x64 diff --git a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/Arm= /ModuleEntryPoint.S index eebf660acdb2..a918c191432e 100644 --- a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S +++ b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S @@ -148,3 +148,74 @@ _GetStackBase: =20 _NeverReturn: b _NeverReturn + +ASM_PFX(ArmPlatformPeiBootAction): + // + // If we are booting from RAM using the Linux kernel boot protocol, r0 w= ill + // point to the DTB image in memory. Otherwise, use the default value de= fined + // by the platform. + // + teq r0, #0 + bne 0f + LDRL (r0, PcdGet64 (PcdDeviceTreeInitialBaseAddress)) + +0:mov r11, r14 // preserve LR + mov r10, r0 // preserve DTB pointer + mov r9, r1 // preserve base of image pointer + + // + // The base of the runtime image has been preserved in r1. Check whether + // the expected magic number can be found in the header. + // + ldr r8, .LArm32LinuxMagic + ldr r7, [r1, #0x24] + cmp r7, r8 + bne .Lout + + // + // + // OK, so far so good. We have confirmed that we likely have a DTB and a= re + // booting via the ARM Linux boot protocol. Update the base-of-image PCD + // to the actual relocated value, and add the shift of PcdFdBaseAddress = to + // PcdFvBaseAddress as well + // + ADRL (r8, PcdGet64 (PcdFdBaseAddress)) + ADRL (r7, PcdGet64 (PcdFvBaseAddress)) + ldr r6, [r8] + ldr r5, [r7] + sub r5, r5, r6 + add r5, r5, r1 + str r1, [r8] + str r5, [r7] + + // + // Discover the memory size and offset from the DTB, and record in the + // respective PCDs. This will also return false if a corrupt DTB is + // encountered. Since we are calling a C function, use the window at the + // beginning of the FD image as a temp stack. + // + ADRL (r1, PcdGet64 (PcdSystemMemoryBase)) + ADRL (r2, PcdGet64 (PcdSystemMemorySize)) + mov sp, r5 + bl FindMemnode + teq r0, #0 + beq .Lout + + // + // Copy the DTB to the slack space right after the 64 byte arm64/Linux s= tyle + // image header at the base of this image (defined in the FDF), and reco= rd the + // pointer in PcdDeviceTreeInitialBaseAddress. + // + ADRL (r8, PcdGet64 (PcdDeviceTreeInitialBaseAddress)) + add r9, r9, #0x40 + str r9, [r8] + + mov r0, r9 + mov r1, r10 + bl CopyFdt + +.Lout: + bx r11 + +.LArm32LinuxMagic: + .byte 0x18, 0x28, 0x6f, 0x01 diff --git a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf b/ArmVirtP= kg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf index 1d79b1360c22..e816e9583da8 100755 --- a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf +++ b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf @@ -23,6 +23,7 @@ [Defines] =20 [Sources] PrePi.c + FdtParser.c =20 [Sources.AArch64] AArch64/ArchPrePi.c @@ -44,6 +45,7 @@ [Packages] [LibraryClasses] BaseLib DebugLib + FdtLib ArmLib IoLib TimerLib diff --git a/ArmVirtPkg/PrePi/FdtParser.c b/ArmVirtPkg/PrePi/FdtParser.c new file mode 100644 index 000000000000..afdc81a8839d --- /dev/null +++ b/ArmVirtPkg/PrePi/FdtParser.c @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2015, Linaro Ltd. All rights reserved. + * + * This program and the accompanying materials + * are licensed and made available under the terms and conditions of the B= SD License + * which accompanies this distribution. The full text of the license may = be found at + * http://opensource.org/licenses/bsd-license.php + * + * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. + */ + +#include +#include + +BOOLEAN +FindMemnode ( + IN VOID *DeviceTreeBlob, + OUT UINT64 *SystemMemoryBase, + OUT UINT64 *SystemMemorySize + ) +{ + INT32 MemoryNode; + INT32 AddressCells; + INT32 SizeCells; + INT32 Length; + CONST INT32 *Prop; + + if (fdt_check_header (DeviceTreeBlob) !=3D 0) { + return FALSE; + } + + // + // Look for a node called "memory" at the lowest level of the tree + // + MemoryNode =3D fdt_path_offset (DeviceTreeBlob, "/memory"); + if (MemoryNode <=3D 0) { + return FALSE; + } + + // + // Retrieve the #address-cells and #size-cells properties + // from the root node, or use the default if not provided. + // + AddressCells =3D 1; + SizeCells =3D 1; + + Prop =3D fdt_getprop (DeviceTreeBlob, 0, "#address-cells", &Length); + if (Length =3D=3D 4) { + AddressCells =3D fdt32_to_cpu (*Prop); + } + + Prop =3D fdt_getprop (DeviceTreeBlob, 0, "#size-cells", &Length); + if (Length =3D=3D 4) { + SizeCells =3D fdt32_to_cpu (*Prop); + } + + // + // Now find the 'reg' property of the /memory node, and read the first + // range listed. + // + Prop =3D fdt_getprop (DeviceTreeBlob, MemoryNode, "reg", &Length); + + if (Length < (AddressCells + SizeCells) * sizeof (INT32)) { + return FALSE; + } + + *SystemMemoryBase =3D fdt32_to_cpu (Prop[0]); + if (AddressCells > 1) { + *SystemMemoryBase =3D (*SystemMemoryBase << 32) | fdt32_to_cpu (Prop[1= ]); + } + Prop +=3D AddressCells; + + *SystemMemorySize =3D fdt32_to_cpu (Prop[0]); + if (SizeCells > 1) { + *SystemMemorySize =3D (*SystemMemorySize << 32) | fdt32_to_cpu (Prop[1= ]); + } + + return TRUE; +} + +VOID +CopyFdt ( + IN VOID *FdtDest, + IN VOID *FdtSource + ) +{ + fdt_pack(FdtSource); + CopyMem (FdtDest, FdtSource, fdt_totalsize (FdtSource)); +} --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510934986814293.51787481649285; Fri, 17 Nov 2017 08:09:46 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3CA202035BB20; Fri, 17 Nov 2017 08:05:27 -0800 (PST) Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B83F72035BB1C for ; Fri, 17 Nov 2017 08:05:25 -0800 (PST) Received: by mail-wr0-x244.google.com with SMTP id z14so2530923wrb.8 for ; Fri, 17 Nov 2017 08:09:36 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:34 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XJFbcnUCBr1r0ybPAXKexlcLPJ13uvXfBjk2LpmwhyI=; b=HtVIksdYrGB9bxUV7X2PuWV03SXlp1aSs/1z2m02Po+wR3P51Ve743AzFcJuvaVs9l rA2OMl9G7oYbtqIHq8aE5S0aNHLDQtKZOf2f7eg+3B9X96buBsBPtKyudz03t1XHTMdA wayD9RFfWpLVPedzsWFOa8f2S/vHiMV8TQ3G8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XJFbcnUCBr1r0ybPAXKexlcLPJ13uvXfBjk2LpmwhyI=; b=bnHZ5nlolKtWHvzMyJZtxSzpdO6PMze8nlP+UKvZ7B2Km/daJlCPfyqTwtfoCABMwn I/nkce6qvTjOItqGvxrkZdrjgokGneffDYgZX0ilW9NMj1cvkY9u7kyLhnqHdGY6KfJK D6XkIvOhYxOw5t0g2Qfi9ac7JBCvz3Lg2IbkPrezTH5VXEQjBXZkDxsP0ekJ+NYEbuu7 uT8PvgGjySk6F2LCOtfmA4dzsIX/05n5MFN2kC3ef42Dtdq8xYLudAFB+zqArsoF7MNz DqKnn+GAapa7kmLAOTDr83pGWXrb3kOSZasXSm+8uf2rCO2l8nnElnewVCPcXAWH0/9d jm2w== X-Gm-Message-State: AJaThX4BAjPIjSafG1PH1znZIUZENQFCpOPqXHkijQCB7nOSQhU8qoTv VJOtcFoWgDUsolRiUj4tMqcRoSCW33s= X-Google-Smtp-Source: AGs4zMb7pSJRmwqVDRCw6TCLTLG7FftFfUmvtO9A8DU9h04gZKD8IgYEwWeWZTTky+hDMKr5iSz4YA== X-Received: by 10.223.162.152 with SMTP id s24mr5140095wra.151.1510934974977; Fri, 17 Nov 2017 08:09:34 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:05 +0000 Message-Id: <20171117160913.17292-8-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 07/15] ArmVirtPkg/PrePi: remove ArmPlatformStackLib dependency X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" ArmPlatformStackLib has hooks into primary/secondary core PCDs and other ArmPlatformLib related junk, so let's simply set the stack pointer directly. This is trivial given that our PrePi is unicore only. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Acked-by: Laszlo Ersek --- ArmVirtPkg/ArmVirt.dsc.inc | 1 - ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S | 14 ++------------ ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S | 14 ++------------ ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 1 - 4 files changed, 4 insertions(+), 26 deletions(-) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index 50eb8675d1c0..5d7edff104b5 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -93,7 +93,6 @@ [LibraryClasses.common] ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.= inf ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf ArmGicArchLib|ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf - ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatfo= rmStackLib.inf ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf ArmHvcLib|ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerVirtCounterLib/A= rmGenericTimerVirtCounterLib.inf diff --git a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S b/ArmVirtPkg/PrePi= /AArch64/ModuleEntryPoint.S index 3296aedfe9aa..891cf1fcab40 100644 --- a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S +++ b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S @@ -111,22 +111,12 @@ _GetBaseUefiMemory: =20 _GetStackBase: // r1 =3D The top of the Mpcore Stacks + mov sp, x1 + // Stack for the primary core =3D PrimaryCoreStack MOV32 (x2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) sub x22, x1, x2 =20 - // Stack for the secondary core =3D Number of Cores - 1 - MOV32 (x1, (FixedPcdGet32(PcdCoreCount) - 1) * FixedPcdGet32(PcdCPUCoreS= econdaryStackSize)) - sub x22, x22, x1 - - // x22 =3D The base of the MpCore Stacks (primary stack & secondary stac= ks) - mov x0, x22 - mov x1, x20 - //ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackS= ize) - MOV32 (x2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) - MOV32 (x3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) - bl ASM_PFX(ArmPlatformStackSet) - mov x0, x20 mov x1, x21 mov x2, x22 diff --git a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/Arm= /ModuleEntryPoint.S index a918c191432e..ced08593e9de 100644 --- a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S +++ b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S @@ -120,22 +120,12 @@ _GetBaseUefiMemory: =20 _GetStackBase: // r1 =3D The top of the Mpcore Stacks + mov sp, r1 + // Stack for the primary core =3D PrimaryCoreStack MOV32 (r2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) sub r9, r1, r2 =20 - // Stack for the secondary core =3D Number of Cores - 1 - MOV32 (r1, (FixedPcdGet32(PcdCoreCount) - 1) * FixedPcdGet32(PcdCPUCoreS= econdaryStackSize)) - sub r9, r9, r1 - - // r9 =3D The base of the MpCore Stacks (primary stack & secondary stack= s) - mov r0, r9 - mov r1, r10 - //ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackS= ize) - MOV32 (r2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) - MOV32 (r3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) - bl ASM_PFX(ArmPlatformStackSet) - mov r0, r10 mov r1, r11 mov r2, r9 diff --git a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf b/ArmVirtP= kg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf index e816e9583da8..ae9a088c7256 100755 --- a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf +++ b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf @@ -54,7 +54,6 @@ [LibraryClasses] LzmaDecompressLib PeCoffGetEntryPointLib PrePiLib - ArmPlatformStackLib MemoryAllocationLib HobLib PrePiHobListPointerLib --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510934990022578.7909155297457; Fri, 17 Nov 2017 08:09:50 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 893092035BB22; Fri, 17 Nov 2017 08:05:28 -0800 (PST) Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9237121967BFF for ; Fri, 17 Nov 2017 08:05:27 -0800 (PST) Received: by mail-wr0-x242.google.com with SMTP id z75so1190681wrc.5 for ; Fri, 17 Nov 2017 08:09:38 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:36 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::242; helo=mail-wr0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VJrH5RxIrJVOnhVNXhVJF+xedCI6iip9i3X9zBpJkWg=; b=NFQ9Z5aeFMcs2/RAPnNJ+XyyKY96uhqOZ174pzYBZHUjb4/yA2oo7Txz99niP/gwVX SwOPgZXEQKe1CATIBUni6lKVdwUgsnQ35NQi/5cyiAjtnzA3jiqRUjmu7VG1ULKtVgwP Lx3t9+AH/QFgJRCYKTUamVt7+cQ5h3xe3uDJg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VJrH5RxIrJVOnhVNXhVJF+xedCI6iip9i3X9zBpJkWg=; b=hkG140uSfnf5bxSdJqE0Q4L7v2Klv5G6gShR1q0lMc9DFbg3uJCfAib+y5p125TJbv frRkB9vz+wU0Mluvss8df4RXalfp69/ipEquEKRkgE+7IMeHBMf9sD+acAkYe2uOxRiR RZpn8B/VfDydVEK8V+ehWhrLeLeGlM3tU6VjqpdOS6R62NMVBEWwhvTdwQgldpx+Wkn/ hGx+q07rsUBKEXywtejsMAvno5bzkkdxQFswV9QPP0ILY6N1Pht6WEPjE9j1BWDFqJ6e 0m4UoXps7TW7lUTCf45nkrxvSjiB8FpqwzPykVQCIxyYvXeLdqjVAeQd+OvKFELltBIy 9qgQ== X-Gm-Message-State: AJaThX7EF701rRZ7pgUnNeLc5EklzNQn1QBePVXxwMAszcEH1+TSs0ZO hNb5K7WSSmCnjoyD897y5w3FfwJ7mnY= X-Google-Smtp-Source: AGs4zMbmIrg3zKjI4R4L6Ctm6evXQVMgkmjB/PdjhnKIPfiBESGvrqmbDCqWG3jVwB0HGumbgjX7fw== X-Received: by 10.223.142.49 with SMTP id n46mr4698612wrb.279.1510934976916; Fri, 17 Nov 2017 08:09:36 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:06 +0000 Message-Id: <20171117160913.17292-9-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 08/15] ArmVirtPkg/PrePi: remove bogus IntelFrameworkModulePkg.dec dependency X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" PrePi doesn't use anything defined by this package so drop the bogus dependency. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 1 - 1 file changed, 1 deletion(-) diff --git a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf b/ArmVirtP= kg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf index ae9a088c7256..58290d2d1b76 100755 --- a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf +++ b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf @@ -40,7 +40,6 @@ [Packages] ArmPkg/ArmPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec ArmVirtPkg/ArmVirtPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec =20 [LibraryClasses] BaseLib --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510934993619860.417114535986; Fri, 17 Nov 2017 08:09:53 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C44E42035BB21; Fri, 17 Nov 2017 08:05:30 -0800 (PST) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 623DD2035BB1C for ; Fri, 17 Nov 2017 08:05:29 -0800 (PST) Received: by mail-wm0-x244.google.com with SMTP id r68so7495636wmr.3 for ; Fri, 17 Nov 2017 08:09:40 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:37 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::244; helo=mail-wm0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aAe7bvypbVrUcCBMsziDXYOI2cMdEGHa3FLlqUVBDp0=; b=ZomGUXMUemmzPkQJZTH5MrahoproY6WnAcxGCnp8I99ImPTs7LreC+0YFflUs9JBWg +rP/0eLmabYI1yATxwq7PSMkAxd/IalotUpF7WC3D8hWqZENTN425HjJFPKbL04WS3uE qInyvsQfVjctfxqrB/awB2A98KL2+BW6IA6vI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aAe7bvypbVrUcCBMsziDXYOI2cMdEGHa3FLlqUVBDp0=; b=MKXuPJ7MlkVgEIKUMKcYsHZjO2Duq9laFolIKU6GBlp/3mgV5CGehDyCfefh5Ifcda Zvt54rwuc+ZqyoItsv4OM8iw+26XPHdOPCgRTxA7VFB1+U3W+Za9zpQFxTgWFrF/3HYk fqw3juWhG32emO2IR2xZ7P5KmsluLZmkVA664OsIN6e/jUy4ASkNwul7hVDJaNd0r+aX 0DSHF4XQSUxGgB86JUg0ReuGtwNLqLoMU3II/j31xkIbf/jNNpqLZqRGOsig5iT9uCuX LBY1SxNCvWIhlQZ925ZPHE6SzvYJHZnDPuuCh2d9/B3lel7vMj9kLEmt8OlixcdU8ltV 9nIg== X-Gm-Message-State: AJaThX4C9CY2NLRaDEkzm9D/GdHxY1nKslB3vn1jJcuhg020dgzh2Lvo mnqSmUFi2iW+stI0CIrHO1anHatJo+c= X-Google-Smtp-Source: AGs4zMaiTevEueLJpnstBwGgLGIur8jcgIs5nm4cj1RjRYzF4VlvQ/35RN6wRY9lX08N2rfedxCJXA== X-Received: by 10.28.232.130 with SMTP id f2mr2903852wmi.46.1510934978651; Fri, 17 Nov 2017 08:09:38 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:07 +0000 Message-Id: <20171117160913.17292-10-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 09/15] ArmVirtPkg/ArmVirtPlatformLib: remove support for uncached mappings X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" QEMU/KVM has very little tolerance for using anything except writeback cacheable mappings of DRAM, so let's remove the 'feature' that allows us to select uncached mappings at build time. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c b/ArmVirtPkg/L= ibrary/ArmVirtPlatformLib/VirtMem.c index d10548f86dfc..4368d05f76ef 100644 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c +++ b/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c @@ -22,10 +22,6 @@ // Number of Virtual Memory Map Descriptors #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5 =20 -// DDR attributes -#define DDR_ATTRIBUTES_CACHED ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK -#define DDR_ATTRIBUTES_UNCACHED ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBU= FFERED - EFI_PHYSICAL_ADDRESS ArmGetPhysAddrTop ( VOID @@ -48,7 +44,6 @@ ArmPlatformGetVirtualMemoryMap ( IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap ) { - ARM_MEMORY_REGION_ATTRIBUTES CacheAttributes; ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; =20 ASSERT (VirtualMemoryMap !=3D NULL); @@ -65,17 +60,11 @@ ArmPlatformGetVirtualMemoryMap ( return; } =20 - if (FeaturePcdGet (PcdCacheEnable) =3D=3D TRUE) { - CacheAttributes =3D DDR_ATTRIBUTES_CACHED; - } else { - CacheAttributes =3D DDR_ATTRIBUTES_UNCACHED; - } - // System DRAM VirtualMemoryTable[0].PhysicalBase =3D PcdGet64 (PcdSystemMemoryBase); VirtualMemoryTable[0].VirtualBase =3D VirtualMemoryTable[0].PhysicalBas= e; VirtualMemoryTable[0].Length =3D PcdGet64 (PcdSystemMemorySize); - VirtualMemoryTable[0].Attributes =3D CacheAttributes; + VirtualMemoryTable[0].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_WRITE= _BACK; =20 DEBUG ((EFI_D_INFO, "%a: Dumping System DRAM Memory Map:\n" "\tPhysicalBase: 0x%lX\n" @@ -104,7 +93,7 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryTable[3].PhysicalBase =3D FixedPcdGet64 (PcdFdBaseAddress); VirtualMemoryTable[3].VirtualBase =3D VirtualMemoryTable[3].PhysicalBas= e; VirtualMemoryTable[3].Length =3D FixedPcdGet32 (PcdFdSize); - VirtualMemoryTable[3].Attributes =3D CacheAttributes; + VirtualMemoryTable[3].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_WRITE= _BACK; =20 // End of Table ZeroMem (&VirtualMemoryTable[4], sizeof (ARM_MEMORY_REGION_DESCRIPTOR)); --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510934997350478.7817777087671; Fri, 17 Nov 2017 08:09:57 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0AB7B2035BB26; Fri, 17 Nov 2017 08:05:33 -0800 (PST) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 024E92035BB24 for ; Fri, 17 Nov 2017 08:05:30 -0800 (PST) Received: by mail-wm0-x243.google.com with SMTP id b189so7481340wmd.0 for ; Fri, 17 Nov 2017 08:09:41 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:39 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::243; helo=mail-wm0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=czegQEplayVd6OVuFpEeJbO+lbibqGWFW6iKBUYI4a0=; b=X0XpSckfG8fqBcHPjfGSIpdFWFv9pnWnGA5b0SReivt+YJGeYUn8k9Kdk2fNNC0Gyk rqW3mnD2o1RbZyWYw1qkXkR/m7+WAyES4s7VAedy6hqN06Ye2VALf1tA8afbO2fOF316 T5qhPn4MTECcub2nbbZTwhUuvoqgVOcyW5X7I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=czegQEplayVd6OVuFpEeJbO+lbibqGWFW6iKBUYI4a0=; b=Xp+l2p8NWAy7GgBHFCqjjaVcjenjHWQIwDU0qzmR1A5z1xRe+m0U961xwS+kFwS8WW YMjfE1ms09/JLV6zmMDgScsTVd+WJCdG8k3cQ7KX5QseiXtrQ2A0GM1E2Fb+3idAXxLL Eovndff/MDSi5rNzpmm1K89QAfPfRZ1mhQGeyydi4bPjGmpit9pF38qlA2bxbOscYJoV sEV6xIH4AMVOuIlSw3Ai1+O+o/Uwylexrt4V7ZFNo9CjZJcx2gyEmlm23Omudc+hzsBR //udr+fcqqouy697Nc9R5wXvU6FxSHIG8tvidgBFTurq1iOm2ytoc35J8Vjb1VMFSKIS NTYg== X-Gm-Message-State: AJaThX58+ggbaHwO+u2ZSlGC84Wj5alM70VhOZWr+1hdiAF/+t61boQe Asjn9o8JSJpdiJr35lWiOUfR6k9cups= X-Google-Smtp-Source: AGs4zMbyoDrRiVte3FtZvbD9h1qFbzND8WrmuXtdttbG4bmomM7nKcEo9JH/D+QNhTnu0MDoaQmFdg== X-Received: by 10.28.30.151 with SMTP id e145mr4274632wme.8.1510934980218; Fri, 17 Nov 2017 08:09:40 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:08 +0000 Message-Id: <20171117160913.17292-11-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 10/15] ArmVirtPkg: introduce ArmVirtMemInfoLib library class X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" As part of the effort to get rid of ArmPlatformLib (which incorporates far too many duties in a single library), introduce ArmVirtMemInfoLib which will be invoked by our ArmVirtMemoryInitPeiLib implementation to get a description of the virtual address space. This will allow us to remove this functionality from ArmPlatformLib later, or, in the case of ArmVirtXen and ArmVirtQemuKernel, drop ArmPlatformLib altogether. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- ArmVirtPkg/ArmVirtPkg.dec | 3 ++ ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h | 39 ++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index a8603e1b80e5..8f656fd2739d 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -30,6 +30,9 @@ [Defines] [Includes.common] Include # Root include for the package =20 +[LibraryClasses] + ArmVirtMemInfoLib|Include/Library/ArmVirtMemInfoLib.h + [Guids.common] gArmVirtTokenSpaceGuid =3D { 0x0B6F5CA7, 0x4F53, 0x445A, { 0xB7, 0x6E, 0= x2E, 0x36, 0x5B, 0x80, 0x63, 0x66 } } gEarlyPL011BaseAddressGuid =3D { 0xB199DEA9, 0xFD5C, 0x4A84, { 0x8= 0, 0x82, 0x2F, 0x41, 0x70, 0x78, 0x03, 0x05 } } diff --git a/ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h b/ArmVirtPkg/In= clude/Library/ArmVirtMemInfoLib.h new file mode 100644 index 000000000000..65be2cbd8082 --- /dev/null +++ b/ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h @@ -0,0 +1,39 @@ +/** @file + + Copyright (c) 2011-2013, ARM Limited. All rights reserved. + Copyright (c) 2017, Linaro, Ltd. All rights reserved. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +#ifndef _ARM_VIRT_MEMINFO_LIB_H_ +#define _ARM_VIRT_MEMINFO_LIB_H_ + +#include +#include + +/** + Return the Virtual Memory Map of your platform + + This Virtual Memory Map is used by MemoryInitPei Module to initialize th= e MMU + on your platform. + + @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR + describing a Physical-to-Virtual Memory + mapping. This array must be ended by a + zero-filled entry + +**/ +VOID +ArmVirtGetMemoryMap ( + OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap + ); + +#endif --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510935001707453.8416928295045; Fri, 17 Nov 2017 08:10:01 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 45D472035BB2A; Fri, 17 Nov 2017 08:05:34 -0800 (PST) Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3F26A2035BB1B for ; Fri, 17 Nov 2017 08:05:33 -0800 (PST) Received: by mail-wr0-x242.google.com with SMTP id o14so2527074wrf.9 for ; Fri, 17 Nov 2017 08:09:44 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:41 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::242; helo=mail-wr0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DHYPsHUyJnkXwOtAyJVkdHe735EJ8P/Ym8cSrOQOGYU=; b=O0FtIFAEB3M9otyY/w30bgialXYQGMaKjz6LTNDhwJX5ule4iDBe3Pqjw9xM3Ie2ET gZbVEG/oT+2bZ1kPYzgLQOkEoGyz5zn4hOWQ1QTLdKT+ho1TP5vbBS+Tq5W2LQaGdm8S syOxwG7nh4bKjvc+0eI8nLWVa31hyv0xudhrk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DHYPsHUyJnkXwOtAyJVkdHe735EJ8P/Ym8cSrOQOGYU=; b=dhUrwtpGckDxVgYDArrJO7OCVFARyNqKyz13S6U0bhX9hCkoOfS+40Bn+U9OzaTQ5U ffby7a+7VZEj/N5U3vlvOt+BRbcGtB7zNpau8OjYM7za5h0AcOiBvT6Wea/sdL8y9tZX m8r5OUac4kyJnKQDYBi5U4KccEig6wwXH4ph/kFxYGFPuF78pzb77QF2iV6oXgpzybAM rUsvr4Ltuty5+ZN22jQB//Cc/V0Zv6SScG5jUV1pgxDCSki7Z6UVuzUl5d35PvcwISul w8WGT/H0j3BzeTaXNE42C60tSHgAxB0NIhieKRbgxoHDi3Mu9uZVK0A7Sh73vGwVK3sb EthQ== X-Gm-Message-State: AJaThX4n/aPuq8tsJOBLPZ9zgZIQ/TN14agAOulw2MEWVxMWzBvqe32f kg1GBKIXojrnuCMy+GDylcnEfQ194ik= X-Google-Smtp-Source: AGs4zMZ88cQ+u6qPRa9+SiN7S7DFhFja6mA/9EMjIZACpviryBF++DHGOUkTSCjjqSY6MwmzYxadzg== X-Received: by 10.223.172.245 with SMTP id o108mr5329765wrc.122.1510934982411; Fri, 17 Nov 2017 08:09:42 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:09 +0000 Message-Id: <20171117160913.17292-12-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 11/15] ArmVirtPkg/ArmVirtXen: add ArmVirtMemInfoLib implementation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Clone the existing ArmPlatformGetVirtualMemoryMap () for this platform, clean it up slightly (by using a static buffer rather than a heap allocation, and removing the support for uncached DRAM mappings), and turn it into a new ArmVirtMemInfoLib implementation. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Acked-by: Laszlo Ersek --- ArmVirtPkg/ArmVirtXen.dsc | 1 + ArmVirtPkg/Library/XenVirtMemInfoLib/AArch64/PhysAddrTop.S | 39 ++++++++++= +++ ArmVirtPkg/Library/XenVirtMemInfoLib/Arm/PhysAddrTop.S | 24 ++++++++ ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.c | 61 ++++++++++= ++++++++++ ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.inf | 41 ++++++++++= +++ 5 files changed, 166 insertions(+) diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index 7a443483d1ac..3df684d13cb0 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -44,6 +44,7 @@ [LibraryClasses] VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice= Lib.inf =20 ArmPlatformLib|ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ArmXenRel= ocatablePlatformLib.inf + ArmVirtMemInfoLib|ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib= .inf =20 TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf =20 diff --git a/ArmVirtPkg/Library/XenVirtMemInfoLib/AArch64/PhysAddrTop.S b/A= rmVirtPkg/Library/XenVirtMemInfoLib/AArch64/PhysAddrTop.S new file mode 100644 index 000000000000..a1f6a194d59b --- /dev/null +++ b/ArmVirtPkg/Library/XenVirtMemInfoLib/AArch64/PhysAddrTop.S @@ -0,0 +1,39 @@ +# +# Copyright (c) 2011-2013, ARM Limited. All rights reserved. +# Copyright (c) 2016-2017, Linaro Limited. All rights reserved. +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may = be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +# + +#include + +//EFI_PHYSICAL_ADDRESS +//GetPhysAddrTop ( +// VOID +// ); +ASM_FUNC(ArmGetPhysAddrTop) + mrs x0, id_aa64mmfr0_el1 + adr x1, .LPARanges + and x0, x0, #7 + ldrb w1, [x1, x0] + mov x0, #1 + lsl x0, x0, x1 + ret + +// +// Bits 0..2 of the AA64MFR0_EL1 system register encode the size of the +// physical address space support on this CPU: +// 0 =3D=3D 32 bits, 1 =3D=3D 36 bits, etc etc +// 6 and 7 are reserved +// +.LPARanges: + .byte 32, 36, 40, 42, 44, 48, -1, -1 + +ASM_FUNCTION_REMOVE_IF_UNREFERENCED diff --git a/ArmVirtPkg/Library/XenVirtMemInfoLib/Arm/PhysAddrTop.S b/ArmVi= rtPkg/Library/XenVirtMemInfoLib/Arm/PhysAddrTop.S new file mode 100644 index 000000000000..9cd81529fb3d --- /dev/null +++ b/ArmVirtPkg/Library/XenVirtMemInfoLib/Arm/PhysAddrTop.S @@ -0,0 +1,24 @@ +# +# Copyright (c) 2011-2013, ARM Limited. All rights reserved. +# Copyright (c) 2014-2017, Linaro Limited. All rights reserved. +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may = be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +# + +#include + +//EFI_PHYSICAL_ADDRESS +//GetPhysAddrTop ( +// VOID +// ); +ASM_FUNC(ArmGetPhysAddrTop) + mov r0, #0x00000000 + mov r1, #0x10000 + bx lr diff --git a/ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.c b/Arm= VirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.c new file mode 100644 index 000000000000..cc806b474560 --- /dev/null +++ b/ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.c @@ -0,0 +1,61 @@ +/** @file + + Copyright (c) 2014-2017, Linaro Limited. All rights reserved. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +#include +#include +#include + +STATIC ARM_MEMORY_REGION_DESCRIPTOR mVirtualMemoryTable[2]; + +EFI_PHYSICAL_ADDRESS +ArmGetPhysAddrTop ( + VOID + ); + +/** + Return the Virtual Memory Map of your platform + + This Virtual Memory Map is used by MemoryInitPei Module to initialize th= e MMU + on your platform. + + @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR + describing a Physical-to-Virtual Memory + mapping. This array must be ended by a + zero-filled entry + +**/ +VOID +ArmVirtGetMemoryMap ( + OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap + ) +{ + ASSERT (VirtualMemoryMap !=3D NULL); + + // + // Map the entire physical memory space as cached. The only device + // we care about is the GIC, which will be stage 2 mapped as a device + // by the hypervisor, overriding the cached mapping we install here. + // + mVirtualMemoryTable[0].PhysicalBase =3D 0x0; + mVirtualMemoryTable[0].VirtualBase =3D 0x0; + mVirtualMemoryTable[0].Length =3D ArmGetPhysAddrTop (); + mVirtualMemoryTable[0].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_WRIT= E_BACK; + + mVirtualMemoryTable[1].PhysicalBase =3D 0x0; + mVirtualMemoryTable[1].VirtualBase =3D 0x0; + mVirtualMemoryTable[1].Length =3D 0x0; + mVirtualMemoryTable[1].Attributes =3D 0x0; + + *VirtualMemoryMap =3D mVirtualMemoryTable; +} diff --git a/ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.inf b/A= rmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.inf new file mode 100644 index 000000000000..cd4c805a4db9 --- /dev/null +++ b/ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib.inf @@ -0,0 +1,41 @@ +#/* @file +# +# Copyright (c) 2011-2015, ARM Limited. All rights reserved. +# Copyright (c) 2014-2017, Linaro Limited. All rights reserved. +# +# This program and the accompanying materials are licensed and made avail= able +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +#*/ + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D XenVirtMemInfoLib + FILE_GUID =3D 40d1f8f5-4dfe-4e0f-9a15-b1de9dc9f4ed + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D ArmVirtMemInfoLib + +[Sources] + XenVirtMemInfoLib.c + +[Sources.ARM] + Arm/PhysAddrTop.S + +[Sources.AARCH64] + AArch64/PhysAddrTop.S + +[Packages] + ArmPkg/ArmPkg.dec + ArmVirtPkg/ArmVirtPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + ArmLib + DebugLib --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510935007001986.0479270143984; Fri, 17 Nov 2017 08:10:07 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7FAF72035BB24; Fri, 17 Nov 2017 08:05:36 -0800 (PST) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CF9DB2035BB1B for ; Fri, 17 Nov 2017 08:05:34 -0800 (PST) Received: by mail-wm0-x243.google.com with SMTP id x63so7455921wmf.2 for ; Fri, 17 Nov 2017 08:09:45 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:43 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::243; helo=mail-wm0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=C+BFjaiJILBKPy0g98gmJQ77ngSoX4OhYhbCR3enxGw=; b=gyHS8oFAzcsr/4zy4wSjDejEul//0B5OjfjhqpZc6EgAhX9Mx788soVPFdONPwGHix loPQIKaJ+h8p0dQrVcjBEnZChaJvpE9c3jDIefFLIiLW3X6FDf0JUmWqIsFlORXBhujr MomIgnBYB4PJYfzb8ybXK9cM6HJg25GZ9fjpM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=C+BFjaiJILBKPy0g98gmJQ77ngSoX4OhYhbCR3enxGw=; b=MoHxnTvtElKGdzfQU+AdSezbo9NaO8XchFJLZ5LhD9SsI15SRzrg1VzLuf4sxav4r3 h6ds4r0m5aqJB3tRR9a2Xqp3tgtZEn8ZnxpVJNV5vw9AGXTmKMMbw2u+D9aosgc7250M QvK9dLWZnwxYXW5UDf1gS1JB0i3LVLMqLSOKFWpwIkb1ehqwhELMSmZ1CQmnogfuWewD VAuyL6suk0eTmVDyXZpU/JxJ9PhJ7YNid52GHNrSG73/jKmAvQddHNoiGezMSSZMqIIb 2OcMAtMBeN2DdsYeVEsGJHbOn76Y2NSqar+m4RcCc+6MMIdUBIH30Lc71+vnIEfNGdYx KsVA== X-Gm-Message-State: AJaThX57L9+8lsB/3dPdrXAbx8VDrdnCJCM9Rc1W7aKDgPpEvS416geX ryk8HcRlNBWHKAbPtxjz30FArgyjoq8= X-Google-Smtp-Source: AGs4zMYWrEO0jmC+zXfwlv67J88AuxmKxgyq+9wfWb/9Wu88WjS/ODMth1sQ6/1uygGaOZZHOsWA4A== X-Received: by 10.28.45.214 with SMTP id t205mr4626624wmt.94.1510934984047; Fri, 17 Nov 2017 08:09:44 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:10 +0000 Message-Id: <20171117160913.17292-13-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 12/15] ArmVirtPkg/ArmVirtQemu: add ArmVirtMemInfoLib implementation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Clone the existing ArmPlatformGetVirtualMemoryMap () for this platform, clean it up slightly (by removing the support for uncached DRAM mappings), and turn it into a new ArmVirtMemInfoLib implementation. In a future patch, we will add this library to the ordinary ArmVirtQemu platform as well. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- ArmVirtPkg/ArmVirtQemuKernel.dsc | 1 + ArmVirtPkg/Library/QemuVirtMemInfoLib/AArch64/PhysAddrTop.S | 39 ++++++++ ArmVirtPkg/Library/QemuVirtMemInfoLib/Arm/PhysAddrTop.S | 24 +++++ ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c | 101 +++++++= +++++++++++++ ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf | 53 +++++++= +++ 5 files changed, 218 insertions(+) diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKerne= l.dsc index 7e5d584344b4..f50d30388cf2 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -49,6 +49,7 @@ [LibraryClasses.common] QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf =20 ArmPlatformLib|ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ArmQemuR= elocatablePlatformLib.inf + ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoL= ib.inf =20 TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf NorFlashPlatformLib|ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.i= nf diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/AArch64/PhysAddrTop.S b/= ArmVirtPkg/Library/QemuVirtMemInfoLib/AArch64/PhysAddrTop.S new file mode 100644 index 000000000000..a1f6a194d59b --- /dev/null +++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/AArch64/PhysAddrTop.S @@ -0,0 +1,39 @@ +# +# Copyright (c) 2011-2013, ARM Limited. All rights reserved. +# Copyright (c) 2016-2017, Linaro Limited. All rights reserved. +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may = be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +# + +#include + +//EFI_PHYSICAL_ADDRESS +//GetPhysAddrTop ( +// VOID +// ); +ASM_FUNC(ArmGetPhysAddrTop) + mrs x0, id_aa64mmfr0_el1 + adr x1, .LPARanges + and x0, x0, #7 + ldrb w1, [x1, x0] + mov x0, #1 + lsl x0, x0, x1 + ret + +// +// Bits 0..2 of the AA64MFR0_EL1 system register encode the size of the +// physical address space support on this CPU: +// 0 =3D=3D 32 bits, 1 =3D=3D 36 bits, etc etc +// 6 and 7 are reserved +// +.LPARanges: + .byte 32, 36, 40, 42, 44, 48, -1, -1 + +ASM_FUNCTION_REMOVE_IF_UNREFERENCED diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/Arm/PhysAddrTop.S b/ArmV= irtPkg/Library/QemuVirtMemInfoLib/Arm/PhysAddrTop.S new file mode 100644 index 000000000000..9cd81529fb3d --- /dev/null +++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/Arm/PhysAddrTop.S @@ -0,0 +1,24 @@ +# +# Copyright (c) 2011-2013, ARM Limited. All rights reserved. +# Copyright (c) 2014-2017, Linaro Limited. All rights reserved. +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may = be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +# + +#include + +//EFI_PHYSICAL_ADDRESS +//GetPhysAddrTop ( +// VOID +// ); +ASM_FUNC(ArmGetPhysAddrTop) + mov r0, #0x00000000 + mov r1, #0x10000 + bx lr diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c b/A= rmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c new file mode 100644 index 000000000000..b08305fe4a4f --- /dev/null +++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c @@ -0,0 +1,101 @@ +/** @file + + Copyright (c) 2014-2017, Linaro Limited. All rights reserved. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +#include +#include +#include +#include +#include + +// Number of Virtual Memory Map Descriptors +#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5 + +EFI_PHYSICAL_ADDRESS +ArmGetPhysAddrTop ( + VOID + ); + +/** + Return the Virtual Memory Map of your platform + + This Virtual Memory Map is used by MemoryInitPei Module to initialize th= e MMU + on your platform. + + @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR + describing a Physical-to-Virtual Memory + mapping. This array must be ended by a + zero-filled entry + +**/ +VOID +ArmVirtGetMemoryMap ( + OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap + ) +{ + ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; + UINT64 TopOfMemory; + UINTN TableSize; + + ASSERT (VirtualMemoryMap !=3D NULL); + + TableSize =3D sizeof (ARM_MEMORY_REGION_DESCRIPTOR) * + MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS; + VirtualMemoryTable =3D AllocatePages (EFI_SIZE_TO_PAGES (TableSize)); + + if (VirtualMemoryTable =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: Error: Failed AllocatePages()\n", __FUNCTION= __)); + return; + } + + // System DRAM + VirtualMemoryTable[0].PhysicalBase =3D PcdGet64 (PcdSystemMemoryBase); + VirtualMemoryTable[0].VirtualBase =3D VirtualMemoryTable[0].PhysicalBas= e; + VirtualMemoryTable[0].Length =3D PcdGet64 (PcdSystemMemorySize); + VirtualMemoryTable[0].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_WRITE= _BACK; + + DEBUG ((DEBUG_INFO, "%a: Dumping System DRAM Memory Map:\n" + "\tPhysicalBase: 0x%lX\n" + "\tVirtualBase: 0x%lX\n" + "\tLength: 0x%lX\n", + __FUNCTION__, + VirtualMemoryTable[0].PhysicalBase, + VirtualMemoryTable[0].VirtualBase, + VirtualMemoryTable[0].Length)); + + // Peripheral space before DRAM + VirtualMemoryTable[1].PhysicalBase =3D 0x0; + VirtualMemoryTable[1].VirtualBase =3D 0x0; + VirtualMemoryTable[1].Length =3D VirtualMemoryTable[0].PhysicalBas= e; + VirtualMemoryTable[1].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_DEVIC= E; + + // Peripheral space after DRAM + TopOfMemory =3D MIN (1ULL << FixedPcdGet8 (PcdPrePiCpuMemorySize), + ArmGetPhysAddrTop ()); + VirtualMemoryTable[2].PhysicalBase =3D VirtualMemoryTable[0].Length + Vi= rtualMemoryTable[1].Length; + VirtualMemoryTable[2].VirtualBase =3D VirtualMemoryTable[2].PhysicalBas= e; + VirtualMemoryTable[2].Length =3D TopOfMemory - + VirtualMemoryTable[2].PhysicalBase; + VirtualMemoryTable[2].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_DEVIC= E; + + // Remap the FD region as normal executable memory + VirtualMemoryTable[3].PhysicalBase =3D PcdGet64 (PcdFdBaseAddress); + VirtualMemoryTable[3].VirtualBase =3D VirtualMemoryTable[3].PhysicalBas= e; + VirtualMemoryTable[3].Length =3D FixedPcdGet32 (PcdFdSize); + VirtualMemoryTable[3].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_WRITE= _BACK; + + // End of Table + ZeroMem (&VirtualMemoryTable[4], sizeof (ARM_MEMORY_REGION_DESCRIPTOR)); + + *VirtualMemoryMap =3D VirtualMemoryTable; +} diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf b= /ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf new file mode 100644 index 000000000000..8f6ba006fdfd --- /dev/null +++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf @@ -0,0 +1,53 @@ +#/* @file +# +# Copyright (c) 2011-2015, ARM Limited. All rights reserved. +# Copyright (c) 2014-2017, Linaro Limited. All rights reserved. +# +# This program and the accompanying materials are licensed and made avail= able +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +#*/ + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D QemuVirtMemInfoLib + FILE_GUID =3D 9b30ca82-6746-4a82-a3e6-11ea79df3b46 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D ArmVirtMemInfoLib + +[Sources] + QemuVirtMemInfoLib.c + +[Sources.ARM] + Arm/PhysAddrTop.S + +[Sources.AARCH64] + AArch64/PhysAddrTop.S + +[Packages] + ArmPkg/ArmPkg.dec + ArmVirtPkg/ArmVirtPkg.dec + EmbeddedPkg/EmbeddedPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + ArmLib + BaseMemoryLib + DebugLib + MemoryAllocationLib + +[Pcd] + gArmTokenSpaceGuid.PcdFdBaseAddress + gArmTokenSpaceGuid.PcdSystemMemoryBase + gArmTokenSpaceGuid.PcdSystemMemorySize + +[FixedPcd] + gArmTokenSpaceGuid.PcdFdSize + gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510935014254720.8396590362073; Fri, 17 Nov 2017 08:10:14 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BB11A2035BB2F; Fri, 17 Nov 2017 08:05:38 -0800 (PST) Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0F2F52035BB1B for ; Fri, 17 Nov 2017 08:05:37 -0800 (PST) Received: by mail-wr0-x242.google.com with SMTP id y42so2547599wrd.3 for ; Fri, 17 Nov 2017 08:09:47 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:45 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::242; helo=mail-wr0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=elXGuBIDcJQpuC57Kto6kn/sPbmenb3984UQ8RqD/bw=; b=BOlCG2vfwf5sl4MtPd+7r3nbKqxTL+kOLaDVQ+e32qDq5vLm9w+6eBX8KstezYtI+E 4KNQ22wIiQsyc2pQ1kM6/OhtESxEDe121Sdktrig5z2KqPstfmxDcakxzALdQxss8ajz SHM7amW9qcYHc98qCQsotGrzIA7sb3CMn1w14= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=elXGuBIDcJQpuC57Kto6kn/sPbmenb3984UQ8RqD/bw=; b=qgZue1D7pg3FmTl0lkITgXqhBHgCyKLMTlAThuhx+LYawR9SZo49pnr42Br4GRJN6a fRozqnyCcu6m8LQsjSiBapl3xwuRDB1Z79/jXtFYa4bb3cxAedW1U5MvxsAMiG9uOuTB OwygQw0qJ0nofWzoCnZ1XsJurdhUd/XoI1tpSTUz+2wt4lUO13QVRWP3hzfAMMYSyOlv /TFYhspzf5bhvHUp8VU3JOD+J2XqKVoY2tYL2/SJP1SlyjBJ44gvn9oIU/nK8tvGJ8yH zVlhIpZj2m3C4tsbPNZFloTb+GGk7rjXxNzigNevTRt7ttbyInp0Yz3gb1FP9MCZgplH hSrA== X-Gm-Message-State: AJaThX5Umb4VvtB5PSK68RnusHlXxv5prPPTvPdgrkP4Kd5fN0eGcndx KpQKgyZCr6DH7Hhq63WqV2IbLeELBxo= X-Google-Smtp-Source: AGs4zMZo/eXY+UY3nYl7nvOD3SE83w9AgTQjH15+P704xiVdUmG44y2RF00YeyyY+crblJTXeqVoJw== X-Received: by 10.223.199.205 with SMTP id y13mr5095023wrg.71.1510934986176; Fri, 17 Nov 2017 08:09:46 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:11 +0000 Message-Id: <20171117160913.17292-14-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 13/15] ArmVirtPkg: implement ArmVirtMemInfo PPI, PEIM and library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Equivalent to the PrePi based platforms, this patch implements the newly introduced ArmVirtMemInfo library class via a separate PEIM and PPI. The reason is that ArmVirtPlatformLib has populated the ArmPlatformLib API function ArmPlatformInitializeSystemMemory () to retrieve memory information from the DT, ensuring that it will be present when MemoryPeim() is executed. This is a bit of a hack, and someting we will need to get rid of if we want to reduce our dependency on ArmPlatformLib altogether. Putting this code in a ArmVirtMemInfo library constructor is problematic as well, given that the implementation uses other libraries, among which PcdLib, and so we need to find another way to run it before MemoryPeim() So instead, create a separate PEIM that encapsulates the ArmVirtMemInfo code and exposes it via a PPI. Another ArmVirtMemInfo library class implementation is also provided that depexes on the PPI, which ensures that the code is called in the correct order. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtPkg.dec | 3 + ArmVirtPkg/Include/Ppi/ArmVirtMemInfo.h | 48 ++++++++ ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.c | 46 ++++++++ ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.inf | 42 +++++++ ArmVirtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.c | 121 +++++++++= +++++++++++ ArmVirtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.inf | 60 ++++++++++ 6 files changed, 320 insertions(+) diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index 8f656fd2739d..260849dc845c 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -39,6 +39,9 @@ [Guids.common] =20 gArmVirtVariableGuid =3D { 0x50bea1e5, 0xa2c5, 0x46e9, { 0x9b, 0x3a, 0= x59, 0x59, 0x65, 0x16, 0xb0, 0x0a } } =20 +[Ppis] + gArmVirtMemInfoPpiGuid =3D { 0x3b060b72, 0x8696, 0x4393, { 0xa8, 0x93, 0= x34, 0x25, 0x1e, 0x3f, 0x8a, 0x6b } } + [Protocols] gFdtClientProtocolGuid =3D { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0= x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C } } =20 diff --git a/ArmVirtPkg/Include/Ppi/ArmVirtMemInfo.h b/ArmVirtPkg/Include/P= pi/ArmVirtMemInfo.h new file mode 100644 index 000000000000..46885d02c384 --- /dev/null +++ b/ArmVirtPkg/Include/Ppi/ArmVirtMemInfo.h @@ -0,0 +1,48 @@ +/** @file + + Copyright (c) 2011-2013, ARM Limited. All rights reserved. + Copyright (c) 2017, Linaro, Ltd. All rights reserved. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +#ifndef _ARM_VIRT_MEMINFO_PPI_H_ +#define _ARM_VIRT_MEMINFO_PPI_H_ + +#include + +#define ARM_VIRT_MEMINFO_PPI_GUID \ + { 0x3b060b72, 0x8696, 0x4393, { 0xa8, 0x93, 0x34, 0x25, 0x1e, 0x3f, 0x8a= , 0x6b } } + +/** + Return the Virtual Memory Map of your platform + + This Virtual Memory Map is used by MemoryInitPei Module to initialize th= e MMU + on your platform. + + @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR + describing a Physical-to-Virtual Memory + mapping. This array must be ended by a + zero-filled entry + +**/ +typedef +VOID +(EFIAPI * GET_MEMORY_MAP) ( + OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap + ); + +typedef struct { + GET_MEMORY_MAP GetMemoryMap; +} ARM_VIRT_MEMINFO_PPI; + +extern EFI_GUID gArmVirtMemInfoPpiGuid; + +#endif diff --git a/ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.c b/Arm= VirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.c new file mode 100644 index 000000000000..ad27b246f980 --- /dev/null +++ b/ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.c @@ -0,0 +1,46 @@ +/** @file + + Copyright (c) 2014-2017, Linaro Limited. All rights reserved. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +#include +#include +#include +#include +#include + +/** + Return the Virtual Memory Map of your platform + + This Virtual Memory Map is used by MemoryInitPei Module to initialize th= e MMU + on your platform. + + @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR + describing a Physical-to-Virtual Memory + mapping. This array must be ended by a + zero-filled entry + +**/ +VOID +ArmVirtGetMemoryMap ( + OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap + ) +{ + ARM_VIRT_MEMINFO_PPI *MemInfo; + EFI_STATUS Status; + + Status =3D PeiServicesLocatePpi (&gArmVirtMemInfoPpiGuid, 0, NULL, + (VOID **)&MemInfo); + ASSERT_EFI_ERROR (Status); + + MemInfo->GetMemoryMap (VirtualMemoryMap); +} diff --git a/ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.inf b/A= rmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.inf new file mode 100644 index 000000000000..b661c2f43faf --- /dev/null +++ b/ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib.inf @@ -0,0 +1,42 @@ +#/* @file +# +# Copyright (c) 2011-2015, ARM Limited. All rights reserved. +# Copyright (c) 2014-2017, Linaro Limited. All rights reserved. +# +# This program and the accompanying materials are licensed and made avail= able +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +#*/ + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D PeiVirtMemInfoLib + FILE_GUID =3D 1d7bae0f-9674-4a4b-8d85-9804968cb12b + MODULE_TYPE =3D PEIM + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D ArmVirtMemInfoLib|PEIM + +[Sources] + PeiVirtMemInfoLib.c + +[Packages] + ArmPkg/ArmPkg.dec + ArmVirtPkg/ArmVirtPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + ArmLib + DebugLib + PeiServicesLib + +[Ppis] + gArmVirtMemInfoPpiGuid + +[Depex] + gArmVirtMemInfoPpiGuid diff --git a/ArmVirtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.c b/ArmVirt= Pkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.c new file mode 100644 index 000000000000..90ee552bdba0 --- /dev/null +++ b/ArmVirtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.c @@ -0,0 +1,121 @@ +/**@file + + Copyright (c) 2017, Linaro, Ltd. All rights reserved.
+ + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include + +STATIC ARM_VIRT_MEMINFO_PPI mArmVirtMeminfoPpi =3D { + ArmVirtGetMemoryMap +}; + +STATIC CONST EFI_PEI_PPI_DESCRIPTOR mArmVirtMeminfoPpiTable =3D { + EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, + &gArmVirtMemInfoPpiGuid, + &mArmVirtMeminfoPpi +}; + +EFI_STATUS +EFIAPI +QemuVirtMemInfoPeimEntryPoint ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +{ + VOID *DeviceTreeBase; + INT32 Node, Prev; + UINT64 NewBase, CurBase; + UINT64 NewSize, CurSize; + CONST CHAR8 *Type; + INT32 Len; + CONST UINT64 *RegProp; + RETURN_STATUS PcdStatus; + + NewBase =3D 0; + NewSize =3D 0; + + DeviceTreeBase =3D (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddr= ess); + ASSERT (DeviceTreeBase !=3D NULL); + + // + // Make sure we have a valid device tree blob + // + ASSERT (fdt_check_header (DeviceTreeBase) =3D=3D 0); + + // + // Look for the lowest memory node + // + for (Prev =3D 0;; Prev =3D Node) { + Node =3D fdt_next_node (DeviceTreeBase, Prev, NULL); + if (Node < 0) { + break; + } + + // + // Check for memory node + // + Type =3D fdt_getprop (DeviceTreeBase, Node, "device_type", &Len); + if (Type && AsciiStrnCmp (Type, "memory", Len) =3D=3D 0) { + // + // Get the 'reg' property of this node. For now, we will assume + // two 8 byte quantities for base and size, respectively. + // + RegProp =3D fdt_getprop (DeviceTreeBase, Node, "reg", &Len); + if (RegProp !=3D 0 && Len =3D=3D (2 * sizeof (UINT64))) { + + CurBase =3D fdt64_to_cpu (ReadUnaligned64 (RegProp)); + CurSize =3D fdt64_to_cpu (ReadUnaligned64 (RegProp + 1)); + + DEBUG ((DEBUG_INFO, "%a: System RAM @ 0x%lx - 0x%lx\n", + __FUNCTION__, CurBase, CurBase + CurSize - 1)); + + if (NewBase > CurBase || NewBase =3D=3D 0) { + NewBase =3D CurBase; + NewSize =3D CurSize; + } + } else { + DEBUG ((DEBUG_ERROR, "%a: Failed to parse FDT memory node\n", + __FUNCTION__)); + } + } + } + + // + // Make sure the start of DRAM matches our expectation + // + ASSERT (FixedPcdGet64 (PcdSystemMemoryBase) =3D=3D NewBase); + PcdStatus =3D PcdSet64S (PcdSystemMemorySize, NewSize); + ASSERT_RETURN_ERROR (PcdStatus); + + // + // We need to make sure that the machine we are running on has at least + // 128 MB of memory configured, and is currently executing this binary f= rom + // NOR flash. This prevents a device tree image in DRAM from getting + // clobbered when our caller installs permanent PEI RAM, before we have a + // chance of marking its location as reserved or copy it to a freshly + // allocated block in the permanent PEI RAM in the platform PEIM. + // + ASSERT (NewSize >=3D SIZE_128MB); + ASSERT ( + (((UINT64)PcdGet64 (PcdFdBaseAddress) + + (UINT64)PcdGet32 (PcdFdSize)) <=3D NewBase) || + ((UINT64)PcdGet64 (PcdFdBaseAddress) >=3D (NewBase + NewSize))); + + return PeiServicesInstallPpi (&mArmVirtMeminfoPpiTable); +} diff --git a/ArmVirtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.inf b/ArmVi= rtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.inf new file mode 100644 index 000000000000..ac91e065be57 --- /dev/null +++ b/ArmVirtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.inf @@ -0,0 +1,60 @@ +## @file +# +# Copyright (c) 2017, Linaro, Ltd. All rights reserved.
+# +# This program and the accompanying materials are licensed and made avail= able +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +## + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D QemuVirtMemInfoPeim + FILE_GUID =3D 91da13af-d0ff-4810-b9b9-b095a9ee6b09 + MODULE_TYPE =3D PEIM + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D QemuVirtMemInfoPeimEntryPoint + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D ARM AARCH64 +# + +[Sources] + QemuVirtMemInfoPeim.c + +[Packages] + ArmPkg/ArmPkg.dec + ArmVirtPkg/ArmVirtPkg.dec + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + ArmLib + ArmVirtMemInfoLib + DebugLib + FdtLib + PeimEntryPoint + PeiServicesLib + +[Pcd] + gArmTokenSpaceGuid.PcdSystemMemorySize + +[Ppis] + gArmVirtMemInfoPpiGuid + +[FixedPcd] + gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress + gArmTokenSpaceGuid.PcdSystemMemoryBase + gArmTokenSpaceGuid.PcdFdBaseAddress + gArmTokenSpaceGuid.PcdFdSize + gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize + +[Depex] + TRUE --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510935016326103.8108219250206; Fri, 17 Nov 2017 08:10:16 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 03C922035BB33; Fri, 17 Nov 2017 08:05:41 -0800 (PST) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DE6252035BB31 for ; Fri, 17 Nov 2017 08:05:38 -0800 (PST) Received: by mail-wm0-x243.google.com with SMTP id z3so7449220wme.3 for ; Fri, 17 Nov 2017 08:09:49 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:47 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::243; helo=mail-wm0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vA20VwNwe0y6VHpl3NvFP1xiJXbZcXkE8iHeycZQow8=; b=VM4qIGaQhvV6xM+h2M3KCXcAoBmBf5N7QMiskLwUpIJFFDWxFwTvh1JQBefkQMBGBh vsQf6mXBtdprofYc5R/Zuvg6P9jc+8zoqnPn4V5PKTCc1IKPiOROw8FRHEGGaLlnDV15 iJKZgnJ5XiJFoanaRe2rcnVPvtMuBFkSs5J1I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vA20VwNwe0y6VHpl3NvFP1xiJXbZcXkE8iHeycZQow8=; b=E0VRX09h379ZDBQbvgKFk12J/+hiJaApOh2ZOp/oF5y7Ni4BtnY7sOSSrpCHPmKhwR DwHie2EbEy0VaMr159wHSiXg1KzjT6cIAuwfWRHFTGRtTb6VHjYNTJcEcaJe5vWxwF2b b7NxOOSyoEUY6AwB4bqbzufac1LYn49r3bjXdoB6NEEX+VjES2cr3MTyZmK5b69qYHWD qltBBeEYVv6ieDq3LzCaY8tUaR7RQm4CZIZwZGQJYbM8SICebfW7gLdVFdtfGkO+cTKg AZT8TmXvBhPFJzAGQwfs4oJLATFdTyYnmoC2TwpN4ULdIYiRdvKKwCuqAw8ys0so51U4 wWPA== X-Gm-Message-State: AJaThX5DqsJ/Yu2YojH/8p6r0Seyu2ipt8EHtpxk2zxmaQIQjmEYx+Sw CErLmYbhIGGvWlKfMZNC9EvfgJTg89g= X-Google-Smtp-Source: AGs4zMaOeig/3yOSWtLoA5KfPuSwxeemkd+bBu9P+7UOcz5KbaAmbdhuo62awjFsqTNlEJqppF1T2Q== X-Received: by 10.28.132.66 with SMTP id g63mr4354495wmd.22.1510934988198; Fri, 17 Nov 2017 08:09:48 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:12 +0000 Message-Id: <20171117160913.17292-15-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 14/15] ArmVirtPkg/ArmVirtMemoryInitPeiLib: move to ArmVirtMemInfoLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Move to the new ArmVirtMemInfoLib library to retrieve DRAM information from the platform, so that we can phase out ArmPlatformLib going forward. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtQemu.dsc | 7= ++++++- ArmVirtPkg/ArmVirtQemu.fdf | 1= + ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c | 4= ++-- ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.inf | 3= ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index d14a0dd0d1d9..5c59f05187fa 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -48,7 +48,8 @@ [LibraryClasses.common] QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf =20 - ArmPlatformLib|ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.= inf + ArmPlatformLib|ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibN= ull.inf + ArmVirtMemInfoLib|ArmVirtPkg/Library/PeiVirtMemInfoLib/PeiVirtMemInfoLib= .inf =20 TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf NorFlashPlatformLib|ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.i= nf @@ -233,6 +234,10 @@ [Components.common] NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompre= ssLib.inf } + ArmVirtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.inf { + + ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemI= nfoLib.inf + } =20 # # DXE diff --git a/ArmVirtPkg/ArmVirtQemu.fdf b/ArmVirtPkg/ArmVirtQemu.fdf index c6a22dc018f3..696dec264639 100644 --- a/ArmVirtPkg/ArmVirtQemu.fdf +++ b/ArmVirtPkg/ArmVirtQemu.fdf @@ -109,6 +109,7 @@ [FV.FVMAIN_COMPACT] INF ArmPkg/Drivers/CpuPei/CpuPei.inf INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf + INF ArmVirtPkg/QemuVirtMemInfoPeim/QemuVirtMemInfoPeim.inf INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 FILE FV_IMAGE =3D 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { diff --git a/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPe= iLib.c b/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib= .c index 6f3e54b7afcb..05afd1282422 100644 --- a/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c +++ b/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c @@ -16,7 +16,7 @@ #include =20 #include -#include +#include #include #include #include @@ -39,7 +39,7 @@ InitMmu ( RETURN_STATUS Status; =20 // Get Virtual Memory Map from the Platform Library - ArmPlatformGetVirtualMemoryMap (&MemoryTable); + ArmVirtGetMemoryMap (&MemoryTable); =20 //Note: Because we called PeiServicesInstallPeiMemory() before to call I= nitMmu() the MMU Page Table resides in // DRAM (even at the top of DRAM as it is the first permanent memor= y allocation) diff --git a/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPe= iLib.inf b/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiL= ib.inf index 028d6fb5ac28..54879d590a8a 100644 --- a/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.inf +++ b/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.inf @@ -29,13 +29,14 @@ [Packages] EmbeddedPkg/EmbeddedPkg.dec ArmPkg/ArmPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec + ArmVirtPkg/ArmVirtPkg.dec =20 [LibraryClasses] DebugLib HobLib ArmLib ArmMmuLib - ArmPlatformLib + ArmVirtMemInfoLib CacheMaintenanceLib =20 [Guids] --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu May 2 02:01:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510935022273843.8985130901029; Fri, 17 Nov 2017 08:10:22 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3B8952035BB38; Fri, 17 Nov 2017 08:05:44 -0800 (PST) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 79CA92035BB1B for ; Fri, 17 Nov 2017 08:05:42 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id b189so7338923wmd.5 for ; Fri, 17 Nov 2017 08:09:53 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:49 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dTLeBM1XHPyo5Em7d9tjbwDoi60GczgvZfxMHfRGbVo=; b=O7F4S/dXNJQslmdFPdibBAU+EYzupdiVO/qcbclB8Dke1zHG9PSQVlhqQenT5RNy4q KgIKA16w0KqSh3AQFwYsgsxZR/HRgmpdIPuSorg40m5b4fw+iDTnfrVUA4b4z2JVTGDZ VqJt1LZlwLRS2t5NVKZ+Emtl2eLuSziGreUXA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dTLeBM1XHPyo5Em7d9tjbwDoi60GczgvZfxMHfRGbVo=; b=OqgCVWspT9MCAPOD9T9AvN3U0sAQ1xdHlfZM4BrGAUW2dyW4GfrSkuE613xwJ+TlVk +3ViyYWvkxxyrm/ESz5vSzOdfhetvBcqqeldeRRTypZQw9ECOv4knV11e5I7GvJEg/2w cg1EISI5Whb28RRgxy9G5SigaA0mB+gL1eS0S7IRodhT2RAPyjhDVDOmsLT/T6USS2c2 A+xpuBC3tZ3/86c5+ZzoI/msGBpTdFUJUWtbBSBTtmZtY5O4vvUkirq36KiLAf6+WqcE v33LOqL4BYbYdGYm2Kzs9bn+mYfdByc9SqqUECFXz81GRh0y4rvlbGaYfAfb+mwz2dRv AIUg== X-Gm-Message-State: AJaThX4LDOi+L2TNRgJmDHeBUwxvEhKIMedblQ89ZMBlA3aMe0E8oqUn GEoRwTd8twNE9U4r25xaiQArJyWDjPI= X-Google-Smtp-Source: AGs4zMaOQg7CRkQZU9pt60Gw9wAEtwU4xLE2zB/ZtgoLB/M6jRzmdeyqFOh3cwHVSL5T2YrmTpujeg== X-Received: by 10.28.43.5 with SMTP id r5mr4454342wmr.72.1510934990533; Fri, 17 Nov 2017 08:09:50 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:13 +0000 Message-Id: <20171117160913.17292-16-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 15/15] ArmVirtPkg: remove ArmPlatformLib implementations X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" These libraries are no longer used, so remove them from the tree. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- ArmVirtPkg/ArmVirtQemuKernel.dsc = | 1 - ArmVirtPkg/ArmVirtXen.dsc = | 1 - ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHe= lper.S | 141 ----------------- ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper= .S | 123 --------------- ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ArmQemuRelocatablePlatfor= mLib.inf | 64 -------- ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/FdtParser.c = | 90 ----------- ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/QemuVirtMem.c = | 106 ------------- ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVirt.c = | 70 --------- ArmVirtPkg/Library/ArmVirtPlatformLib/AARCH64/VirtHelper.S = | 70 --------- ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.S = | 57 ------- ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.asm = | 71 --------- ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf = | 64 -------- ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c = | 160 -------------------- ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c = | 102 ------------- ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHel= per.S | 140 ----------------- ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.= S | 123 --------------- ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ArmXenRelocatablePlatformL= ib.inf | 63 -------- ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c = | 89 ----------- ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVirt.c = | 70 --------- ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c = | 82 ---------- 20 files changed, 1687 deletions(-) diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKerne= l.dsc index f50d30388cf2..cc2c5a50c925 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -48,7 +48,6 @@ [LibraryClasses.common] QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf =20 - ArmPlatformLib|ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ArmQemuR= elocatablePlatformLib.inf ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoL= ib.inf =20 TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index 3df684d13cb0..11e073287a84 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -43,7 +43,6 @@ [LibraryClasses] VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice= Lib.inf =20 - ArmPlatformLib|ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ArmXenRel= ocatablePlatformLib.inf ArmVirtMemInfoLib|ArmVirtPkg/Library/XenVirtMemInfoLib/XenVirtMemInfoLib= .inf =20 TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/Reloc= atableVirtHelper.S b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH= 64/RelocatableVirtHelper.S deleted file mode 100644 index ec6955cf0af8..000000000000 --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableV= irtHelper.S +++ /dev/null @@ -1,141 +0,0 @@ -# -# Copyright (c) 2011-2013, ARM Limited. All rights reserved. -# Copyright (c) 2016, Linaro Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may = be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -# -# - -#include -#include - -// VOID -// ArmPlatformPeiBootAction ( -// VOID *DeviceTreeBaseAddress, // passed by loader in x0 -// VOID *ImageBase // passed by FDF trampoline in x1 -// ); -ASM_FUNC(ArmPlatformPeiBootAction) - // - // If we are booting from RAM using the Linux kernel boot protocol, x0 w= ill - // point to the DTB image in memory. Otherwise, use the default value de= fined - // by the platform. - // - cbnz x0, 0f - ldr x0, PcdGet64 (PcdDeviceTreeInitialBaseAddress) - -0:mov x29, x30 // preserve LR - mov x28, x0 // preserve DTB pointer - mov x27, x1 // preserve base of image pointer - - // - // The base of the runtime image has been preserved in x1. Check whether - // the expected magic number can be found in the header. - // - ldr w8, .LArm64LinuxMagic - ldr w9, [x1, #0x38] - cmp w8, w9 - bne .Lout - - // - // - // OK, so far so good. We have confirmed that we likely have a DTB and a= re - // booting via the arm64 Linux boot protocol. Update the base-of-image P= CD - // to the actual relocated value, and add the shift of PcdFdBaseAddress = to - // PcdFvBaseAddress as well - // - adr x8, PcdGet64 (PcdFdBaseAddress) - adr x9, PcdGet64 (PcdFvBaseAddress) - ldr x6, [x8] - ldr x7, [x9] - sub x7, x7, x6 - add x7, x7, x1 - str x1, [x8] - str x7, [x9] - - // - // Discover the memory size and offset from the DTB, and record in the - // respective PCDs. This will also return false if a corrupt DTB is - // encountered. Since we are calling a C function, use the window at the - // beginning of the FD image as a temp stack. - // - adr x1, PcdGet64 (PcdSystemMemoryBase) - adr x2, PcdGet64 (PcdSystemMemorySize) - mov sp, x7 - bl FindMemnode - cbz x0, .Lout - - // - // Copy the DTB to the slack space right after the 64 byte arm64/Linux s= tyle - // image header at the base of this image (defined in the FDF), and reco= rd the - // pointer in PcdDeviceTreeInitialBaseAddress. - // - adr x8, PcdGet64 (PcdDeviceTreeInitialBaseAddress) - add x27, x27, #0x40 - str x27, [x8] - - mov x0, x27 - mov x1, x28 - bl CopyFdt - -.Lout: - ret x29 - -.LArm64LinuxMagic: - .byte 0x41, 0x52, 0x4d, 0x64 - -//UINTN -//ArmPlatformGetPrimaryCoreMpId ( -// VOID -// ); -ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) - MOV32 (w0, FixedPcdGet32 (PcdArmPrimaryCore)) - ret - -//UINTN -//ArmPlatformIsPrimaryCore ( -// IN UINTN MpId -// ); -ASM_FUNC(ArmPlatformIsPrimaryCore) - mov x0, #1 - ret - -//UINTN -//ArmPlatformGetCorePosition ( -// IN UINTN MpId -// ); -// With this function: CorePos =3D (ClusterId * 4) + CoreId -ASM_FUNC(ArmPlatformGetCorePosition) - and x1, x0, #ARM_CORE_MASK - and x0, x0, #ARM_CLUSTER_MASK - add x0, x1, x0, LSR #6 - ret - -//EFI_PHYSICAL_ADDRESS -//GetPhysAddrTop ( -// VOID -// ); -ASM_FUNC(ArmGetPhysAddrTop) - mrs x0, id_aa64mmfr0_el1 - adr x1, .LPARanges - and x0, x0, #7 - ldrb w1, [x1, x0] - mov x0, #1 - lsl x0, x0, x1 - ret - -// -// Bits 0..2 of the AA64MFR0_EL1 system register encode the size of the -// physical address space support on this CPU: -// 0 =3D=3D 32 bits, 1 =3D=3D 36 bits, etc etc -// 6 and 7 are reserved -// -.LPARanges: - .byte 32, 36, 40, 42, 44, 48, -1, -1 - -ASM_FUNCTION_REMOVE_IF_UNREFERENCED diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/Relocatab= leVirtHelper.S b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/Reloc= atableVirtHelper.S deleted file mode 100644 index 27af98970c16..000000000000 --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtH= elper.S +++ /dev/null @@ -1,123 +0,0 @@ -# -# Copyright (c) 2011-2013, ARM Limited. All rights reserved. -# Copyright (c) 2014-2016, Linaro Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may = be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -# -# - -#include -#include - -ASM_FUNC(ArmPlatformPeiBootAction) - // - // If we are booting from RAM using the Linux kernel boot protocol, r0 w= ill - // point to the DTB image in memory. Otherwise, use the default value de= fined - // by the platform. - // - teq r0, #0 - bne 0f - LDRL (r0, PcdGet64 (PcdDeviceTreeInitialBaseAddress)) - -0:mov r11, r14 // preserve LR - mov r10, r0 // preserve DTB pointer - mov r9, r1 // preserve base of image pointer - - // - // The base of the runtime image has been preserved in r1. Check whether - // the expected magic number can be found in the header. - // - ldr r8, .LArm32LinuxMagic - ldr r7, [r1, #0x24] - cmp r7, r8 - bne .Lout - - // - // - // OK, so far so good. We have confirmed that we likely have a DTB and a= re - // booting via the ARM Linux boot protocol. Update the base-of-image PCD - // to the actual relocated value, and add the shift of PcdFdBaseAddress = to - // PcdFvBaseAddress as well - // - ADRL (r8, PcdGet64 (PcdFdBaseAddress)) - ADRL (r7, PcdGet64 (PcdFvBaseAddress)) - ldr r6, [r8] - ldr r5, [r7] - sub r5, r5, r6 - add r5, r5, r1 - str r1, [r8] - str r5, [r7] - - // - // Discover the memory size and offset from the DTB, and record in the - // respective PCDs. This will also return false if a corrupt DTB is - // encountered. Since we are calling a C function, use the window at the - // beginning of the FD image as a temp stack. - // - ADRL (r1, PcdGet64 (PcdSystemMemoryBase)) - ADRL (r2, PcdGet64 (PcdSystemMemorySize)) - mov sp, r5 - bl FindMemnode - teq r0, #0 - beq .Lout - - // - // Copy the DTB to the slack space right after the 64 byte arm64/Linux s= tyle - // image header at the base of this image (defined in the FDF), and reco= rd the - // pointer in PcdDeviceTreeInitialBaseAddress. - // - ADRL (r8, PcdGet64 (PcdDeviceTreeInitialBaseAddress)) - add r9, r9, #0x40 - str r9, [r8] - - mov r0, r9 - mov r1, r10 - bl CopyFdt - -.Lout: - bx r11 - -.LArm32LinuxMagic: - .byte 0x18, 0x28, 0x6f, 0x01 - -//UINTN -//ArmPlatformGetPrimaryCoreMpId ( -// VOID -// ); -ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) - MOV32 (r0, FixedPcdGet32 (PcdArmPrimaryCore)) - bx lr - -//UINTN -//ArmPlatformIsPrimaryCore ( -// IN UINTN MpId -// ); -ASM_FUNC(ArmPlatformIsPrimaryCore) - mov r0, #1 - bx lr - -//UINTN -//ArmPlatformGetCorePosition ( -// IN UINTN MpId -// ); -// With this function: CorePos =3D (ClusterId * 4) + CoreId -ASM_FUNC(ArmPlatformGetCorePosition) - and r1, r0, #ARM_CORE_MASK - and r0, r0, #ARM_CLUSTER_MASK - add r0, r1, r0, LSR #6 - bx lr - -//EFI_PHYSICAL_ADDRESS -//GetPhysAddrTop ( -// VOID -// ); -ASM_FUNC(ArmGetPhysAddrTop) - mov r0, #0x00000000 - mov r1, #0x10000 - bx lr diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ArmQemuReloca= tablePlatformLib.inf b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/Arm= QemuRelocatablePlatformLib.inf deleted file mode 100644 index acd523bbd2ce..000000000000 --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ArmQemuRelocatablePl= atformLib.inf +++ /dev/null @@ -1,64 +0,0 @@ -#/* @file -# Copyright (c) 2011-2015, ARM Limited. All rights reserved. -# Copyright (c) 2014, Linaro Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may = be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -# -#*/ - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D ArmXenRelocatablePlatformLib - FILE_GUID =3D c8602718-4faa-4119-90ca-cae72509ac4c - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D ArmPlatformLib|SEC PEIM - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - EmbeddedPkg/EmbeddedPkg.dec - ArmPkg/ArmPkg.dec - ArmPlatformPkg/ArmPlatformPkg.dec - ArmVirtPkg/ArmVirtPkg.dec - -[LibraryClasses] - IoLib - ArmLib - PrintLib - FdtLib - -[Sources.common] - RelocatableVirt.c - QemuVirtMem.c - FdtParser.c - -[Sources.AARCH64] - AARCH64/RelocatableVirtHelper.S - -[Sources.ARM] - ARM/RelocatableVirtHelper.S - -[FeaturePcd] - gEmbeddedTokenSpaceGuid.PcdCacheEnable - gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec - -[PatchPcd] - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress - gArmTokenSpaceGuid.PcdFdBaseAddress - gArmTokenSpaceGuid.PcdFvBaseAddress - gArmTokenSpaceGuid.PcdSystemMemoryBase - gArmTokenSpaceGuid.PcdSystemMemorySize - -[FixedPcd] - gArmPlatformTokenSpaceGuid.PcdCoreCount - gArmTokenSpaceGuid.PcdArmPrimaryCoreMask - gArmTokenSpaceGuid.PcdArmPrimaryCore - gArmTokenSpaceGuid.PcdFdSize - gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/FdtParser.c b= /ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/FdtParser.c deleted file mode 100644 index afdc81a8839d..000000000000 --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/FdtParser.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2015, Linaro Ltd. All rights reserved. - * - * This program and the accompanying materials - * are licensed and made available under the terms and conditions of the B= SD License - * which accompanies this distribution. The full text of the license may = be found at - * http://opensource.org/licenses/bsd-license.php - * - * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. - */ - -#include -#include - -BOOLEAN -FindMemnode ( - IN VOID *DeviceTreeBlob, - OUT UINT64 *SystemMemoryBase, - OUT UINT64 *SystemMemorySize - ) -{ - INT32 MemoryNode; - INT32 AddressCells; - INT32 SizeCells; - INT32 Length; - CONST INT32 *Prop; - - if (fdt_check_header (DeviceTreeBlob) !=3D 0) { - return FALSE; - } - - // - // Look for a node called "memory" at the lowest level of the tree - // - MemoryNode =3D fdt_path_offset (DeviceTreeBlob, "/memory"); - if (MemoryNode <=3D 0) { - return FALSE; - } - - // - // Retrieve the #address-cells and #size-cells properties - // from the root node, or use the default if not provided. - // - AddressCells =3D 1; - SizeCells =3D 1; - - Prop =3D fdt_getprop (DeviceTreeBlob, 0, "#address-cells", &Length); - if (Length =3D=3D 4) { - AddressCells =3D fdt32_to_cpu (*Prop); - } - - Prop =3D fdt_getprop (DeviceTreeBlob, 0, "#size-cells", &Length); - if (Length =3D=3D 4) { - SizeCells =3D fdt32_to_cpu (*Prop); - } - - // - // Now find the 'reg' property of the /memory node, and read the first - // range listed. - // - Prop =3D fdt_getprop (DeviceTreeBlob, MemoryNode, "reg", &Length); - - if (Length < (AddressCells + SizeCells) * sizeof (INT32)) { - return FALSE; - } - - *SystemMemoryBase =3D fdt32_to_cpu (Prop[0]); - if (AddressCells > 1) { - *SystemMemoryBase =3D (*SystemMemoryBase << 32) | fdt32_to_cpu (Prop[1= ]); - } - Prop +=3D AddressCells; - - *SystemMemorySize =3D fdt32_to_cpu (Prop[0]); - if (SizeCells > 1) { - *SystemMemorySize =3D (*SystemMemorySize << 32) | fdt32_to_cpu (Prop[1= ]); - } - - return TRUE; -} - -VOID -CopyFdt ( - IN VOID *FdtDest, - IN VOID *FdtSource - ) -{ - fdt_pack(FdtSource); - CopyMem (FdtDest, FdtSource, fdt_totalsize (FdtSource)); -} diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/QemuVirtMem.c= b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/QemuVirtMem.c deleted file mode 100644 index 2ce5c48d52cf..000000000000 --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/QemuVirtMem.c +++ /dev/null @@ -1,106 +0,0 @@ -/** @file -* -* Copyright (c) 2014, Linaro Limited. All rights reserved. -* -* This program and the accompanying materials -* are licensed and made available under the terms and conditions of the B= SD License -* which accompanies this distribution. The full text of the license may = be found at -* http://opensource.org/licenses/bsd-license.php -* -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -* -**/ - -#include -#include -#include -#include -#include -#include - -// Number of Virtual Memory Map Descriptors -#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5 - -// DDR attributes -#define DDR_ATTRIBUTES_CACHED ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK -#define DDR_ATTRIBUTES_UNCACHED ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBU= FFERED - -EFI_PHYSICAL_ADDRESS -ArmGetPhysAddrTop ( - VOID - ); - -/** - Return the Virtual Memory Map of your platform - - This Virtual Memory Map is used by MemoryInitPei Module to initialize th= e MMU - on your platform. - - @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR - describing a Physical-to-Virtual Memory - mapping. This array must be ended by a - zero-filled entry - -**/ -VOID -ArmPlatformGetVirtualMemoryMap ( - IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap - ) -{ - ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; - - ASSERT (VirtualMemoryMap !=3D NULL); - - VirtualMemoryTable =3D AllocatePages ( - EFI_SIZE_TO_PAGES ( - sizeof (ARM_MEMORY_REGION_DESCRIPTOR) - * MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS - ) - ); - - if (VirtualMemoryTable =3D=3D NULL) { - DEBUG ((EFI_D_ERROR, "%a: Error: Failed AllocatePages()\n", __FUNCTION= __)); - return; - } - - // System DRAM - VirtualMemoryTable[0].PhysicalBase =3D PcdGet64 (PcdSystemMemoryBase); - VirtualMemoryTable[0].VirtualBase =3D VirtualMemoryTable[0].PhysicalBas= e; - VirtualMemoryTable[0].Length =3D PcdGet64 (PcdSystemMemorySize); - VirtualMemoryTable[0].Attributes =3D DDR_ATTRIBUTES_CACHED; - - DEBUG ((EFI_D_INFO, "%a: Dumping System DRAM Memory Map:\n" - "\tPhysicalBase: 0x%lX\n" - "\tVirtualBase: 0x%lX\n" - "\tLength: 0x%lX\n", - __FUNCTION__, - VirtualMemoryTable[0].PhysicalBase, - VirtualMemoryTable[0].VirtualBase, - VirtualMemoryTable[0].Length)); - - // Peripheral space before DRAM - VirtualMemoryTable[1].PhysicalBase =3D 0x0; - VirtualMemoryTable[1].VirtualBase =3D 0x0; - VirtualMemoryTable[1].Length =3D VirtualMemoryTable[0].PhysicalBas= e; - VirtualMemoryTable[1].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_DEVIC= E; - - // Peripheral space after DRAM - VirtualMemoryTable[2].PhysicalBase =3D VirtualMemoryTable[0].Length + Vi= rtualMemoryTable[1].Length; - VirtualMemoryTable[2].VirtualBase =3D VirtualMemoryTable[2].PhysicalBas= e; - VirtualMemoryTable[2].Length =3D MIN (1ULL << FixedPcdGet8 (PcdPre= PiCpuMemorySize), - ArmGetPhysAddrTop ()) - - VirtualMemoryTable[2].PhysicalBase; - VirtualMemoryTable[2].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_DEVIC= E; - - // Remap the FD region as normal executable memory - VirtualMemoryTable[3].PhysicalBase =3D PcdGet64 (PcdFdBaseAddress); - VirtualMemoryTable[3].VirtualBase =3D VirtualMemoryTable[3].PhysicalBas= e; - VirtualMemoryTable[3].Length =3D FixedPcdGet32 (PcdFdSize); - VirtualMemoryTable[3].Attributes =3D DDR_ATTRIBUTES_CACHED; - - // End of Table - ZeroMem (&VirtualMemoryTable[4], sizeof (ARM_MEMORY_REGION_DESCRIPTOR)); - - *VirtualMemoryMap =3D VirtualMemoryTable; -} diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVi= rt.c b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVirt.c deleted file mode 100644 index 6df207733ab2..000000000000 --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVirt.c +++ /dev/null @@ -1,70 +0,0 @@ -/** @file -* -* Copyright (c) 2011-2013, ARM Limited. All rights reserved. -* Copyright (c) 2014, Linaro Limited. All rights reserved. -* Copyright (c) 2014, Red Hat, Inc. -* -* -* This program and the accompanying materials -* are licensed and made available under the terms and conditions of the B= SD License -* which accompanies this distribution. The full text of the license may = be found at -* http://opensource.org/licenses/bsd-license.php -* -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -* -**/ - -#include -#include -#include -#include - -/** - Return the current Boot Mode - - This function returns the boot reason on the platform - - @return Return the current Boot Mode of the platform - -**/ -EFI_BOOT_MODE -ArmPlatformGetBootMode ( - VOID - ) -{ - return BOOT_WITH_FULL_CONFIGURATION; -} - -/** - This function is called by PrePeiCore, in the SEC phase. -**/ -RETURN_STATUS -ArmPlatformInitialize ( - IN UINTN MpId - ) -{ - // - // We are relying on ArmPlatformInitializeSystemMemory () being called f= rom - // InitializeMemory (), which only occurs if the following feature is di= sabled - // - ASSERT (!FeaturePcdGet (PcdSystemMemoryInitializeInSec)); - return RETURN_SUCCESS; -} - -VOID -ArmPlatformInitializeSystemMemory ( - VOID - ) -{ -} - -VOID -ArmPlatformGetPlatformPpiList ( - OUT UINTN *PpiListSize, - OUT EFI_PEI_PPI_DESCRIPTOR **PpiList - ) -{ - *PpiListSize =3D 0; - *PpiList =3D NULL; -} diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/AARCH64/VirtHelper.S b/A= rmVirtPkg/Library/ArmVirtPlatformLib/AARCH64/VirtHelper.S deleted file mode 100644 index 1d8fe25928d8..000000000000 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/AARCH64/VirtHelper.S +++ /dev/null @@ -1,70 +0,0 @@ -# -# Copyright (c) 2011-2013, ARM Limited. All rights reserved. -# Copyright (c) 2016, Linaro Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may = be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -# -# - -#include -#include - -ASM_FUNC(ArmPlatformPeiBootAction) - ret - -//UINTN -//ArmPlatformGetPrimaryCoreMpId ( -// VOID -// ); -ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) - MOV32 (w0, FixedPcdGet32 (PcdArmPrimaryCore)) - ret - -//UINTN -//ArmPlatformIsPrimaryCore ( -// IN UINTN MpId -// ); -ASM_FUNC(ArmPlatformIsPrimaryCore) - mov x0, #1 - ret - -//UINTN -//ArmPlatformGetCorePosition ( -// IN UINTN MpId -// ); -// With this function: CorePos =3D (ClusterId * 4) + CoreId -ASM_FUNC(ArmPlatformGetCorePosition) - and x1, x0, #ARM_CORE_MASK - and x0, x0, #ARM_CLUSTER_MASK - add x0, x1, x0, LSR #6 - ret - -//EFI_PHYSICAL_ADDRESS -//GetPhysAddrTop ( -// VOID -// ); -ASM_FUNC(ArmGetPhysAddrTop) - mrs x0, id_aa64mmfr0_el1 - adr x1, .LPARanges - and x0, x0, #7 - ldrb w1, [x1, x0] - mov x0, #1 - lsl x0, x0, x1 - ret - -// -// Bits 0..2 of the AA64MFR0_EL1 system register encode the size of the -// physical address space support on this CPU: -// 0 =3D=3D 32 bits, 1 =3D=3D 36 bits, etc etc -// 6 and 7 are reserved -// -.LPARanges: - .byte 32, 36, 40, 42, 44, 48, -1, -1 - -ASM_FUNCTION_REMOVE_IF_UNREFERENCED diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.S b/ArmVi= rtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.S deleted file mode 100644 index 4a4db3721072..000000000000 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.S +++ /dev/null @@ -1,57 +0,0 @@ -# -# Copyright (c) 2011-2013, ARM Limited. All rights reserved. -# Copyright (c) 2014-2016, Linaro Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may = be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -# -# - -#include -#include - -ASM_FUNC(ArmPlatformPeiBootAction) - bx lr - -//UINTN -//ArmPlatformGetPrimaryCoreMpId ( -// VOID -// ); -ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) - MOV32 (r0, FixedPcdGet32 (PcdArmPrimaryCore)) - bx lr - -//UINTN -//ArmPlatformIsPrimaryCore ( -// IN UINTN MpId -// ); -ASM_FUNC(ArmPlatformIsPrimaryCore) - mov r0, #1 - bx lr - -//UINTN -//ArmPlatformGetCorePosition ( -// IN UINTN MpId -// ); -// With this function: CorePos =3D (ClusterId * 4) + CoreId -ASM_FUNC(ArmPlatformGetCorePosition) - and r1, r0, #ARM_CORE_MASK - and r0, r0, #ARM_CLUSTER_MASK - add r0, r1, r0, LSR #6 - bx lr - -//EFI_PHYSICAL_ADDRESS -//GetPhysAddrTop ( -// VOID -// ); -ASM_FUNC(ArmGetPhysAddrTop) - mov r0, #0x00000000 - mov r1, #0x10000 - bx lr - -ASM_FUNCTION_REMOVE_IF_UNREFERENCED diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.asm b/Arm= VirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.asm deleted file mode 100644 index b476516f2115..000000000000 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/ARM/VirtHelper.asm +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) 2011-2014, ARM Limited. All rights reserved. -// Copyright (c) 2014, Linaro Limited. All rights reserved. -// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the = BSD License -// which accompanies this distribution. The full text of the license may= be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -// - -#include -#include - - INCLUDE AsmMacroIoLib.inc - - EXPORT ArmPlatformPeiBootAction - EXPORT ArmPlatformIsPrimaryCore - EXPORT ArmPlatformGetPrimaryCoreMpId - EXPORT ArmPlatformGetCorePosition - EXPORT ArmGetPhysAddrTop - - AREA VirtHelper, CODE, READONLY - -ArmPlatformPeiBootAction FUNCTION - bx lr - ENDFUNC - -//UINTN -//ArmPlatformGetPrimaryCoreMpId ( -// VOID -// ); -ArmPlatformGetPrimaryCoreMpId FUNCTION - MOV32 r0, FixedPcdGet32 (PcdArmPrimaryCore) - bx lr - ENDFUNC - -//UINTN -//ArmPlatformIsPrimaryCore ( -// IN UINTN MpId -// ); -ArmPlatformIsPrimaryCore FUNCTION - mov r0, #1 - bx lr - ENDFUNC - -//UINTN -//ArmPlatformGetCorePosition ( -// IN UINTN MpId -// ); -// With this function: CorePos =3D (ClusterId * 4) + CoreId -ArmPlatformGetCorePosition FUNCTION - and r1, r0, #ARM_CORE_MASK - and r0, r0, #ARM_CLUSTER_MASK - add r0, r1, r0, LSR #6 - bx lr - ENDFUNC - -//EFI_PHYSICAL_ADDRESS -//GetPhysAddrTop ( -// VOID -// ); -ArmGetPhysAddrTop FUNCTION - mov r0, #0x00000000 - mov r1, #0x10000 - bx lr - ENDFUNC - - END diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf b= /ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf deleted file mode 100644 index 3cb3fb1f3aea..000000000000 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf +++ /dev/null @@ -1,64 +0,0 @@ -#/* @file -# Copyright (c) 2011-2014, ARM Limited. All rights reserved. -# Copyright (c) 2014, Linaro Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may = be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -# -#*/ - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D ArmVirtPlatformLib - FILE_GUID =3D 00214cc1-06d1-45fe-9700-dca5726ad7bf - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D ArmPlatformLib|SEC PEIM - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - EmbeddedPkg/EmbeddedPkg.dec - ArmPkg/ArmPkg.dec - ArmPlatformPkg/ArmPlatformPkg.dec - ArmVirtPkg/ArmVirtPkg.dec - -[LibraryClasses] - IoLib - MemoryAllocationLib - ArmLib - PrintLib - FdtLib - -[Sources.common] - Virt.c - VirtMem.c - -[Sources.AARCH64] - AARCH64/VirtHelper.S - -[Sources.ARM] - ARM/VirtHelper.S | GCC - ARM/VirtHelper.asm | RVCT - -[FeaturePcd] - gEmbeddedTokenSpaceGuid.PcdCacheEnable - gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec - -[Pcd] - gArmTokenSpaceGuid.PcdSystemMemorySize - -[FixedPcd] - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress - gArmPlatformTokenSpaceGuid.PcdCoreCount - gArmTokenSpaceGuid.PcdSystemMemoryBase - gArmTokenSpaceGuid.PcdArmPrimaryCoreMask - gArmTokenSpaceGuid.PcdArmPrimaryCore - gArmTokenSpaceGuid.PcdFdBaseAddress - gArmTokenSpaceGuid.PcdFdSize - gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c b/ArmVirtPkg/Libr= ary/ArmVirtPlatformLib/Virt.c deleted file mode 100644 index 140bdde8b2ac..000000000000 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c +++ /dev/null @@ -1,160 +0,0 @@ -/** @file -* -* Copyright (c) 2011-2013, ARM Limited. All rights reserved. -* Copyright (c) 2014, Linaro Limited. All rights reserved. -* Copyright (c) 2014, Red Hat, Inc. -* -* -* This program and the accompanying materials -* are licensed and made available under the terms and conditions of the B= SD License -* which accompanies this distribution. The full text of the license may = be found at -* http://opensource.org/licenses/bsd-license.php -* -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -* -**/ - -#include -#include -#include -#include -#include -#include -#include -#include - -/** - Return the current Boot Mode - - This function returns the boot reason on the platform - - @return Return the current Boot Mode of the platform - -**/ -EFI_BOOT_MODE -ArmPlatformGetBootMode ( - VOID - ) -{ - return BOOT_WITH_FULL_CONFIGURATION; -} - -/** - This function is called by PrePeiCore, in the SEC phase. -**/ -RETURN_STATUS -ArmPlatformInitialize ( - IN UINTN MpId - ) -{ - // - // We are relying on ArmPlatformInitializeSystemMemory () being called f= rom - // InitializeMemory (), which only occurs if the following feature is di= sabled - // - ASSERT (!FeaturePcdGet (PcdSystemMemoryInitializeInSec)); - return RETURN_SUCCESS; -} - -/** - Initialize the system (or sometimes called permanent) memory - - This memory is generally represented by the DRAM. - - This function is called from InitializeMemory() in MemoryInitPeim, in th= e PEI - phase. -**/ -VOID -ArmPlatformInitializeSystemMemory ( - VOID - ) -{ - VOID *DeviceTreeBase; - INT32 Node, Prev; - UINT64 NewBase, CurBase; - UINT64 NewSize, CurSize; - CONST CHAR8 *Type; - INT32 Len; - CONST UINT64 *RegProp; - RETURN_STATUS PcdStatus; - - NewBase =3D 0; - NewSize =3D 0; - - DeviceTreeBase =3D (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddr= ess); - ASSERT (DeviceTreeBase !=3D NULL); - - // - // Make sure we have a valid device tree blob - // - ASSERT (fdt_check_header (DeviceTreeBase) =3D=3D 0); - - // - // Look for the lowest memory node - // - for (Prev =3D 0;; Prev =3D Node) { - Node =3D fdt_next_node (DeviceTreeBase, Prev, NULL); - if (Node < 0) { - break; - } - - // - // Check for memory node - // - Type =3D fdt_getprop (DeviceTreeBase, Node, "device_type", &Len); - if (Type && AsciiStrnCmp (Type, "memory", Len) =3D=3D 0) { - // - // Get the 'reg' property of this node. For now, we will assume - // two 8 byte quantities for base and size, respectively. - // - RegProp =3D fdt_getprop (DeviceTreeBase, Node, "reg", &Len); - if (RegProp !=3D 0 && Len =3D=3D (2 * sizeof (UINT64))) { - - CurBase =3D fdt64_to_cpu (ReadUnaligned64 (RegProp)); - CurSize =3D fdt64_to_cpu (ReadUnaligned64 (RegProp + 1)); - - DEBUG ((EFI_D_INFO, "%a: System RAM @ 0x%lx - 0x%lx\n", - __FUNCTION__, CurBase, CurBase + CurSize - 1)); - - if (NewBase > CurBase || NewBase =3D=3D 0) { - NewBase =3D CurBase; - NewSize =3D CurSize; - } - } else { - DEBUG ((EFI_D_ERROR, "%a: Failed to parse FDT memory node\n", - __FUNCTION__)); - } - } - } - - // - // Make sure the start of DRAM matches our expectation - // - ASSERT (FixedPcdGet64 (PcdSystemMemoryBase) =3D=3D NewBase); - PcdStatus =3D PcdSet64S (PcdSystemMemorySize, NewSize); - ASSERT_RETURN_ERROR (PcdStatus); - - // - // We need to make sure that the machine we are running on has at least - // 128 MB of memory configured, and is currently executing this binary f= rom - // NOR flash. This prevents a device tree image in DRAM from getting - // clobbered when our caller installs permanent PEI RAM, before we have a - // chance of marking its location as reserved or copy it to a freshly - // allocated block in the permanent PEI RAM in the platform PEIM. - // - ASSERT (NewSize >=3D SIZE_128MB); - ASSERT ( - (((UINT64)PcdGet64 (PcdFdBaseAddress) + - (UINT64)PcdGet32 (PcdFdSize)) <=3D NewBase) || - ((UINT64)PcdGet64 (PcdFdBaseAddress) >=3D (NewBase + NewSize))); -} - -VOID -ArmPlatformGetPlatformPpiList ( - OUT UINTN *PpiListSize, - OUT EFI_PEI_PPI_DESCRIPTOR **PpiList - ) -{ - *PpiListSize =3D 0; - *PpiList =3D NULL; -} diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c b/ArmVirtPkg/L= ibrary/ArmVirtPlatformLib/VirtMem.c deleted file mode 100644 index 4368d05f76ef..000000000000 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c +++ /dev/null @@ -1,102 +0,0 @@ -/** @file -* -* Copyright (c) 2014, Linaro Limited. All rights reserved. -* -* This program and the accompanying materials -* are licensed and made available under the terms and conditions of the B= SD License -* which accompanies this distribution. The full text of the license may = be found at -* http://opensource.org/licenses/bsd-license.php -* -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -* -**/ - -#include -#include -#include -#include -#include -#include - -// Number of Virtual Memory Map Descriptors -#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5 - -EFI_PHYSICAL_ADDRESS -ArmGetPhysAddrTop ( - VOID - ); - -/** - Return the Virtual Memory Map of your platform - - This Virtual Memory Map is used by MemoryInitPei Module to initialize th= e MMU - on your platform. - - @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR - describing a Physical-to-Virtual Memory - mapping. This array must be ended by a - zero-filled entry - -**/ -VOID -ArmPlatformGetVirtualMemoryMap ( - IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap - ) -{ - ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; - - ASSERT (VirtualMemoryMap !=3D NULL); - - VirtualMemoryTable =3D AllocatePages ( - EFI_SIZE_TO_PAGES ( - sizeof (ARM_MEMORY_REGION_DESCRIPTOR) - * MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS - ) - ); - - if (VirtualMemoryTable =3D=3D NULL) { - DEBUG ((EFI_D_ERROR, "%a: Error: Failed AllocatePages()\n", __FUNCTION= __)); - return; - } - - // System DRAM - VirtualMemoryTable[0].PhysicalBase =3D PcdGet64 (PcdSystemMemoryBase); - VirtualMemoryTable[0].VirtualBase =3D VirtualMemoryTable[0].PhysicalBas= e; - VirtualMemoryTable[0].Length =3D PcdGet64 (PcdSystemMemorySize); - VirtualMemoryTable[0].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_WRITE= _BACK; - - DEBUG ((EFI_D_INFO, "%a: Dumping System DRAM Memory Map:\n" - "\tPhysicalBase: 0x%lX\n" - "\tVirtualBase: 0x%lX\n" - "\tLength: 0x%lX\n", - __FUNCTION__, - VirtualMemoryTable[0].PhysicalBase, - VirtualMemoryTable[0].VirtualBase, - VirtualMemoryTable[0].Length)); - - // Peripheral space before DRAM - VirtualMemoryTable[1].PhysicalBase =3D 0x0; - VirtualMemoryTable[1].VirtualBase =3D 0x0; - VirtualMemoryTable[1].Length =3D VirtualMemoryTable[0].PhysicalBas= e; - VirtualMemoryTable[1].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_DEVIC= E; - - // Peripheral space after DRAM - VirtualMemoryTable[2].PhysicalBase =3D VirtualMemoryTable[0].Length + Vi= rtualMemoryTable[1].Length; - VirtualMemoryTable[2].VirtualBase =3D VirtualMemoryTable[2].PhysicalBas= e; - VirtualMemoryTable[2].Length =3D MIN (1ULL << FixedPcdGet8 (PcdPre= PiCpuMemorySize), - ArmGetPhysAddrTop ()) - - VirtualMemoryTable[2].PhysicalBase; - VirtualMemoryTable[2].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_DEVIC= E; - - // Remap the FD region as normal executable memory - VirtualMemoryTable[3].PhysicalBase =3D FixedPcdGet64 (PcdFdBaseAddress); - VirtualMemoryTable[3].VirtualBase =3D VirtualMemoryTable[3].PhysicalBas= e; - VirtualMemoryTable[3].Length =3D FixedPcdGet32 (PcdFdSize); - VirtualMemoryTable[3].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_WRITE= _BACK; - - // End of Table - ZeroMem (&VirtualMemoryTable[4], sizeof (ARM_MEMORY_REGION_DESCRIPTOR)); - - *VirtualMemoryMap =3D VirtualMemoryTable; -} diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/Reloca= tableVirtHelper.S b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64= /RelocatableVirtHelper.S deleted file mode 100644 index ce886378eae6..000000000000 --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVi= rtHelper.S +++ /dev/null @@ -1,140 +0,0 @@ -# -# Copyright (c) 2011-2013, ARM Limited. All rights reserved. -# Copyright (c) 2016, Linaro Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may = be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -# -# - -#include -#include - -// VOID -// ArmPlatformPeiBootAction ( -// VOID *DeviceTreeBaseAddress, // passed by loader in x0 -// VOID *ImageBase // passed by FDF trampoline in x1 -// ); -ASM_FUNC(ArmPlatformPeiBootAction) - mov x29, x30 // preserve LR - mov x28, x0 // preserve DTB pointer - mov x27, x1 // preserve base of image pointer - - // - // If we are booting from RAM using the Linux kernel boot protocol, x0 w= ill - // point to the DTB image in memory. Otherwise, we are just coming out of - // reset, and x0 will be 0. - // - cbz x0, .Lout - - // - // The base of the runtime image has been preserved in x1. Check whether - // the expected magic number can be found in the header. - // - ldr w8, .LArm64LinuxMagic - ldr w9, [x1, #0x38] - cmp w8, w9 - bne .Lout - - // - // - // OK, so far so good. We have confirmed that we likely have a DTB and a= re - // booting via the arm64 Linux boot protocol. Update the base-of-image P= CD - // to the actual relocated value, and add the shift of PcdFdBaseAddress = to - // PcdFvBaseAddress as well - // - adr x8, PcdGet64 (PcdFdBaseAddress) - adr x9, PcdGet64 (PcdFvBaseAddress) - ldr x6, [x8] - ldr x7, [x9] - sub x7, x7, x6 - add x7, x7, x1 - str x1, [x8] - str x7, [x9] - - // - // Discover the memory size and offset from the DTB, and record in the - // respective PCDs. This will also return false if a corrupt DTB is - // encountered. Since we are calling a C function, use the window at the - // beginning of the FD image as a temp stack. - // - adr x1, PcdGet64 (PcdSystemMemoryBase) - adr x2, PcdGet64 (PcdSystemMemorySize) - mov sp, x7 - bl FindMemnode - cbz x0, .Lout - - // - // Copy the DTB to the slack space right after the 64 byte arm64/Linux s= tyle - // image header at the base of this image (defined in the FDF), and reco= rd the - // pointer in PcdDeviceTreeInitialBaseAddress. - // - adr x8, PcdGet64 (PcdDeviceTreeInitialBaseAddress) - add x27, x27, #0x40 - str x27, [x8] - - mov x0, x27 - mov x1, x28 - bl CopyFdt - -.Lout: - ret x29 - -.LArm64LinuxMagic: - .byte 0x41, 0x52, 0x4d, 0x64 - -//UINTN -//ArmPlatformGetPrimaryCoreMpId ( -// VOID -// ); -ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) - MOV32 (w0, FixedPcdGet32 (PcdArmPrimaryCore)) - ret - -//UINTN -//ArmPlatformIsPrimaryCore ( -// IN UINTN MpId -// ); -ASM_FUNC(ArmPlatformIsPrimaryCore) - mov x0, #1 - ret - -//UINTN -//ArmPlatformGetCorePosition ( -// IN UINTN MpId -// ); -// With this function: CorePos =3D (ClusterId * 4) + CoreId -ASM_FUNC(ArmPlatformGetCorePosition) - and x1, x0, #ARM_CORE_MASK - and x0, x0, #ARM_CLUSTER_MASK - add x0, x1, x0, LSR #6 - ret - -//EFI_PHYSICAL_ADDRESS -//GetPhysAddrTop ( -// VOID -// ); -ASM_FUNC(ArmGetPhysAddrTop) - mrs x0, id_aa64mmfr0_el1 - adr x1, .LPARanges - and x0, x0, #7 - ldrb w1, [x1, x0] - mov x0, #1 - lsl x0, x0, x1 - ret - -// -// Bits 0..2 of the AA64MFR0_EL1 system register encode the size of the -// physical address space support on this CPU: -// 0 =3D=3D 32 bits, 1 =3D=3D 36 bits, etc etc -// 6 and 7 are reserved -// -.LPARanges: - .byte 32, 36, 40, 42, 44, 48, -1, -1 - -ASM_FUNCTION_REMOVE_IF_UNREFERENCED diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/Relocatabl= eVirtHelper.S b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/Relocat= ableVirtHelper.S deleted file mode 100644 index f264fa1cf731..000000000000 --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHe= lper.S +++ /dev/null @@ -1,123 +0,0 @@ -# -# Copyright (c) 2011-2013, ARM Limited. All rights reserved. -# Copyright (c) 2014-2016, Linaro Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may = be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -# -# - -#include -#include - -ASM_FUNC(ArmPlatformPeiBootAction) - mov r11, r14 // preserve LR - mov r10, r0 // preserve DTB pointer - mov r9, r1 // preserve base of image pointer - - // - // If we are booting from RAM using the Linux kernel boot protocol, r0 w= ill - // point to the DTB image in memory. Otherwise, we are just coming out of - // reset, and r0 will be 0. - // - teq r0, #0 - beq .Lout - - // - // The base of the runtime image has been preserved in r1. Check whether - // the expected magic number can be found in the header. - // - ldr r8, .LArm32LinuxMagic - ldr r7, [r1, #0x24] - cmp r7, r8 - bne .Lout - - // - // - // OK, so far so good. We have confirmed that we likely have a DTB and a= re - // booting via the ARM Linux boot protocol. Update the base-of-image PCD - // to the actual relocated value, and add the shift of PcdFdBaseAddress = to - // PcdFvBaseAddress as well - // - ADRL (r8, PcdGet64 (PcdFdBaseAddress)) - ADRL (r7, PcdGet64 (PcdFvBaseAddress)) - ldr r6, [r8] - ldr r5, [r7] - sub r5, r5, r6 - add r5, r5, r1 - str r1, [r8] - str r5, [r7] - - // - // Discover the memory size and offset from the DTB, and record in the - // respective PCDs. This will also return false if a corrupt DTB is - // encountered. Since we are calling a C function, use the window at the - // beginning of the FD image as a temp stack. - // - ADRL (r1, PcdGet64 (PcdSystemMemoryBase)) - ADRL (r2, PcdGet64 (PcdSystemMemorySize)) - mov sp, r5 - bl FindMemnode - teq r0, #0 - beq .Lout - - // - // Copy the DTB to the slack space right after the 64 byte arm64/Linux s= tyle - // image header at the base of this image (defined in the FDF), and reco= rd the - // pointer in PcdDeviceTreeInitialBaseAddress. - // - ADRL (r8, PcdGet64 (PcdDeviceTreeInitialBaseAddress)) - add r9, r9, #0x40 - str r9, [r8] - - mov r0, r9 - mov r1, r10 - bl CopyFdt - -.Lout: - bx r11 - -.LArm32LinuxMagic: - .byte 0x18, 0x28, 0x6f, 0x01 - -//UINTN -//ArmPlatformGetPrimaryCoreMpId ( -// VOID -// ); -ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) - MOV32 (r0, FixedPcdGet32 (PcdArmPrimaryCore)) - bx lr - -//UINTN -//ArmPlatformIsPrimaryCore ( -// IN UINTN MpId -// ); -ASM_FUNC(ArmPlatformIsPrimaryCore) - mov r0, #1 - bx lr - -//UINTN -//ArmPlatformGetCorePosition ( -// IN UINTN MpId -// ); -// With this function: CorePos =3D (ClusterId * 4) + CoreId -ASM_FUNC(ArmPlatformGetCorePosition) - and r1, r0, #ARM_CORE_MASK - and r0, r0, #ARM_CLUSTER_MASK - add r0, r1, r0, LSR #6 - bx lr - -//EFI_PHYSICAL_ADDRESS -//GetPhysAddrTop ( -// VOID -// ); -ASM_FUNC(ArmGetPhysAddrTop) - mov r0, #0x00000000 - mov r1, #0x10000 - bx lr - diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ArmXenRelocata= blePlatformLib.inf b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ArmXen= RelocatablePlatformLib.inf deleted file mode 100644 index b8cb24514d4c..000000000000 --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ArmXenRelocatablePlat= formLib.inf +++ /dev/null @@ -1,63 +0,0 @@ -#/* @file -# Copyright (c) 2011-2015, ARM Limited. All rights reserved. -# Copyright (c) 2014, Linaro Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may = be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -# -#*/ - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D ArmXenRelocatablePlatformLib - FILE_GUID =3D c8602718-4faa-4119-90ca-cae72509ac4c - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D ArmPlatformLib|SEC PEIM - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - EmbeddedPkg/EmbeddedPkg.dec - ArmPkg/ArmPkg.dec - ArmPlatformPkg/ArmPlatformPkg.dec - ArmVirtPkg/ArmVirtPkg.dec - -[LibraryClasses] - IoLib - ArmLib - PrintLib - FdtLib - -[Sources.common] - RelocatableVirt.c - XenVirtMem.c - FdtParser.c - -[Sources.AARCH64] - AARCH64/RelocatableVirtHelper.S - -[Sources.ARM] - ARM/RelocatableVirtHelper.S - -[FeaturePcd] - gEmbeddedTokenSpaceGuid.PcdCacheEnable - gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec - -[PatchPcd] - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress - gArmTokenSpaceGuid.PcdFdBaseAddress - gArmTokenSpaceGuid.PcdFvBaseAddress - gArmTokenSpaceGuid.PcdSystemMemoryBase - gArmTokenSpaceGuid.PcdSystemMemorySize - -[FixedPcd] - gArmPlatformTokenSpaceGuid.PcdCoreCount - gArmTokenSpaceGuid.PcdArmPrimaryCoreMask - gArmTokenSpaceGuid.PcdArmPrimaryCore - gArmTokenSpaceGuid.PcdFdSize diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c b/= ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c deleted file mode 100644 index 38fd5d3ed00c..000000000000 --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2015, Linaro Ltd. All rights reserved. - * - * This program and the accompanying materials - * are licensed and made available under the terms and conditions of the B= SD License - * which accompanies this distribution. The full text of the license may = be found at - * http://opensource.org/licenses/bsd-license.php - * - * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. - */ - -#include -#include - -BOOLEAN -FindMemnode ( - IN VOID *DeviceTreeBlob, - OUT UINT64 *SystemMemoryBase, - OUT UINT64 *SystemMemorySize - ) -{ - INT32 MemoryNode; - INT32 AddressCells; - INT32 SizeCells; - INT32 Length; - CONST INT32 *Prop; - - if (fdt_check_header (DeviceTreeBlob) !=3D 0) { - return FALSE; - } - - // - // Look for a node called "memory" at the lowest level of the tree - // - MemoryNode =3D fdt_path_offset (DeviceTreeBlob, "/memory"); - if (MemoryNode <=3D 0) { - return FALSE; - } - - // - // Retrieve the #address-cells and #size-cells properties - // from the root node, or use the default if not provided. - // - AddressCells =3D 1; - SizeCells =3D 1; - - Prop =3D fdt_getprop (DeviceTreeBlob, 0, "#address-cells", &Length); - if (Length =3D=3D 4) { - AddressCells =3D fdt32_to_cpu (*Prop); - } - - Prop =3D fdt_getprop (DeviceTreeBlob, 0, "#size-cells", &Length); - if (Length =3D=3D 4) { - SizeCells =3D fdt32_to_cpu (*Prop); - } - - // - // Now find the 'reg' property of the /memory node, and read the first - // range listed. - // - Prop =3D fdt_getprop (DeviceTreeBlob, MemoryNode, "reg", &Length); - - if (Length < (AddressCells + SizeCells) * sizeof (INT32)) { - return FALSE; - } - - *SystemMemoryBase =3D fdt32_to_cpu (Prop[0]); - if (AddressCells > 1) { - *SystemMemoryBase =3D (*SystemMemoryBase << 32) | fdt32_to_cpu (Prop[1= ]); - } - Prop +=3D AddressCells; - - *SystemMemorySize =3D fdt32_to_cpu (Prop[0]); - if (SizeCells > 1) { - *SystemMemorySize =3D (*SystemMemorySize << 32) | fdt32_to_cpu (Prop[1= ]); - } - - return TRUE; -} - -VOID -CopyFdt ( - IN VOID *FdtDest, - IN VOID *FdtSource - ) -{ - CopyMem (FdtDest, FdtSource, fdt_totalsize (FdtSource)); -} diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVir= t.c b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVirt.c deleted file mode 100644 index 6df207733ab2..000000000000 --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVirt.c +++ /dev/null @@ -1,70 +0,0 @@ -/** @file -* -* Copyright (c) 2011-2013, ARM Limited. All rights reserved. -* Copyright (c) 2014, Linaro Limited. All rights reserved. -* Copyright (c) 2014, Red Hat, Inc. -* -* -* This program and the accompanying materials -* are licensed and made available under the terms and conditions of the B= SD License -* which accompanies this distribution. The full text of the license may = be found at -* http://opensource.org/licenses/bsd-license.php -* -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -* -**/ - -#include -#include -#include -#include - -/** - Return the current Boot Mode - - This function returns the boot reason on the platform - - @return Return the current Boot Mode of the platform - -**/ -EFI_BOOT_MODE -ArmPlatformGetBootMode ( - VOID - ) -{ - return BOOT_WITH_FULL_CONFIGURATION; -} - -/** - This function is called by PrePeiCore, in the SEC phase. -**/ -RETURN_STATUS -ArmPlatformInitialize ( - IN UINTN MpId - ) -{ - // - // We are relying on ArmPlatformInitializeSystemMemory () being called f= rom - // InitializeMemory (), which only occurs if the following feature is di= sabled - // - ASSERT (!FeaturePcdGet (PcdSystemMemoryInitializeInSec)); - return RETURN_SUCCESS; -} - -VOID -ArmPlatformInitializeSystemMemory ( - VOID - ) -{ -} - -VOID -ArmPlatformGetPlatformPpiList ( - OUT UINTN *PpiListSize, - OUT EFI_PEI_PPI_DESCRIPTOR **PpiList - ) -{ - *PpiListSize =3D 0; - *PpiList =3D NULL; -} diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c b= /ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c deleted file mode 100644 index 63090586cf8b..000000000000 --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c +++ /dev/null @@ -1,82 +0,0 @@ -/** @file -* -* Copyright (c) 2014, Linaro Limited. All rights reserved. -* -* This program and the accompanying materials -* are licensed and made available under the terms and conditions of the B= SD License -* which accompanies this distribution. The full text of the license may = be found at -* http://opensource.org/licenses/bsd-license.php -* -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -* -**/ - -#include -#include -#include -#include -#include -#include - -// Number of Virtual Memory Map Descriptors -#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 2 - -// DDR attributes -#define DDR_ATTRIBUTES_CACHED ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK -#define DDR_ATTRIBUTES_UNCACHED ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBU= FFERED - -EFI_PHYSICAL_ADDRESS -ArmGetPhysAddrTop ( - VOID - ); - -/** - Return the Virtual Memory Map of your platform - - This Virtual Memory Map is used by MemoryInitPei Module to initialize th= e MMU - on your platform. - - @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR - describing a Physical-to-Virtual Memory - mapping. This array must be ended by a - zero-filled entry - -**/ -VOID -ArmPlatformGetVirtualMemoryMap ( - IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap - ) -{ - ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; - - ASSERT (VirtualMemoryMap !=3D NULL); - - VirtualMemoryTable =3D AllocatePages ( - EFI_SIZE_TO_PAGES ( - sizeof (ARM_MEMORY_REGION_DESCRIPTOR) - * MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS - ) - ); - - if (VirtualMemoryTable =3D=3D NULL) { - DEBUG ((EFI_D_ERROR, "%a: Error: Failed AllocatePages()\n", __FUNCTION= __)); - return; - } - - // - // Map the entire physical memory space as cached. The only device - // we care about is the GIC, which will be stage 2 mapped as a device - // by the hypervisor, which will override the cached mapping we install - // here. - // - VirtualMemoryTable[0].PhysicalBase =3D 0x0; - VirtualMemoryTable[0].VirtualBase =3D 0x0; - VirtualMemoryTable[0].Length =3D ArmGetPhysAddrTop (); - VirtualMemoryTable[0].Attributes =3D DDR_ATTRIBUTES_CACHED; - - // End of Table - ZeroMem (&VirtualMemoryTable[1], sizeof (ARM_MEMORY_REGION_DESCRIPTOR)); - - *VirtualMemoryMap =3D VirtualMemoryTable; -} --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel