From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0142e2c9bd=gilbert.chen@hpe.com) Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by groups.io with SMTP; Mon, 26 Aug 2019 23:25:50 -0700 Received: from pps.filterd (m0134423.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7R6M2DZ024546 for ; Tue, 27 Aug 2019 06:25:49 GMT Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0b-002e3701.pphosted.com with ESMTP id 2umuvb9age-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Aug 2019 06:25:49 +0000 Received: from G1W8106.americas.hpqcorp.net (g1w8106.austin.hp.com [16.193.72.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2352.austin.hpe.com (Postfix) with ESMTPS id B56DA62 for ; Tue, 27 Aug 2019 06:25:48 +0000 (UTC) Received: from G4W9327.americas.hpqcorp.net (16.208.32.97) by G1W8106.americas.hpqcorp.net (16.193.72.61) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 27 Aug 2019 06:25:48 +0000 Received: from G2W6311.americas.hpqcorp.net (16.197.64.53) by G4W9327.americas.hpqcorp.net (16.208.32.97) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 27 Aug 2019 06:25:48 +0000 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (15.241.52.12) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 27 Aug 2019 06:25:48 +0000 Received: from TU4PR8401MB1056.NAMPRD84.PROD.OUTLOOK.COM (10.169.47.148) by TU4PR8401MB0624.NAMPRD84.PROD.OUTLOOK.COM (10.169.44.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Tue, 27 Aug 2019 06:25:46 +0000 Received: from TU4PR8401MB1056.NAMPRD84.PROD.OUTLOOK.COM ([fe80::cc02:a574:b9e3:cf1e]) by TU4PR8401MB1056.NAMPRD84.PROD.OUTLOOK.COM ([fe80::cc02:a574:b9e3:cf1e%8]) with mapi id 15.20.2199.021; Tue, 27 Aug 2019 06:25:46 +0000 From: "Chen, Gilbert" To: "devel@edk2.groups.io" CC: "Chen, Gilbert" Subject: [PATCH 01/15] [platforms/devel-riscv]: Silicon/SiFive: Initial version of SiFive silicon package Thread-Topic: [PATCH 01/15] [platforms/devel-riscv]: Silicon/SiFive: Initial version of SiFive silicon package Thread-Index: AdVcoEHhjDG2tadVTOWJLd7f0NCk0Q== Date: Tue, 27 Aug 2019 06:25:46 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [16.242.247.133] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9ddc7a20-447d-43f6-995a-08d72ab7657a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:TU4PR8401MB0624; x-ms-traffictypediagnostic: TU4PR8401MB0624: x-ms-exchange-purlcount: 1 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0142F22657 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6029001)(39860400002)(366004)(136003)(376002)(396003)(346002)(199004)(189003)(86362001)(316002)(6436002)(2351001)(2501003)(7736002)(6306002)(478600001)(55016002)(102836004)(3846002)(9686003)(6116002)(476003)(53936002)(26005)(256004)(76116006)(486006)(14444005)(2906002)(66946007)(64756008)(5640700003)(66476007)(5660300002)(66446008)(66556008)(186003)(71200400001)(71190400001)(966005)(16799955002)(8936002)(66066001)(14454004)(6916009)(19627235002)(53376002)(52536014)(74316002)(8676002)(1730700003)(81166006)(81156014)(25786009)(6506007)(305945005)(15188155005)(99286004)(33656002)(4326008)(7696005);DIR:OUT;SFP:1102;SCL:1;SRVR:TU4PR8401MB0624;H:TU4PR8401MB1056.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Y+x83Eo+C2jt750koxcUVuRNmo0NEuWAeSc5HfMvyamM6aof2kVIVPKka9FmF1XNCtOuFmylXcjDmkzdQiXLuLHLVbTIuic/OznRyfFB1zsCTKbWp7pSmSY9uxpv9P1qH3o89yVRzqeY/JjJoD0PRwEAejmx6gB6wjNvrRSyXQh+PEYFwP84u2WrfgryPQhvtWzTz+7eKjTC5ra8K/8MZImwzAUAOBinvVmiayEzoSf2d74IC9Uaqpv+vbn5d76w1HbL1Q6sPf8TR+Hq/k7D/M3WZ/YXEtYUcC4WsFoht50gV7FPcQQi7zWzFN73qBnpqGhAgwZIWQre9R2EIgPK42Ymxu4JiwHGDXPmYc8kXNvrrnXGF7CeGSSAdbzC0qY3uTevvp5qjsIvciBWFlUXCmy+Saabu9ZCPrupXJBQSNk= arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E81TL0nA7QXPcPMy9kFM8dmBOk6v04kT5b0ZqROOQb3PVaSDXkU2Haca6CkAbeIfWYE+6eUb8XEDWuv8nIDSRfDK3yqL5EVYhZpRXpNPrH4RRvBNvrfwbabsmTs4xnobbkI6S6o6DNfiFihbFX0JfjKOaPWPqzylbrnG4IAd5Wgvop0HKljuErmWQp5WoKWb15jnXRSn7WfZu+f9nDVW5WOMnW4sUDMDW0qo9GaatbRZmras45lcgivIM7TsptGRkcLiDkpyv1MDFK6ga+g+BCjUtQqX1d8QZtEG8wPrtunWcrFCX8IZgvp3ImSxU1J5ntarX8ZkNX3UCpVrwxdlgQ== 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-SenderADCheck; bh=c83W2x9Y4TaMw6vJ+VHzhXtThVV1GG0mEgAqYSuMA4k=; b=kcPLtTrfNmdm9EhMEILhov00XnhkoY2BmDxz6thqvP51oA1itS4Pt0RPnSYGtlU2rNVakIU2KNDv+D+9C3UIGm6vo5Ad4LiNYbBtd73Uf+U3hxWQM8uduLRxeaEjUxC4vQSmefIQpSP7vghRfI3k9qZOhx7VRpZ5dzi/tBMXYqbERmnyhoP9wb3/EXa6I6xdyC3OH/yR65udrsCFlu4sSDFAVSwL4HeS3gVYfbA47W8Qpz1K3+MwUlG6vsuCRjOy7IgbS1YS6ADK7Z2tk0VIFf5vqAUi+F9yDJYJ/IlxjRnbew0D9VwxVsYQVrgqvOUv2uOR7t6WDcYLsn2hkgw3gg== 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 x-ms-exchange-crosstenant-network-message-id: 9ddc7a20-447d-43f6-995a-08d72ab7657a x-ms-exchange-crosstenant-originalarrivaltime: 27 Aug 2019 06:25:46.5270 (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: OWrYbol4n6vLJYxFSLH31DZrBkEclOfvnffZCjpPlVHyJgUpQ4I6IIMa4bYGI1rbEc6U/FcRQZdi+Qj41fqeqA== x-ms-exchange-transport-crosstenantheadersstamped: TU4PR8401MB0624 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-26_08:2019-08-26,2019-08-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 adultscore=0 impostorscore=0 malwarescore=0 suspectscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 lowpriorityscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1906280000 definitions=main-1908270070 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Add SiFive silicon EDK2 metafile and header files of SiFive RISC-V cores. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gilbert Chen --- Silicon/SiFive/Include/Library/SiFiveE51.h | 66 ++++++++++++++++++= ++++ Silicon/SiFive/Include/Library/SiFiveU54.h | 66 ++++++++++++++++++= ++++ .../SiFive/Include/Library/SiFiveU54MCCoreplex.h | 61 ++++++++++++++++++= ++ Silicon/SiFive/SiFive.dec | 45 +++++++++++++++ 4 files changed, 238 insertions(+) create mode 100644 Silicon/SiFive/Include/Library/SiFiveE51.h create mode 100644 Silicon/SiFive/Include/Library/SiFiveU54.h create mode 100644 Silicon/SiFive/Include/Library/SiFiveU54MCCoreplex.h create mode 100644 Silicon/SiFive/SiFive.dec diff --git a/Silicon/SiFive/Include/Library/SiFiveE51.h b/Silicon/SiFive/In= clude/Library/SiFiveE51.h new file mode 100644 index 0000000..96b1082 --- /dev/null +++ b/Silicon/SiFive/Include/Library/SiFiveE51.h @@ -0,0 +1,66 @@ +/** @file + SiFive E51 Core library definitions. + + Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All right= s reserved.
+ + This program and the accompanying materials are licensed and made availa= ble under + the terms and conditions of the BSD License that accompanies this distri= bution. + 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 __SIFIVE_E51_CORE_H__ +#define __SIFIVE_E51_CORE_H__ + +#include + +#include +#include + +/** + Function to build core specific information HOB. + + @param ParentProcessorGuid Parent processor od this core. ParentProc= essorGuid + could be the same as CoreGuid if one proc= essor has + only one core. + @param ParentProcessorUid Unique ID of pysical processor which owns= this core. + @param HartId Hart ID of this core. + @param IsBootHart TRUE means this is the boot HART. + @param GuidHobData Pointer to receive RISC_V_PROCESSOR_SPECI= FIC_DATA_HOB. + + @return EFI_SUCCESS The PEIM initialized successfully. + +**/ +EFI_STATUS +EFIAPI +CreateE51CoreProcessorSpecificDataHob ( + IN EFI_GUID *ParentProcessorGuid, + IN UINTN ParentProcessorUid, + IN UINTN HartId, + IN BOOLEAN IsBootHart, + OUT RISC_V_PROCESSOR_SPECIFIC_DATA_HOB **GuidHobData + ); + +/** + Function to build processor related SMBIOS information. RISC-V SMBIOS DX= E driver collect + this information and build SMBIOS Type4 and Type7 record. + + @param ProcessorUid Unique ID of pysical processor which owns this c= ore. + @param SmbiosHobPtr Pointer to receive RISC_V_PROCESSOR_SMBIOS_DATA_= HOB. The pointers + maintained in this structure is only valid befor= e memory is discovered. + Access to those pointers after memory is install= ed will cause unexpected issues. + + @return EFI_SUCCESS The PEIM initialized successfully. + +**/ +EFI_STATUS +EFIAPI +CreateE51ProcessorSmbiosDataHob ( + IN UINTN ProcessorUid, + OUT RISC_V_PROCESSOR_SMBIOS_DATA_HOB **SmbiosHobPtr + ); + +#endif diff --git a/Silicon/SiFive/Include/Library/SiFiveU54.h b/Silicon/SiFive/In= clude/Library/SiFiveU54.h new file mode 100644 index 0000000..216b584 --- /dev/null +++ b/Silicon/SiFive/Include/Library/SiFiveU54.h @@ -0,0 +1,66 @@ +/** @file + SiFive U54 Core library definitions. + + Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All right= s reserved.
+ + This program and the accompanying materials are licensed and made availa= ble under + the terms and conditions of the BSD License that accompanies this distri= bution. + 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 __SIFIVE_U54_CORE_H__ +#define __SIFIVE_U54_CORE_H__ + +#include + +#include +#include + +/** + Function to build core specific information HOB. + + @param ParentProcessorGuid Parent processor od this core. ParentProc= essorGuid + could be the same as CoreGuid if one proc= essor has + only one core. + @param ParentProcessorUid Unique ID of pysical processor which owns= this core. + @param HartId Hart ID of this core. + @param IsBootHart TRUE means this is the boot HART. + @param GuidHobdata Pointer to RISC_V_PROCESSOR_SPECIFIC_DATA= _HOB. + + @return EFI_SUCCESS The PEIM initialized successfully. + +**/ +EFI_STATUS +EFIAPI +CreateU54CoreProcessorSpecificDataHob ( + IN EFI_GUID *ParentProcessorGuid, + IN UINTN ParentProcessorUid, + IN UINTN HartId, + IN BOOLEAN IsBootHart, + OUT RISC_V_PROCESSOR_SPECIFIC_DATA_HOB **GuidHobdata + ); + +/** + Function to build processor related SMBIOS information. RISC-V SMBIOS DX= E driver collect + this information and build SMBIOS Type4 and Type7 record. + + @param ProcessorUid Unique ID of pysical processor which owns this c= ore. + @param SmbiosHobPtr Pointer to receive RISC_V_PROCESSOR_SMBIOS_DATA_= HOB. The pointers + maintained in this structure is only valid befor= e memory is discovered. + Access to those pointers after memory is install= ed will cause unexpected issues. + + @return EFI_SUCCESS The PEIM initialized successfully. + +**/ +EFI_STATUS +EFIAPI +CreateU54ProcessorSmbiosDataHob ( + IN UINTN ProcessorUid, + IN RISC_V_PROCESSOR_SMBIOS_DATA_HOB **SmbiosHobPtr + ); + +#endif diff --git a/Silicon/SiFive/Include/Library/SiFiveU54MCCoreplex.h b/Silicon= /SiFive/Include/Library/SiFiveU54MCCoreplex.h new file mode 100644 index 0000000..a9e42dc --- /dev/null +++ b/Silicon/SiFive/Include/Library/SiFiveU54MCCoreplex.h @@ -0,0 +1,61 @@ +/** @file + SiFive U54 Coreplex library definitions. + + Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All right= s reserved.
+ + This program and the accompanying materials are licensed and made availa= ble under + the terms and conditions of the BSD License that accompanies this distri= bution. + 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 __SIFIVE_U54MC_COREPLEX_CORE_H__ +#define __SIFIVE_U54MC_COREPLEX_CORE_H__ + +#include + +#include +#include + +#define SIFIVE_U54MC_COREPLEX_E51_HART_ID 0 +#define SIFIVE_U54MC_COREPLEX_U54_0_HART_ID 1 +#define SIFIVE_U54MC_COREPLEX_U54_1_HART_ID 2 +#define SIFIVE_U54MC_COREPLEX_U54_2_HART_ID 3 +#define SIFIVE_U54MC_COREPLEX_U54_3_HART_ID 4 + +/** + Build up U54MC coreplex processor core-specific information. + + @param UniqueId U54MC unique ID. + + @return EFI_STATUS + +**/ +EFI_STATUS +EFIAPI +CreateU54MCCoreplexProcessorSpecificDataHob ( + IN UINTN UniqueId + ); + +/** + Function to build processor related SMBIOS information. RISC-V SMBIOS DX= E driver collect + this information and build SMBIOS Type4 and Type7 record. + + @param ProcessorUid Unique ID of pysical processor which owns this c= ore. + @param SmbiosHobPtr Pointer to receive RISC_V_PROCESSOR_SMBIOS_DATA_= HOB. The pointers + maintained in this structure is only valid befor= e memory is discovered. + Access to those pointers after memory is install= ed will cause unexpected issues. + + @return EFI_SUCCESS The PEIM initialized successfully. + +**/ +EFI_STATUS +EFIAPI +CreateU54MCProcessorSmbiosDataHob ( + IN UINTN ProcessorUid, + IN RISC_V_PROCESSOR_SMBIOS_DATA_HOB **SmbiosHobPtr + ); +#endif diff --git a/Silicon/SiFive/SiFive.dec b/Silicon/SiFive/SiFive.dec new file mode 100644 index 0000000..149be76 --- /dev/null +++ b/Silicon/SiFive/SiFive.dec @@ -0,0 +1,45 @@ +## @file +# SiFive silicon package definitions +# +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All righ= ts 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 b= e 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] + DEC_SPECIFICATION =3D 0x00010005 + PACKAGE_NAME =3D SiFiveSiliconPkg + PACKAGE_GUID =3D 576912B2-7077-4B78-A934-4C133FEB20BB + PACKAGE_VERSION =3D 1.0 + +[Includes] + Include # Root include for the package + +[LibraryClasses] + +[Guids] + gEfiSiFiveSiliconSpaceGuid =3D {0x5F3E9E15, 0x8FFC, 0x4F53, { 0x8E, 0x6= 4, 0x92, 0x0B, 0xA5, 0x39, 0x81, 0xB0 }} + +[Protocols] + +[PcdsFixedAtBuild] + # E51 Core GUID + gEfiSiFiveSiliconSpaceGuid.PcdSiFiveE51CoreGuid |{0xD4, 0x69, 0x54, 0x87= , 0x96, 0x96, 0x48, 0x7F, 0x9F, 0x57, 0xB6, 0xF1, 0xDE, 0x7D, 0x97, 0x42}|V= OID*|0x00001000 + # U54 Core GUID + gEfiSiFiveSiliconSpaceGuid.PcdSiFiveU54CoreGuid |{0x64, 0x70, 0xF6, 0x90= , 0x11, 0x59, 0x47, 0xF1, 0xB8, 0xD5, 0xCF, 0x89, 0x10, 0xC5, 0x30, 0x20}|V= OID*|0x00001001 + # U54 MC Coreplex GUID + gEfiSiFiveSiliconSpaceGuid.PcdSiFiveU54MCCoreplexGuid |{0x67, 0xBF, 0x15= , 0xD9, 0x7E, 0x4F, 0x48, 0x27, 0x87, 0x19, 0x79, 0x0B, 0xA6, 0x22, 0x7C, 0= xBE}|VOID*|0x00001002 + # U5 MC Coreplex GUID + gEfiSiFiveSiliconSpaceGuid.PcdSiFiveU5MCCoreplexGuid |{0x06, 0x38, 0x9F,= 0x33, 0xF9, 0xDB, 0x43, 0x13, 0x9A, 0x9B, 0x1C, 0x68, 0xD6, 0x04, 0xEA, 0x= FF}|VOID*|0x00001003 + +[PcdsDynamic, PcdsDynamicEx] + +[PcdsFeatureFlag] + -- 2.7.4