From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web09.5139.1634615356043245064 for ; Mon, 18 Oct 2021 20:49:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=Dhb09z9R; spf=temperror, err=temporary DNS error (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=092675a635=daniel.schaefer@hpe.com) Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19IN21B3009268; Tue, 19 Oct 2021 03:49:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=pps0720; bh=QTqi3tWtsrq3+K+KMDDA6QottFj2nDsd20Tm5VUU4sY=; b=Dhb09z9RfYNxZTmZWzLmcFEu/T6vF7fLM1vpiHXh55+fjU6Vy2VhCftrA2HpBtqss155 1bWGpmKXJCnS90dSm+YHCR9P5D0H1M/URT1dA5/ZZNuXuVyb54ln9IP8ingbSNAQN+em fZ46skoN57Kvo1T9RA+tTR9IpAthG6rPObxPjolQY76a6RYsJ2pXmRd0kxU2pHMnYDKa FHR77PYz12IOr5lwyjYylfTEDvYF6MpT9uM/wntWgSQVGhMSfiCrlbWLJqPcfPDj1RLG EWxLroqxlNaaNFlSdtQCMW80hkWRu0xwJn15IsNPZXDLGsT19oWlgQp9yVmHJPIH+Y5H 9Q== Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0b-002e3701.pphosted.com with ESMTP id 3bs9u4wcqr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Oct 2021 03:49:14 +0000 Received: from G9W9210.americas.hpqcorp.net (g9w9210.houston.hpecorp.net [16.220.66.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g9t5009.houston.hpe.com (Postfix) with ESMTPS id 5E6B751; Tue, 19 Oct 2021 03:49:13 +0000 (UTC) Received: from G1W8106.americas.hpqcorp.net (16.193.72.61) by G9W9210.americas.hpqcorp.net (16.220.66.155) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 19 Oct 2021 03:49:13 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (15.241.52.10) by G1W8106.americas.hpqcorp.net (16.193.72.61) with Microsoft SMTP Server (TLS) id 15.0.1497.23 via Frontend Transport; Tue, 19 Oct 2021 03:49:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KRx4Jp55MEndhaurQ4VXqUGipIuthxGACqE4vjZ4X5+Yw/CqyrLINXeoY47hKBWL3ai+utIVDRixzxNdqdQ9FpbYZhekvDv+DxKmTu5FPuJK/bhtHEok95WFRHv6ZdT8xdOtIZhb4y/scPQvd6DUkZpqMivuapXo/N/OLinCRwudxXaS+YZasmch7wALTbHrMmTMcSlUg34m4ZSxrXdlG6g7to1KuCuPx9KyWt/4udbMsNOxDh+BYDoDtYPaDE5xCoPAu+on6buZ2axZNwxrn6r4jN/od89eE65mw+MQ2ncHnY5Y1QLKLhp9gqMhGaPGm8IhD6F1E/aqbDY5EzbtJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QTqi3tWtsrq3+K+KMDDA6QottFj2nDsd20Tm5VUU4sY=; b=XC0tAlbtASzeOCr6bLvO+D+3+cc22pGt2Fxzza6szPs/K2dMYZ9wRTQUonym89O/auB5BZZGk4x7mYtV8f3JYn+lQ/AmFEjl7R2vGi9Aeif3BwLH7OUvNV0E0z3Iql9zOV8FIf9RhrSryirqX5LedG4r+XniCF/eymCfHa7Gl0BOtL6jKn3zAUmBV85paAkSXHWxWTrDc0kiNnX2NN8LKrXyJr0nrXMigyb+MmvKb+TmzWN3frmMtvrrn26anZt210VNxHIEiIIYsENI8De1fAHgsXIODuTrmiTxaVMMmfWHrMq57DGHTAfyVvhor6TmyWb1XXKAu9wJUmSzVVTrAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=hpe.com; Received: from DF4PR8401MB0923.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760f::13) by DF4PR8401MB1321.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7613::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Tue, 19 Oct 2021 03:49:11 +0000 Received: from DF4PR8401MB0923.NAMPRD84.PROD.OUTLOOK.COM ([fe80::597f:4786:f1d6:8469]) by DF4PR8401MB0923.NAMPRD84.PROD.OUTLOOK.COM ([fe80::597f:4786:f1d6:8469%3]) with mapi id 15.20.4608.018; Tue, 19 Oct 2021 03:49:11 +0000 From: "Daniel Schaefer" To: CC: Daniel Schaefer , Abner Chang , Sunil V L Subject: [edk2-platforms] [PATCH v3 01/14] U5SeriesPkg: Deduplicate PlatformPei Date: Tue, 19 Oct 2021 11:48:36 +0800 Message-ID: <20211019034849.16847-2-daniel.schaefer@hpe.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211019034849.16847-1-daniel.schaefer@hpe.com> References: <20211019034849.16847-1-daniel.schaefer@hpe.com> X-ClientProxiedBy: SG2PR03CA0134.apcprd03.prod.outlook.com (2603:1096:4:c8::7) To DF4PR8401MB0923.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760f::13) MIME-Version: 1.0 Received: from zbook-nix.wireless.hpe.com (15.211.146.34) by SG2PR03CA0134.apcprd03.prod.outlook.com (2603:1096:4:c8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.11 via Frontend Transport; Tue, 19 Oct 2021 03:49:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6f6715a2-1aa0-4e3c-c41e-08d992b3690c X-MS-TrafficTypeDiagnostic: DF4PR8401MB1321: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1002; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mG1g58DZsOuniEc9AhNJF8KIjn+EYJ4+bM2+Y5lSyDpfXsMh0mdKuj81siFyx+dTEGFSwF5/bQu13x6T33jExnjsOUOqYOqetRaJ2ddlH4kD0z5sDNU19JKpE9x9L8k7lMUIXZb8PKY7OIW/DJyf1wMh0oI2JrtAw9VVQhdrNcLzLp/PO6R6FjtUoSjZzr2R2gXw2CTeAbC4L0hZpEeLqHTj3KdUamz/5SMGf07+HJ9VtUamjq/p6fLa8FHdWxicmwn2V5pkcttJlB2xTd5ANhYPtdMAIS4d/gopPKJNtsCp/jCR8iiNjivtMT/tgePXl+D40HuL3Et0H2nXNsB3Ce42UCdlZt9JJ2yEUd7avTtFwzsvlqmTsqnLHi/Ae82pAR6Tpv40nZhCk0YSysTXwDWGM/lne0VwxmylgvERc3rQhaoHBFM6hnLd6B1JaqPN48FZmvrHHkDotSw9HYHNis56qPmDk2SPdx9yxvLvUFj6qQplK4O2oGvTFb0et35N/BbRxna031xgquRRL2dCqEO+ULqtgIp8cJ84SjaXDtrWcCzv08VM/KBzfUXk5kpD147+lGWiMiTcL0FKp1kBzTZv/POdtpfp7DfMMaSTiVTuF6UKSoSnI0E2uoyZsLVT4CibEtWa7m+8yrLAjAVPl/NKZizow73DJVf/8ieNbB+/LCJXwgsb8w2+wEWWXMs2zds86qPv98os3lpiGcXV2Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DF4PR8401MB0923.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(366004)(1076003)(83380400001)(6486002)(36756003)(44832011)(316002)(5660300002)(6916009)(8936002)(6666004)(2906002)(26005)(30864003)(54906003)(38100700002)(38350700002)(2616005)(956004)(86362001)(52116002)(7696005)(8676002)(66476007)(19627235002)(4326008)(508600001)(66556008)(186003)(82960400001)(66946007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Wk26OGSC+X84CwBJj1nCrH7as/X1niO9DiXfNiqwqzWMbEn2Bvab1wtGqomv?= =?us-ascii?Q?WzI5XmNXzP8SpshfE+E5g/P+X0WYfaDDWdH8yw9ZRbYcOEiJvnR8O+gJtt7p?= =?us-ascii?Q?tQv4RXI2VtGiPX5urOeG7sjaAoGb922jDFkhw9sATy1JKpNVt9NiimgmhZy5?= =?us-ascii?Q?3w9eIW/3LEIJoj5W8UXyE8adVoiQYb0FUCAZiijmMpqkAVqksSamEmcI2tSe?= =?us-ascii?Q?iitIR5vpFkKsBwe4Df6YLH7Gi0AR36LymFEwbwiWfzkVrYtzBPuoXHeKUoJk?= =?us-ascii?Q?F1upuLPLvxOGVedqA6Sr/PAD+YXVnLlf1bpvMJHLbvM4ULMLrQv6kN3Q8AKK?= =?us-ascii?Q?ej+ITinSQWM30gRxl76QXROFGOqFCYdg/Q4mK1oWczoZ/hrZTwszFP35trch?= =?us-ascii?Q?xqQVz9h1L3ML/aT7wOrNRHO1/WoPK2RXRU4CE2ClGBlBYncRi8Gz6EatOM7+?= =?us-ascii?Q?ADnrJE4iBk2at65lPZrMw5uhdFHe6nDF9RKw7KBSnS2uFZsmsIK/X9G+JMUM?= =?us-ascii?Q?5Sf+DQbKg8HVSA1ZDYcgRBfuwm7JOMk07Rfw62c6bXkPpBb+fy0VuX6sbf+M?= =?us-ascii?Q?KPU+jqHIQ0VXrdVUG7a4P/nlIUrK/nmP1lpAka1zGLlKIfksuf7Auga/QvLK?= =?us-ascii?Q?0zm7Nbg1Px5yO2OOILtwmAJjQLrR7+nXoaB/fIjQZf0b70iOl5G7Juuc9eSD?= =?us-ascii?Q?yLfMApFeSOvnd0w5KMGkCohpaHy2LQ9O/wjiOZefUteUozBShz1Fvo4ict4n?= =?us-ascii?Q?7kQV9/X8Kn2EnvrabHk/ByEYc5OJ1DpDBn220v6fdci+dOWZQxpQB0L+THn/?= =?us-ascii?Q?ye7LTTFle8vrQ5P8+wmAvvYX+OSDm72U0soYQ2kCYxVL65kZj//soeu5y6c2?= =?us-ascii?Q?4Pah2BjEsoYWbQz1E5qVjZf9jIqrC03vDhFIlict9wLvG3fx8XBsyC/97bZk?= =?us-ascii?Q?KwhnL1Frq2cMU63Hr9yALp/Jb9AY2YJlWmIsTWLg1poLKA23F598pSr6FA9e?= =?us-ascii?Q?2jw8yMjLTPQrxPAIo+c/cK7wdG1VtsPgAzG04CplKvb3YODBhyeOiTHbU8QD?= =?us-ascii?Q?wQzUhP759xYenG+bccBYLtu2JzulHl7roCXUUeoe0nTUTdlxWLt2ZXy4rgCN?= =?us-ascii?Q?C97Wk9Bz3fJUHmG/keOQM720DobISQLAHS3xlc7sVGTw8UiS5QH6iefcgXKc?= =?us-ascii?Q?4hLlkcRSSZpCtNYsxgKbPyGCdWGKgLS9wy/rg4sAIRt2X37Dln1jMKtPVRuY?= =?us-ascii?Q?fUD4HUk/MQFCp1aJGxsj+5ERp0/eCp9NoDhW+DlqxWwMXbtncF+/NSZtQzUS?= =?us-ascii?Q?tO78T9enABB34ZpxB6xxOP0e?= X-MS-Exchange-CrossTenant-Network-Message-Id: 6f6715a2-1aa0-4e3c-c41e-08d992b3690c X-MS-Exchange-CrossTenant-AuthSource: DF4PR8401MB0923.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2021 03:49:11.2649 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Wplt7EASDkrnAhIesVJ4+RLbnaxvxPZR6M244XkeFq7IUVJAohyF9gIx0ruC8t3dHATCmsiATAWTXEoriOpuyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB1321 X-OriginatorOrg: hpe.com X-Proofpoint-ORIG-GUID: HsJKZk64fQP0x9SHzAHh5lt3qNldMUfu X-Proofpoint-GUID: HsJKZk64fQP0x9SHzAHh5lt3qNldMUfu X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-18_07,2021-10-18_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 priorityscore=1501 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110190019 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain The current (and future) RISC-V platforms share a lot of PlatformPei code that does not need to be duplicated. If we see that they need to have different behavior in the future, we can add platform specific libraires for that specific code. The upcoming RiscvVirt is only 1205 lines with this patch. Still way too much. Hopefully MinPlatform will help. 26 ./RiscvVirt.dec 13 ./RiscvVirt.uni 12 ./RiscvVirtPkgExtra.uni 78 ./VarStore.fdf.inc 66 ./RiscvVirt.fdf.inc 654 ./RiscvVirt.dsc 356 ./RiscvVirt.fdf 1205 total Cc: Abner Chang Cc: Sunil V L Reviewed-by: Abner Chang Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc = | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc = | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf = | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf = | 2 +- Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard =3D> RISC-V/P= latformPkg}/Universal/Pei/PlatformPei/PlatformPei.inf | 4 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPe= i/PlatformPei.inf | 73 ----- Platform/{SiFive/U5SeriesPkg/FreedomU500VC707Board =3D> RISC-V/PlatformPkg= }/Universal/Pei/PlatformPei/Platform.h | 0 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/= PlatformPei/Platform.h | 86 ------ Platform/{SiFive/U5SeriesPkg/FreedomU500VC707Board =3D> RISC-V/PlatformPkg= }/Universal/Pei/PlatformPei/Fv.c | 0 Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard =3D> RISC-V/P= latformPkg}/Universal/Pei/PlatformPei/MemDetect.c | 11 +- Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard =3D> RISC-V/P= latformPkg}/Universal/Pei/PlatformPei/Platform.c | 6 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPe= i/MemDetect.c | 74 ----- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPe= i/Platform.c | 310 -----------------= --- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/= PlatformPei/Fv.c | 51 ---- 14 files changed, 21 insertions(+), 602 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index 9f0a25f8a6af..fce1c5057879 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -395,7 +395,7 @@ NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompress= Lib.inf=0D }=0D =0D - Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/Platform= Pei/PlatformPei.inf {=0D + Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf {= =0D =0D PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf=0D }=0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U5= 40.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.d= sc index afe63c80ba28..14d83fb25a9f 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -394,7 +394,7 @@ NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompress= Lib.inf=0D }=0D =0D - Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pe= i/PlatformPei/PlatformPei.inf {=0D + Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf {= =0D =0D PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf=0D }=0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf index 5f3ac8e0b70f..7db3a02bcb8e 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf @@ -99,7 +99,7 @@ INF MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusC= odeHandlerPei.inf INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf=0D =0D # RISC-V Platform PEI Driver=0D -INF Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/Platf= ormPei/PlatformPei.inf=0D +INF Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf= =0D =0D ##########################################################################= ######=0D =0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U5= 40.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.f= df index a1a4b342e329..74717377287b 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf @@ -99,7 +99,7 @@ INF MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusC= odeHandlerPei.inf INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf=0D =0D # RISC-V Platform PEI Driver=0D -INF Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal= /Pei/PlatformPei/PlatformPei.inf=0D +INF Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf= =0D =0D ##########################################################################= ######=0D =0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Un= iversal/Pei/PlatformPei/PlatformPei.inf b/Platform/RISC-V/PlatformPkg/Unive= rsal/Pei/PlatformPei/PlatformPei.inf similarity index 88% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Uni= versal/Pei/PlatformPei/PlatformPei.inf rename to Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei= .inf index 59ada9305694..e7f5eef6300f 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal= /Pei/PlatformPei/PlatformPei.inf +++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf @@ -3,7 +3,7 @@ #=0D # This module provides platform specific function to detect boot mode.=0D #=0D -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
=0D +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D @@ -62,6 +62,8 @@ gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress=0D gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvBase=0D gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvSize=0D + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamBase=0D + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamSize=0D gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdNumberofU5Cores=0D gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdE5MCSupported=0D =0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pe= i/PlatformPei/PlatformPei.inf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC70= 7Board/Universal/Pei/PlatformPei/PlatformPei.inf deleted file mode 100644 index 0e96c33e8fff..000000000000 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/Platf= ormPei/PlatformPei.inf +++ /dev/null @@ -1,73 +0,0 @@ -## @file=0D -# Platform PEI driver=0D -#=0D -# This module provides platform specific function to detect boot mode.=0D -#=0D -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x0001001b=0D - BASE_NAME =3D PlatformPei=0D - FILE_GUID =3D 222c386d-5abc-4fb4-b124-fbb82488acf4= =0D - MODULE_TYPE =3D PEIM=0D - VERSION_STRING =3D 1.0=0D - ENTRY_POINT =3D InitializePlatform=0D -=0D -#=0D -# The following information is for reference only and not required by the = build tools.=0D -#=0D -# VALID_ARCHITECTURES =3D RISCV64=0D -#=0D -=0D -[Sources]=0D - Fv.c=0D - MemDetect.c=0D - Platform.c=0D -=0D -[Packages]=0D - MdeModulePkg/MdeModulePkg.dec=0D - MdePkg/MdePkg.dec=0D - Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec=0D - Platform/SiFive/U5SeriesPkg/U5SeriesPkg.dec=0D - Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec=0D - Silicon/SiFive/SiFive.dec=0D - UefiCpuPkg/UefiCpuPkg.dec=0D -=0D -[Guids]=0D - gEfiMemoryTypeInformationGuid=0D - gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid=0D -=0D -[LibraryClasses]=0D - DebugLib=0D - HobLib=0D - IoLib=0D - PciLib=0D - PeiResourcePublicationLib=0D - PeiServicesLib=0D - PeiServicesTablePointerLib=0D - PeimEntryPoint=0D - PcdLib=0D - SiliconSiFiveU5MCCoreplexInfoLib=0D -=0D -[Pcd]=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize=0D - gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress=0D - gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvBase=0D - gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvSize=0D - gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdNumberofU5Cores=0D - gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdE5MCSupported=0D -=0D -=0D -[Ppis]=0D - gEfiPeiMasterBootModePpiGuid=0D -=0D -[Depex]=0D - TRUE=0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pe= i/PlatformPei/Platform.h b/Platform/RISC-V/PlatformPkg/Universal/Pei/Platfo= rmPei/Platform.h similarity index 100% rename from Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei= /PlatformPei/Platform.h rename to Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.h diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Un= iversal/Pei/PlatformPei/Platform.h b/Platform/SiFive/U5SeriesPkg/FreedomU54= 0HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.h deleted file mode 100644 index c2cdd6d75b14..000000000000 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal= /Pei/PlatformPei/Platform.h +++ /dev/null @@ -1,86 +0,0 @@ -/** @file=0D - Platform PEI module include file.=0D -=0D - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D - Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
=0D -=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef PLATFORM_PEI_H_INCLUDED_=0D -#define PLATFORM_PEI_H_INCLUDED_=0D -=0D -VOID=0D -AddIoMemoryBaseSizeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - UINT64 MemorySize=0D - );=0D -=0D -VOID=0D -AddIoMemoryRangeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - EFI_PHYSICAL_ADDRESS MemoryLimit=0D - );=0D -=0D -VOID=0D -AddMemoryBaseSizeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - UINT64 MemorySize=0D - );=0D -=0D -VOID=0D -AddMemoryRangeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - EFI_PHYSICAL_ADDRESS MemoryLimit=0D - );=0D -=0D -VOID=0D -AddUntestedMemoryBaseSizeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - UINT64 MemorySize=0D - );=0D -=0D -VOID=0D -AddReservedMemoryBaseSizeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - UINT64 MemorySize=0D - );=0D -=0D -VOID=0D -AddUntestedMemoryRangeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - EFI_PHYSICAL_ADDRESS MemoryLimit=0D - );=0D -=0D -VOID=0D -AddressWidthInitialization (=0D - VOID=0D - );=0D -=0D -EFI_STATUS=0D -PublishPeiMemory (=0D - VOID=0D - );=0D -=0D -UINT32=0D -GetSystemMemorySizeBelow4gb (=0D - VOID=0D - );=0D -=0D -VOID=0D -InitializeRamRegions (=0D - VOID=0D - );=0D -=0D -EFI_STATUS=0D -PeiFvInitialization (=0D - VOID=0D - );=0D -=0D -EFI_STATUS=0D -InitializeXen (=0D - VOID=0D - );=0D -=0D -#endif // _PLATFORM_PEI_H_INCLUDED_=0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pe= i/PlatformPei/Fv.c b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/= Fv.c similarity index 100% rename from Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei= /PlatformPei/Fv.c rename to Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Fv.c diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Un= iversal/Pei/PlatformPei/MemDetect.c b/Platform/RISC-V/PlatformPkg/Universal= /Pei/PlatformPei/MemDetect.c similarity index 79% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Uni= versal/Pei/PlatformPei/MemDetect.c rename to Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/MemDetect.c index 755eae931844..c15d6bb5d425 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal= /Pei/PlatformPei/MemDetect.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/MemDetect.c @@ -1,7 +1,7 @@ /**@file=0D Memory Detection for Virtual Machines.=0D =0D - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
=0D =0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D @@ -46,6 +46,10 @@ PublishPeiMemory ( EFI_PHYSICAL_ADDRESS MemoryBase;=0D UINT64 MemorySize;=0D =0D + //=0D + // TODO: This value should come from platform=0D + // configuration or the memory sizing code.=0D + //=0D MemoryBase =3D 0x80000000UL + 0x1000000UL;=0D MemorySize =3D 0x40000000UL - 0x1000000UL; //1GB - 16MB=0D =0D @@ -69,6 +73,9 @@ InitializeRamRegions ( VOID=0D )=0D {=0D + //=0D + // TODO: This value should come from platform=0D + // configuration or the memory sizing code.=0D + //=0D AddMemoryRangeHob(0x81000000UL, 0x81000000UL + 0x3F000000UL);=0D -=0D }=0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Un= iversal/Pei/PlatformPei/Platform.c b/Platform/RISC-V/PlatformPkg/Universal/= Pei/PlatformPei/Platform.c similarity index 93% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Uni= versal/Pei/PlatformPei/Platform.c rename to Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c index 9a2cb9413caf..24192c692ba7 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal= /Pei/PlatformPei/Platform.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c @@ -199,11 +199,14 @@ MiscInitialization ( // of IO space. (Side note: unlike other HOBs, the CPU HOB is needed dur= ing=0D // S3 resume as well, so we build it unconditionally.)=0D //=0D + // TODO: Determine this dynamically from the platform=0D + // setting or the HART configuration.=0D + //=0D BuildCpuHob (48, 32);=0D }=0D =0D /**=0D - Check if system retunrs from S3.=0D + Check if system returns from S3.=0D =0D @return BOOLEAN TRUE, system returned from S3=0D FALSE, system is not returned from S3=0D @@ -254,6 +257,7 @@ BuildCoreInformationHob ( EFI_STATUS Status;=0D RISC_V_PROCESSOR_SMBIOS_HOB_DATA *SmbiosHobPtr;=0D =0D + // TODO: Create SMBIOS libs for non-U540 platforms=0D Status =3D CreateU5MCCoreplexProcessorSpecificDataHob (0);=0D if (EFI_ERROR (Status)) {=0D ASSERT(FALSE);=0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pe= i/PlatformPei/MemDetect.c b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Boa= rd/Universal/Pei/PlatformPei/MemDetect.c deleted file mode 100644 index 755eae931844..000000000000 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/Platf= ormPei/MemDetect.c +++ /dev/null @@ -1,74 +0,0 @@ -/**@file=0D - Memory Detection for Virtual Machines.=0D -=0D - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D - Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
=0D -=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -Module Name:=0D -=0D - MemDetect.c=0D -=0D -**/=0D -=0D -//=0D -// The package level header files this module uses=0D -//=0D -#include =0D -=0D -//=0D -// The Library classes this module consumes=0D -//=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include "Platform.h"=0D -=0D -=0D -/**=0D - Publish PEI core memory=0D -=0D - @return EFI_SUCCESS The PEIM initialized successfully.=0D -=0D -**/=0D -EFI_STATUS=0D -PublishPeiMemory (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_PHYSICAL_ADDRESS MemoryBase;=0D - UINT64 MemorySize;=0D -=0D - MemoryBase =3D 0x80000000UL + 0x1000000UL;=0D - MemorySize =3D 0x40000000UL - 0x1000000UL; //1GB - 16MB=0D -=0D - DEBUG((DEBUG_INFO, "%a: MemoryBase:0x%x MemorySize:%x\n", __FUNCTION__, = MemoryBase, MemorySize));=0D -=0D - //=0D - // Publish this memory to the PEI Core=0D - //=0D - Status =3D PublishSystemMemory(MemoryBase, MemorySize);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - return Status;=0D -}=0D -=0D -/**=0D - Publish system RAM and reserve memory regions=0D -=0D -**/=0D -VOID=0D -InitializeRamRegions (=0D - VOID=0D - )=0D -{=0D - AddMemoryRangeHob(0x81000000UL, 0x81000000UL + 0x3F000000UL);=0D -=0D -}=0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pe= i/PlatformPei/Platform.c b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Boar= d/Universal/Pei/PlatformPei/Platform.c deleted file mode 100644 index 6641e10f2ec3..000000000000 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/Platf= ormPei/Platform.c +++ /dev/null @@ -1,310 +0,0 @@ -/**@file=0D - Platform PEI driver=0D -=0D - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D - Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
=0D - Copyright (c) 2011, Andrei Warkentin =0D -=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -//=0D -// The package level header files this module uses=0D -//=0D -#include =0D -=0D -//=0D -// The Library classes this module consumes=0D -//=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include =0D -=0D -#include "Platform.h"=0D -=0D -EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] =3D {=0D - { EfiACPIMemoryNVS, 0x004 },=0D - { EfiACPIReclaimMemory, 0x008 },=0D - { EfiReservedMemoryType, 0x004 },=0D - { EfiRuntimeServicesData, 0x024 },=0D - { EfiRuntimeServicesCode, 0x030 },=0D - { EfiBootServicesCode, 0x180 },=0D - { EfiBootServicesData, 0xF00 },=0D - { EfiMaxMemoryType, 0x000 }=0D -};=0D -=0D -=0D -EFI_PEI_PPI_DESCRIPTOR mPpiBootMode[] =3D {=0D - {=0D - EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,=0D - &gEfiPeiMasterBootModePpiGuid,=0D - NULL=0D - }=0D -};=0D -=0D -STATIC EFI_BOOT_MODE mBootMode =3D BOOT_WITH_FULL_CONFIGURATION;=0D -=0D -VOID=0D -AddIoMemoryBaseSizeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - UINT64 MemorySize=0D - )=0D -{=0D - BuildResourceDescriptorHob (=0D - EFI_RESOURCE_MEMORY_MAPPED_IO,=0D - EFI_RESOURCE_ATTRIBUTE_PRESENT |=0D - EFI_RESOURCE_ATTRIBUTE_INITIALIZED |=0D - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |=0D - EFI_RESOURCE_ATTRIBUTE_TESTED,=0D - MemoryBase,=0D - MemorySize=0D - );=0D -}=0D -=0D -VOID=0D -AddReservedMemoryBaseSizeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - UINT64 MemorySize=0D - )=0D -{=0D - BuildResourceDescriptorHob (=0D - EFI_RESOURCE_MEMORY_RESERVED,=0D - EFI_RESOURCE_ATTRIBUTE_PRESENT |=0D - EFI_RESOURCE_ATTRIBUTE_INITIALIZED |=0D - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |=0D - EFI_RESOURCE_ATTRIBUTE_TESTED,=0D - MemoryBase,=0D - MemorySize=0D - );=0D -}=0D -=0D -VOID=0D -AddIoMemoryRangeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - EFI_PHYSICAL_ADDRESS MemoryLimit=0D - )=0D -{=0D - AddIoMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryBase));= =0D -}=0D -=0D -=0D -VOID=0D -AddMemoryBaseSizeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - UINT64 MemorySize=0D - )=0D -{=0D - BuildResourceDescriptorHob (=0D - EFI_RESOURCE_SYSTEM_MEMORY,=0D - EFI_RESOURCE_ATTRIBUTE_PRESENT |=0D - EFI_RESOURCE_ATTRIBUTE_INITIALIZED |=0D - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |=0D - EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |=0D - EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |=0D - EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |=0D - EFI_RESOURCE_ATTRIBUTE_TESTED,=0D - MemoryBase,=0D - MemorySize=0D - );=0D -}=0D -=0D -=0D -VOID=0D -AddMemoryRangeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - EFI_PHYSICAL_ADDRESS MemoryLimit=0D - )=0D -{=0D - AddMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryBase));=0D -}=0D -=0D -=0D -VOID=0D -AddUntestedMemoryBaseSizeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - UINT64 MemorySize=0D - )=0D -{=0D - BuildResourceDescriptorHob (=0D - EFI_RESOURCE_SYSTEM_MEMORY,=0D - EFI_RESOURCE_ATTRIBUTE_PRESENT |=0D - EFI_RESOURCE_ATTRIBUTE_INITIALIZED |=0D - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |=0D - EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |=0D - EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |=0D - EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE,=0D - MemoryBase,=0D - MemorySize=0D - );=0D -}=0D -=0D -VOID=0D -AddUntestedMemoryRangeHob (=0D - EFI_PHYSICAL_ADDRESS MemoryBase,=0D - EFI_PHYSICAL_ADDRESS MemoryLimit=0D - )=0D -{=0D - AddUntestedMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryB= ase));=0D -}=0D -=0D -VOID=0D -AddPciResource (=0D - VOID=0D - )=0D -{=0D - //=0D - // Platform-specific=0D - //=0D -}=0D -=0D -VOID=0D -MemMapInitialization (=0D - VOID=0D - )=0D -{=0D - //=0D - // Create Memory Type Information HOB=0D - //=0D - BuildGuidDataHob (=0D - &gEfiMemoryTypeInformationGuid,=0D - mDefaultMemoryTypeInformation,=0D - sizeof(mDefaultMemoryTypeInformation)=0D - );=0D -=0D - //=0D - // Add PCI IO Port space available for PCI resource allocations.=0D - //=0D - AddPciResource ();=0D -}=0D -=0D -VOID=0D -MiscInitialization (=0D - VOID=0D - )=0D -{=0D - //=0D - // Build the CPU HOB with guest RAM size dependent address width and 16-= bits=0D - // of IO space. (Side note: unlike other HOBs, the CPU HOB is needed dur= ing=0D - // S3 resume as well, so we build it unconditionally.)=0D - //=0D - BuildCpuHob (32, 32);=0D -}=0D -=0D -/**=0D - Check if system retunrs from S3.=0D -=0D - @return BOOLEAN TRUE, system returned from S3=0D - FALSE, system is not returned from S3=0D -=0D -**/=0D -BOOLEAN=0D -CheckResumeFromS3 (=0D - VOID=0D - )=0D -{=0D - //=0D - //Platform implementation-specific=0D - //=0D - return FALSE;=0D -}=0D -=0D -=0D -VOID=0D -BootModeInitialization (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - if (CheckResumeFromS3 () =3D=3D TRUE) {=0D - DEBUG ((DEBUG_INFO, "This is wake from S3\n"));=0D - } else {=0D - DEBUG ((DEBUG_INFO, "This is normal boot\n"));=0D - }=0D - Status =3D PeiServicesSetBootMode (mBootMode);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - Status =3D PeiServicesInstallPpi (mPpiBootMode);=0D - ASSERT_EFI_ERROR (Status);=0D -}=0D -=0D -/**=0D - Build processor information for U54 Coreplex processor.=0D -=0D - @return EFI_SUCCESS Status.=0D -=0D -**/=0D -EFI_STATUS=0D -BuildCoreInformationHob (=0D - VOID=0D -)=0D -{=0D - EFI_STATUS Status;=0D - RISC_V_PROCESSOR_SMBIOS_HOB_DATA *SmbiosHobPtr;=0D -=0D - Status =3D CreateU5MCCoreplexProcessorSpecificDataHob (0);=0D - if (EFI_ERROR (Status)) {=0D - ASSERT(FALSE);=0D - }=0D - Status =3D CreateU5MCProcessorSmbiosDataHob (0, &SmbiosHobPtr);=0D - if (EFI_ERROR (Status)) {=0D - ASSERT(FALSE);=0D - }=0D -=0D - DEBUG ((DEBUG_INFO, "U5 MC Coreplex SMBIOS DATA HOB at address 0x%x\n", = SmbiosHobPtr));=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Perform Platform PEI initialization.=0D -=0D - @param FileHandle Handle of the file being invoked.=0D - @param PeiServices Describes the list of possible PEI Services.=0D -=0D - @return EFI_SUCCESS The PEIM initialized successfully.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -InitializePlatform (=0D - IN EFI_PEI_FILE_HANDLE FileHandle,=0D - IN CONST EFI_PEI_SERVICES **PeiServices=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - DEBUG ((DEBUG_INFO, "Platform PEIM Loaded\n"));=0D -=0D - BootModeInitialization ();=0D - DEBUG ((DEBUG_INFO, "Platform BOOT mode initiated.\n"));=0D - PublishPeiMemory ();=0D - DEBUG ((DEBUG_INFO, "PEI memory published.\n"));=0D - InitializeRamRegions ();=0D - DEBUG ((DEBUG_INFO, "Platform RAM regions initiated.\n"));=0D -=0D - if (mBootMode !=3D BOOT_ON_S3_RESUME) {=0D - PeiFvInitialization ();=0D - MemMapInitialization ();=0D - }=0D -=0D - MiscInitialization ();=0D - Status =3D BuildCoreInformationHob ();=0D - if (EFI_ERROR (Status)) {=0D - DEBUG ((DEBUG_ERROR, "Fail to build processor informstion HOB.\n"));=0D - ASSERT(FALSE);=0D - }=0D - return EFI_SUCCESS;=0D -}=0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Un= iversal/Pei/PlatformPei/Fv.c b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiv= eUnleashedBoard/Universal/Pei/PlatformPei/Fv.c deleted file mode 100644 index 060d66238dff..000000000000 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal= /Pei/PlatformPei/Fv.c +++ /dev/null @@ -1,51 +0,0 @@ -/** @file=0D - Build FV related hobs for platform.=0D -=0D - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D - Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
=0D -=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "PiPei.h"=0D -#include "Platform.h"=0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -/**=0D - Publish PEI & DXE (Decompressed) Memory based FVs to let PEI=0D - and DXE know about them.=0D -=0D - @retval EFI_SUCCESS Platform PEI FVs were initialized successfully.=0D -=0D -**/=0D -EFI_STATUS=0D -PeiFvInitialization (=0D - VOID=0D - )=0D -{=0D - DEBUG ((DEBUG_INFO, "Platform PEI Firmware Volume Initialization\n"));=0D - //=0D - // Let DXE know about the DXE FV=0D - //=0D - BuildFvHob (PcdGet32 (PcdRiscVDxeFvBase), PcdGet32 (PcdRiscVDxeFvSize));= =0D - DEBUG ((DEBUG_INFO, "Platform builds DXE FV at %x, size %x.\n",=0D - PcdGet32 (PcdRiscVDxeFvBase),=0D - PcdGet32 (PcdRiscVDxeFvSize)));=0D -=0D - //=0D - // Let PEI know about the DXE FV so it can find the DXE Core=0D - //=0D - PeiServicesInstallFvInfoPpi (=0D - NULL,=0D - (VOID *)(UINTN) PcdGet32 (PcdRiscVDxeFvBase),=0D - PcdGet32 (PcdRiscVDxeFvSize),=0D - NULL,=0D - NULL=0D - );=0D -=0D - return EFI_SUCCESS;=0D -}=0D --=20 2.31.1