From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web10.25449.1681860709885211282 for ; Tue, 18 Apr 2023 16:31:50 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=S5fInDhb; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: andrei.warkentin@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681860709; x=1713396709; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=3xu+r2ctW4PrDzJwJ5yg/y8Cg7FQ3f7owpEUGkrFnGU=; b=S5fInDhbTfkaLVlcJPQgprTaIife5+1CdVKG/mLkwYz34bt2F2wrFRfw uYI7LK+uXPt344CA0GUBNFpD6njPcgiFUahQySDW/OUh4LYHnRJ/it2cA R6D0m1YuLp9E193qRXWKs14nZNBHH5E4GlaugwTGNXI9Q0jOmgbZ8h/WD sIKSabK2w7IDp2ZMbFOGse9FzwbYioABe6E9T0SpalA3nuPOdUObt0gvk BJ9ybXI6QmCEJ1xzyrc9cOgOauOygmXj8GrsPY7Zr9iFAMMIZxeGDUenJ IY2MBIi97K6UV6YyEn92JHJN1kg3PrpeKgtafvvJlQJHyv+NICq3Fkgn6 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="344060127" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="344060127" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2023 16:31:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="721687583" X-IronPort-AV: E=Sophos;i="5.99,208,1677571200"; d="scan'208";a="721687583" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga008.jf.intel.com with ESMTP; 18 Apr 2023 16:31:47 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 18 Apr 2023 16:31:47 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 18 Apr 2023 16:31:47 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Tue, 18 Apr 2023 16:31:47 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.43) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Tue, 18 Apr 2023 16:31:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TIg4GF/xuEPKaO0MtBurasmnAKnpBg8hYEsRkKoCU57cnzhASWOCS2TeMw5WWKQP1ym+8BDYs+VYAnXCnPZCHFkJPj/pkI7F6miJi+rj+u6udtQQglAibiPGIbS1BJgnd7J2mV4fVlqWKwML3LIeio06h8HDXQpeiu320o+pB4LHqiWU890HHwrBxQKb0eR615h3RCE/DhOCityQ9A0DjPw4vxXHUoWMUeLM5C1LtLB0QYYTeRR+Kk6jsTpvkWq+0o8to76JjGefMQtSJBiagLgk9OMwsE3PbhwZ5aviA504QKooiBcbYEOYxy2VXyFNUpDU4oh9ToMhIAhe8lX6eg== 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=jHoKIzZS4lZ6OYC0u9KlhwJQspO6v720HT656njf8Ns=; b=meJuIWwX3vA8o0jSIwQajIAPmpdAp+YrtOOKFDbe0ypyO1vDoEsW+gnmWZBMtsQyYClCJUNwLqh6TweNgLFdQqOcHFP+jpQw7MMhmOaOv14sj1jHrVC6wRqI2rYK/9R7/Y9xo1zcPIgMdMtBSYQcjEpK+LUYBC0Zg8tbwZyZAS18MqKmQS3fL/2jm+5B2UjZLvgoOWdn/jyj5ENzV6Ir5ZmlQEz+5ktlYehEYbeb/V4LPa/sEKlbfjME/mw5s3FdmvqvFubm2N+epkSSuW+LFtsiRGZWeMCU0bZavG5Wr4T9Gqf19eRbMHhqs7q8rP/DK7YBYB3zliMc+CVgNmAUVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH8PR11MB6856.namprd11.prod.outlook.com (2603:10b6:510:22b::7) by PH7PR11MB6980.namprd11.prod.outlook.com (2603:10b6:510:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Tue, 18 Apr 2023 23:31:44 +0000 Received: from PH8PR11MB6856.namprd11.prod.outlook.com ([fe80::f794:46bc:90a:c3a3]) by PH8PR11MB6856.namprd11.prod.outlook.com ([fe80::f794:46bc:90a:c3a3%6]) with mapi id 15.20.6298.045; Tue, 18 Apr 2023 23:31:44 +0000 From: "Andrei Warkentin" To: "devel@edk2.groups.io" , "sunilvl@ventanamicro.com" CC: Daniel Schaefer , "Kinney, Michael D" , "Gao, Liming" , "Liu, Zhiguang" , Gerd Hoffmann Subject: Re: [edk2-devel] [PATCH v7 2/3] MdePkg: add SBI-based SerialPortLib for RISC-V Thread-Topic: [edk2-devel] [PATCH v7 2/3] MdePkg: add SBI-based SerialPortLib for RISC-V Thread-Index: AQHZaZorFZGpjzYpe0emW9GiayWeR68nSgsAgAp+IxA= Date: Tue, 18 Apr 2023 23:31:43 +0000 Message-ID: References: <20230407214425.4360-1-andrei.warkentin@intel.com> <20230407214425.4360-3-andrei.warkentin@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH8PR11MB6856:EE_|PH7PR11MB6980:EE_ x-ms-office365-filtering-correlation-id: 2e0ff9b3-8c41-40d3-3f8f-08db40651181 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AMWIDIq+oocaKE7mcXdZDLWKKD4DQJTiFdpjus9PYqckBWbjvpqefw4elW2R7gFSwcadjmoCzeGlvAkTjvpBWTKDj6kdGwoP5VInCWoKtKUpeZAno62cTtsJ43Ln9g301bplrCIrbtwCDQ2NIqLsIHU48wR1cbhDfFspvof6O33/Jt+Jp3sFrSHxGWJGa7g5gajo9IcEbIu+naOHxj6n9xRces/SEKyw/IFsEUIqexYcFA42+42IwexMknxFg9GWUlRgekkuZGVbiGwcQO9fyRlRXQC/VaYDDK8gB51CjweBROF7eFL1qjtsP/z1ojx0GkY27QrDYCj0ViA36T9W4u/MjOaR/IxWjhwaxRGAD03QRga4XOIybPmGhh6YsBY1Ycb4cGmn5ArjCjuKSyBrJlKsVLor3588pGDYaoak0FddPqYAfiSbXC9hxKQbKqIWHmjFmvyzhUID9sbjMxaZTHJYOlgcNkv40FH38bgPQn6JwjkJyNxuch+7F1KJBIZUPY43WNKj4bJkaA/aBmFPcmBpTJVFfSrLaJ8d8P8QRrEo514iqvof71xCimIXUpjrmsgKhofl2IcMUap0iVTOY0/Bfh5z7jhU7Gii4bbnFWL8anMi6JFGkTTPPRbbOplltuStHN5AP8eQkkHPWG6tCg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR11MB6856.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(376002)(366004)(346002)(39860400002)(396003)(451199021)(9686003)(6506007)(86362001)(83380400001)(64756008)(53546011)(38070700005)(26005)(33656002)(186003)(2906002)(30864003)(5660300002)(7696005)(52536014)(966005)(38100700002)(71200400001)(66899021)(8676002)(8936002)(66476007)(478600001)(110136005)(54906003)(122000001)(82960400001)(41300700001)(316002)(66446008)(66556008)(66946007)(76116006)(4326008)(55016003)(559001)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qpExNQZkEtXH9T8aSB9lfjolk/iyO/4hGZZN0/qlrE1LW1WeU+ZuowBW1ELL?= =?us-ascii?Q?6Z7bct8Bd4HRepMsWKW+Trx1BnTM0KzPHsj5TthTQnHIPJ3qlG2kMDDLUDkC?= =?us-ascii?Q?BgZnm+07bkXxB8pCz7LUjRzuwdJuuaelA11qmtLGNg1NyR4p2LY4lbuxowOp?= =?us-ascii?Q?AtktX4c1QoD/ZgTumjeHwLDTAh7Fi+00Yn0PM66V7gfDejQAupYipWfMjQyr?= =?us-ascii?Q?p0RoyPpQVPVEZacRD2+MtFw1ztrY9C5COrD4b8lHNjkd54fGIZzXCMuWbmSe?= =?us-ascii?Q?Cl8X1nJILz9jgryr2ejZfkKkMH21Fj3Qyi2Dahjsi1f2CDdpTkgzJ0kQ5xBi?= =?us-ascii?Q?i/eRJfqL5PWvFiTUJyX2V9zDdCsvvFmtdUT2KsZlGOtJwgTxAcaJE7OGCJsS?= =?us-ascii?Q?6+F0ulbJW1p8WsMzwayxVvTinqXtmdN55dJ2n0qVxWcWelJkyOuIvx2QHxR5?= =?us-ascii?Q?Re5tommUtn6rV4SvtwLglgpzwPspGSmDdn/f/J62y6V9H3nrfhOSbHbhmXrx?= =?us-ascii?Q?mNOsJmTZAW84PNqtlVOArjkFbPAo8y/XLAJKbNyk/pYPjDyDrwqAuQb92heQ?= =?us-ascii?Q?Hx/7Hebn/3NKUXs7S+gF/ViNPvOlY5n0G38FpwyY7zMGWkDagdBI9vqA2U/i?= =?us-ascii?Q?B5NnJSX6P3PSn1wWMRElQqk31SnYKyUZyO2JlWhjt8R0HmNviypP0kMX47HG?= =?us-ascii?Q?JoKnz27bLklHdu1R5rnFRB8GiSi/RN1PjWPny+1uXaIoe4dP7ZYdNkNEqtkN?= =?us-ascii?Q?rj61gwrk8MRidnmmedLf59p05BVi453lBAkxJhGOk9a/oGrIuCgMvyxUcyGU?= =?us-ascii?Q?Rc/QAOJpjBSCIsYuI4A5cwxmnqSgKJwn5yn67lQFbwQhgAuvyNWtfP2tSBP7?= =?us-ascii?Q?WmP1M4QwsPNStKG1ipzMyhhh/rjQwX/QNGJATPicqI/pGdo70HvqbG6F/79C?= =?us-ascii?Q?NgNFWm17fPzx4tpluKFovr0xylLVFeD+CJuMXHFJ+3jkI0WbXd8d8h4mwkv3?= =?us-ascii?Q?lt9fjtfVQ+AWIjD9hBXxq5OuoLnmcgeELdPiBiLXIu1QbULZHv+Zxt6M1Ehw?= =?us-ascii?Q?BmWPOgThSlL7ImjYnAzpPECKL1N8JVt9oQAqKfDKUfLEWmiMYFrDKymhT1Mk?= =?us-ascii?Q?WGenaW6Bf66nMJYNoA+YpxHbWlgkI9TejWa90KKMftxEdbJHO3SQVcK4Cxi4?= =?us-ascii?Q?vAVQ0dQZ7JxdFFfqrbxGmXhz3V0VhQlosT3e2KgepPwMPFjpKwkhAOVRmMW/?= =?us-ascii?Q?W7WW+13A0U7dUP1EZgN+AkCXV/EgoS0VYwED30B8d3Xo9g0IMKHRvpNqQzkD?= =?us-ascii?Q?BP3CLSAlgMvhQMSbKDruw6h1TWCys4aSjjsN3nmJbUUNADdIg48VNpgUziPc?= =?us-ascii?Q?K70jKIVcASCyvAM5Mym5O6cAVijXUv0YIH1FDASb+ww2StfLBQd3YJPzSUSk?= =?us-ascii?Q?kU20HjD/vF2iuxM/os3WPBi/uXUKU2okVJIO3nf/WnfpZh5k0Uzk0BB+b9M3?= =?us-ascii?Q?+igPKsZEScpVOFXhhdCVygS3rYJ5ZkdBe1l2bwqu6XOZQUM5uG/x6Tv5KFs5?= =?us-ascii?Q?cYAFgq1b7WlDUcHDHkB+Qsl0osxcOKQtM3eLoA4FOoDf0dTfDecnGq5AMsEJ?= =?us-ascii?Q?cg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH8PR11MB6856.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e0ff9b3-8c41-40d3-3f8f-08db40651181 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2023 23:31:43.2488 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4+ZTKXo6/+lzxWAOajXetO8HXfBq5S5Kf8H9dtx2SJoPKGHscGqzREF/bbg0eWJiZNP1DPM6Hkr8jeffZ8dCpRCmwwFrlYVt1eMpN2jHUVM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6980 Return-Path: andrei.warkentin@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Sunil, Not saying it's right, but I followed a specific pattern seen elsewhere, e.= g. ./MdeModulePkg/Core/PiSmmCore/PiSmmIpl.uni, where the two sentences are = either the same or mildly rephrased. A=20 > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Sunil V L > Sent: Wednesday, April 12, 2023 2:16 AM > To: Warkentin, Andrei > Cc: devel@edk2.groups.io; Daniel Schaefer ; > Kinney, Michael D ; Gao, Liming > ; Liu, Zhiguang ; Gerd > Hoffmann > Subject: Re: [edk2-devel] [PATCH v7 2/3] MdePkg: add SBI-based > SerialPortLib for RISC-V >=20 > Thanks, Andrei. Just one nit comment below. >=20 > Otherwise, LGTM. > Reviewed-by: Sunil V L >=20 > On Fri, Apr 07, 2023 at 04:44:24PM -0500, Andrei Warkentin wrote: > > These are implementations of SerialPortLib using SBI console services. > > - BaseSerialPortLibRiscVSbiLib is appropriate for SEC/PEI (XIP) > > environments > > - BaseSerialPortLibRiscVSbiLibRam is appropriate for PrePI/DXE > > environments > > > > Tested with: > > - Qemu RiscVVirt (non-DBCN case, backed by UART) > > - TinyEMU + RiscVVirt (non-DBCN case, HTIF) > > - TinyEMU + RiscVVirt (DBCN case, HTIF) > > > > Cc: Daniel Schaefer > > Cc: Sunil V L > > Cc: Michael D Kinney > > Cc: Liming Gao > > Cc: Zhiguang Liu > > Acked-by: Gerd Hoffmann > > Signed-off-by: Andrei Warkentin > > --- > > MdePkg/MdePkg.dsc = | 2 + > > > MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.= in > f | 41 +++ > > > MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLibR= a > m.inf | 38 +++ > > MdePkg/Library/BaseSerialPortLibRiscVSbiLib/Common.h = | > 41 +++ > > > MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.= c > | 208 ++++++++++++++ > > > MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLibR= a > m.c | 289 ++++++++++++++++++++ > > MdePkg/Library/BaseSerialPortLibRiscVSbiLib/Common.c = | > 132 +++++++++ > > > MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.= u > ni | 16 ++ > > 8 files changed, 767 insertions(+) > > > > diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index > > 0ac7618b4623..a810ad0d147d 100644 > > --- a/MdePkg/MdePkg.dsc > > +++ b/MdePkg/MdePkg.dsc > > @@ -192,5 +192,7 @@ [Components.ARM, Components.AARCH64] > > > > [Components.RISCV64] > > MdePkg/Library/BaseRiscVSbiLib/BaseRiscVSbiLib.inf > > + > > + MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSb > > + iLib.inf > > + MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSb > > + iLibRam.inf > > > > [BuildOptions] > > diff --git > > a/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSb > > iLib.inf > > b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSb > > iLib.inf > > new file mode 100644 > > index 000000000000..2340ac6bfe67 > > --- /dev/null > > +++ b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRis > > +++ cVSbiLib.inf > > @@ -0,0 +1,41 @@ > > +## @file > > +# Serial Port Library backed by SBI console. > > +# > > +# Meant for SEC and PEI (XIP) environments. > > +# > > +# Due to limitations of SBI console interface and XIP environments # > > +(on use of globals), this library instance does not implement reading > > +# and polling the serial port. See > > +PrePiDxeSerialPortLibRiscVSbiRam.inf > > +# for the full-featured variant meant for PrePi and DXE environments. > > +# > > +# Copyright (c) 2023, Intel Corporation. All rights reserved.
# > > +# SPDX-License-Identifier: BSD-2-Clause-Patent # # ## > > + > > +[Defines] > > + INF_VERSION =3D 0x0001001B > > + BASE_NAME =3D BaseSerialPortLibRiscVSbiLib > > + MODULE_UNI_FILE =3D BaseSerialPortLibRiscVSbiLib.uni > > + FILE_GUID =3D 639fad38-4bfd-4eb9-9f09-e97c7947d= 480 > > + MODULE_TYPE =3D BASE > > + VERSION_STRING =3D 1.0 > > + LIBRARY_CLASS =3D SerialPortLib | SEC PEI_CORE PEIM > > + > > + > > +# > > +# VALID_ARCHITECTURES =3D RISCV64 > > +# > > + > > +[Sources] > > + BaseSerialPortLibRiscVSbiLib.c > > + Common.c > > + Common.h > > + > > +[Packages] > > + MdePkg/MdePkg.dec > > + > > +[LibraryClasses] > > + RiscVSbiLib > > diff --git > > a/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSb > > iLibRam.inf > > b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSb > > iLibRam.inf > > new file mode 100644 > > index 000000000000..d09573ca5b36 > > --- /dev/null > > +++ b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRis > > +++ cVSbiLibRam.inf > > @@ -0,0 +1,38 @@ > > +## @file > > +# Serial Port Library backed by SBI console. > > +# > > +# Meant for PrePi and DXE environments (where globals are allowed). > > +See # BaseSerialPortLibRiscVSbiLib.inf for a reduced variant > > +appropriate # for SEC and PEI (XIP) environments. > > +# > > +# Copyright (c) 2023, Intel Corporation. All rights reserved.
# > > +# SPDX-License-Identifier: BSD-2-Clause-Patent # # ## > > + > > +[Defines] > > + INF_VERSION =3D 0x0001001B > > + BASE_NAME =3D BaseSerialPortLibRiscVSbiLibRam > > + MODULE_UNI_FILE =3D BaseSerialPortLibRiscVSbiLib.uni > > + FILE_GUID =3D 872af743-ab56-45b4-a065-602567f48= 20c > > + MODULE_TYPE =3D BASE > > + VERSION_STRING =3D 1.0 > > + LIBRARY_CLASS =3D SerialPortLib | SEC DXE_CORE DXE_= DRIVER > DXE_RUNTIME_DRIVER UEFI_DRIVER UEFI_APPLICATION > > + > > + > > +# > > +# VALID_ARCHITECTURES =3D RISCV64 > > +# > > + > > +[Sources] > > + BaseSerialPortLibRiscVSbiLibRam.c > > + Common.c > > + Common.h > > + > > +[Packages] > > + MdePkg/MdePkg.dec > > + > > +[LibraryClasses] > > + RiscVSbiLib > > diff --git a/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/Common.h > > b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/Common.h > > new file mode 100644 > > index 000000000000..98c1a5d3865e > > --- /dev/null > > +++ b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/Common.h > > @@ -0,0 +1,41 @@ > > +/** @file > > + Serial Port Library backed by SBI console. > > + > > + Common functionality shared by PrePiDxeSerialPortLibRiscVSbi and > > + PrePiDxeSerialPortLibRiscVSbiRam implementations. > > + > > + Copyright (c) 2023, Intel Corporation. All rights reserved.
> > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > + > > +#ifndef SERIAL_PORT_SBI_COMMON_H_ > > +#define SERIAL_PORT_SBI_COMMON_H_ > > + > > +#include > > +#include > > +#include > > + > > +BOOLEAN > > +SbiImplementsDbcn ( > > + VOID > > + ); > > + > > +BOOLEAN > > +SbiImplementsLegacyPutchar ( > > + VOID > > + ); > > + > > +UINTN > > +SbiLegacyPutchar ( > > + IN UINT8 *Buffer, > > + IN UINTN NumberOfBytes > > + ); > > + > > +UINTN > > +SbiDbcnWrite ( > > + IN UINT8 *Buffer, > > + IN UINTN NumberOfBytes > > + ); > > + > > +#endif /* SERIAL_PORT_SBI_COMMON_H_ */ > > diff --git > > a/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSb > > iLib.c > > b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSb > > iLib.c > > new file mode 100644 > > index 000000000000..f4f2959cf8cc > > --- /dev/null > > +++ b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRis > > +++ cVSbiLib.c > > @@ -0,0 +1,208 @@ > > +/** @file > > + Serial Port Library backed by SBI console. > > + > > + Meant for SEC and PEI (XIP) environments. > > + > > + Due to limitations of SBI console interface and XIP environments > > + (on use of globals), this library instance does not implement > > + reading and polling the serial port. See > > + BaseSerialPortLibRiscVSbiLibRam.c for the full-featured variant mean= t for > PrePi and DXE environments. > > + > > + Copyright (c) 2023, Intel Corporation. All rights reserved.
> > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > + > > +#include "Common.h" > > + > > +/** > > + Initialize the serial device hardware. > > + > > + If no initialization is required, then return RETURN_SUCCESS. > > + If the serial device was successfully initialized, then return > RETURN_SUCCESS. > > + If the serial device could not be initialized, then return > RETURN_DEVICE_ERROR. > > + > > + @retval RETURN_SUCCESS The serial device was initialized. > > + @retval RETURN_DEVICE_ERROR The serial device could not be > initialized. > > + > > +**/ > > +RETURN_STATUS > > +EFIAPI > > +SerialPortInitialize ( > > + VOID > > + ) > > +{ > > + return RETURN_SUCCESS; > > +} > > + > > +/** > > + Write data from buffer to serial device. > > + > > + Writes NumberOfBytes data bytes from Buffer to the serial device. > > + The number of bytes actually written to the serial device is returne= d. > > + If the return value is less than NumberOfBytes, then the write opera= tion > failed. > > + If NumberOfBytes is zero, then return 0. > > + > > + @param Buffer The pointer to the data buffer to be writte= n. > > + @param NumberOfBytes The number of bytes to written to the seria= l > device. > > + > > + @retval 0 NumberOfBytes is 0. > > + @retval >0 The number of bytes written to the serial d= evice. > > + If this value is less than NumberOfBytes, t= hen the write > operation failed. > > + > > +**/ > > +UINTN > > +EFIAPI > > +SerialPortWrite ( > > + IN UINT8 *Buffer, > > + IN UINTN NumberOfBytes > > + ) > > +{ > > + if (NumberOfBytes =3D=3D 0) { > > + return 0; > > + } > > + > > + if (SbiImplementsDbcn ()) { > > + return SbiDbcnWrite (Buffer, NumberOfBytes); } > > + > > + if (SbiImplementsLegacyPutchar ()) { > > + return SbiLegacyPutchar (Buffer, NumberOfBytes); } > > + > > + /* > > + * Neither DBCN or legacy extension were present. > > + */ > > + return 0; > > +} > > + > > +/** > > + Read data from serial device and save the datas in buffer. > > + > > + Reads NumberOfBytes data bytes from a serial device into the buffer > > + specified by Buffer. The number of bytes actually read is returned. > > + If the return value is less than NumberOfBytes, then the rest operat= ion > failed. > > + If NumberOfBytes is zero, then return 0. > > + > > + @param Buffer The pointer to the data buffer to store the= data > read from the serial device. > > + @param NumberOfBytes The number of bytes which will be read. > > + > > + @retval 0 Read data failed; No data is to be read. > > + @retval >0 The actual number of bytes read from serial= device. > > + > > +**/ > > +UINTN > > +EFIAPI > > +SerialPortRead ( > > + OUT UINT8 *Buffer, > > + IN UINTN NumberOfBytes > > + ) > > +{ > > + return 0; > > +} > > + > > +/** > > + Polls a serial device to see if there is any data waiting to be read= . > > + > > + Polls a serial device to see if there is any data waiting to be read= . > > + If there is data waiting to be read from the serial device, then TRU= E is > returned. > > + If there is no data waiting to be read from the serial device, then = FALSE is > returned. > > + > > + @retval TRUE Data is waiting to be read from the serial = device. > > + @retval FALSE There is no data waiting to be read from th= e serial > device. > > + > > +**/ > > +BOOLEAN > > +EFIAPI > > +SerialPortPoll ( > > + VOID > > + ) > > +{ > > + return FALSE; > > +} > > + > > +/** > > + Sets the control bits on a serial device. > > + > > + @param Control Sets the bits of Control that are sett= able. > > + > > + @retval RETURN_SUCCESS The new control bits were set on the > serial device. > > + @retval RETURN_UNSUPPORTED The serial device does not support > this operation. > > + @retval RETURN_DEVICE_ERROR The serial device is not functioning > correctly. > > + > > +**/ > > +RETURN_STATUS > > +EFIAPI > > +SerialPortSetControl ( > > + IN UINT32 Control > > + ) > > +{ > > + return RETURN_SUCCESS; > > +} > > + > > +/** > > + Retrieve the status of the control bits on a serial device. > > + > > + @param Control A pointer to return the current contro= l signals > from the serial device. > > + > > + @retval RETURN_SUCCESS The control bits were read from the se= rial > device. > > + @retval RETURN_UNSUPPORTED The serial device does not support > this operation. > > + @retval RETURN_DEVICE_ERROR The serial device is not functioning > correctly. > > + > > +**/ > > +RETURN_STATUS > > +EFIAPI > > +SerialPortGetControl ( > > + OUT UINT32 *Control > > + ) > > +{ > > + *Control =3D 0; > > + return RETURN_SUCCESS; > > +} > > + > > +/** > > + Sets the baud rate, receive FIFO depth, transmit/receice time out, > > +parity, > > + data bits, and stop bits on a serial device. > > + > > + @param BaudRate The requested baud rate. A BaudRate value = of 0 > will use the > > + device's default interface speed. > > + On output, the value actually set. > > + @param ReveiveFifoDepth The requested depth of the FIFO on the > receive side of the > > + serial interface. A ReceiveFifoDepth value= of 0 will use > > + the device's default FIFO depth. > > + On output, the value actually set. > > + @param Timeout The requested time out for a single charac= ter in > microseconds. > > + This timeout applies to both the transmit = and receive side > of the > > + interface. A Timeout value of 0 will use t= he device's > default time > > + out value. > > + On output, the value actually set. > > + @param Parity The type of parity to use on this serial d= evice. A > Parity value of > > + DefaultParity will use the device's defaul= t parity value. > > + On output, the value actually set. > > + @param DataBits The number of data bits to use on the seri= al > device. A DataBits > > + vaule of 0 will use the device's default d= ata bit setting. > > + On output, the value actually set. > > + @param StopBits The number of stop bits to use on this ser= ial > device. A StopBits > > + value of DefaultStopBits will use the devi= ce's default > number of > > + stop bits. > > + On output, the value actually set. > > + > > + @retval RETURN_SUCCESS The new attributes were set on the > serial device. > > + @retval RETURN_UNSUPPORTED The serial device does not support > this operation. > > + @retval RETURN_INVALID_PARAMETER One or more of the attributes > has an unsupported value. > > + @retval RETURN_DEVICE_ERROR The serial device is not functioni= ng > correctly. > > + > > +**/ > > +RETURN_STATUS > > +EFIAPI > > +SerialPortSetAttributes ( > > + IN OUT UINT64 *BaudRate, > > + IN OUT UINT32 *ReceiveFifoDepth, > > + IN OUT UINT32 *Timeout, > > + IN OUT EFI_PARITY_TYPE *Parity, > > + IN OUT UINT8 *DataBits, > > + IN OUT EFI_STOP_BITS_TYPE *StopBits > > + ) > > +{ > > + return RETURN_SUCCESS; > > +} > > diff --git > > a/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSb > > iLibRam.c > > b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSb > > iLibRam.c > > new file mode 100644 > > index 000000000000..fafba87b7cd1 > > --- /dev/null > > +++ b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRis > > +++ cVSbiLibRam.c > > @@ -0,0 +1,289 @@ > > +/** @file > > + Serial Port Library backed by SBI console. > > + > > + Meant for PrePi and DXE environments (where globals are allowed). > > + See BaseSerialPortLibRiscVSbiLib.c for a reduced variant > > + appropriate for SEC and PEI (XIP) environments. > > + > > + Copyright (c) 2023, Intel Corporation. All rights reserved.
> > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > + > > +#include > > +#include > > +#include > > +#include "Common.h" > > + > > +STATIC BOOLEAN mHaveDbcn =3D FALSE; > > +STATIC BOOLEAN mHaveLegacyPutchar =3D FALSE; STATIC BOOLEAN > > +mHaveLegacyGetchar =3D FALSE; > > +STATIC INT64 mLastGetChar =3D -1; > > + > > +/** > > + Return whether the legacy console getchar extension is implemented. > > + > > + @retval TRUE Extension is implemented. > > + @retval FALSE Extension is not implemented. > > + > > +**/ > > +STATIC > > +BOOLEAN > > +SbiImplementsLegacyGetchar ( > > + VOID > > + ) > > +{ > > + SBI_RET Ret; > > + > > + Ret =3D SbiCall (SBI_EXT_BASE, SBI_EXT_BASE_PROBE_EXT, 1, > > + SBI_EXT_0_1_CONSOLE_GETCHAR); if ((TranslateError (Ret.Error) =3D=3D > EFI_SUCCESS) && > > + (Ret.Value !=3D 0)) > > + { > > + return TRUE; > > + } > > + > > + return FALSE; > > +} > > + > > +/** > > + Initialize the serial device hardware. > > + > > + If no initialization is required, then return RETURN_SUCCESS. > > + If the serial device was successfully initialized, then return > RETURN_SUCCESS. > > + If the serial device could not be initialized, then return > RETURN_DEVICE_ERROR. > > + > > + @retval RETURN_SUCCESS The serial device was initialized. > > + @retval RETURN_DEVICE_ERROR The serial device could not be > initialized. > > + > > +**/ > > +RETURN_STATUS > > +EFIAPI > > +SerialPortInitialize ( > > + VOID > > + ) > > +{ > > + if (SbiImplementsDbcn ()) { > > + mHaveDbcn =3D TRUE; > > + return RETURN_SUCCESS; > > + } > > + > > + if (SbiImplementsLegacyPutchar ()) { > > + mHaveLegacyPutchar =3D TRUE; > > + } > > + > > + if (SbiImplementsLegacyGetchar ()) { > > + mHaveLegacyGetchar =3D TRUE; > > + } > > + > > + return (mHaveLegacyGetchar && mHaveLegacyPutchar) ? > > + RETURN_SUCCESS : > > + RETURN_DEVICE_ERROR; > > +} > > + > > +/** > > + Write data from buffer to serial device. > > + > > + Writes NumberOfBytes data bytes from Buffer to the serial device. > > + The number of bytes actually written to the serial device is returne= d. > > + If the return value is less than NumberOfBytes, then the write opera= tion > failed. > > + If NumberOfBytes is zero, then return 0. > > + > > + @param Buffer The pointer to the data buffer to be writte= n. > > + @param NumberOfBytes The number of bytes to written to the seria= l > device. > > + > > + @retval 0 NumberOfBytes is 0. > > + @retval >0 The number of bytes written to the serial d= evice. > > + If this value is less than NumberOfBytes, t= hen the write > operation failed. > > + > > +**/ > > +UINTN > > +EFIAPI > > +SerialPortWrite ( > > + IN UINT8 *Buffer, > > + IN UINTN NumberOfBytes > > + ) > > +{ > > + if (NumberOfBytes =3D=3D 0) { > > + return 0; > > + } > > + > > + if (mHaveDbcn) { > > + return SbiDbcnWrite (Buffer, NumberOfBytes); } else if > > + (mHaveLegacyPutchar) { > > + return SbiLegacyPutchar (Buffer, NumberOfBytes); } > > + > > + /* > > + * Neither DBCN or legacy extension were present. > > + */ > > + return 0; > > +} > > + > > +/** > > + Read data from serial device and save the datas in buffer. > > + > > + Reads NumberOfBytes data bytes from a serial device into the buffer > > + specified by Buffer. The number of bytes actually read is returned. > > + If the return value is less than NumberOfBytes, then the rest operat= ion > failed. > > + If NumberOfBytes is zero, then return 0. > > + > > + @param Buffer The pointer to the data buffer to store the= data > read from the serial device. > > + @param NumberOfBytes The number of bytes which will be read. > > + > > + @retval 0 Read data failed; No data is to be read. > > + @retval >0 The actual number of bytes read from serial= device. > > + > > +**/ > > +UINTN > > +EFIAPI > > +SerialPortRead ( > > + OUT UINT8 *Buffer, > > + IN UINTN NumberOfBytes > > + ) > > +{ > > + UINTN Index; > > + > > + Index =3D 0; > > + while ((Index < NumberOfBytes) && SerialPortPoll ()) { > > + Buffer[Index++] =3D (UINT8)mLastGetChar; > > + mLastGetChar =3D -1; > > + } > > + > > + return Index; > > +} > > + > > +/** > > + Polls a serial device to see if there is any data waiting to be read= . > > + > > + Polls a serial device to see if there is any data waiting to be read= . > > + If there is data waiting to be read from the serial device, then TRU= E is > returned. > > + If there is no data waiting to be read from the serial device, then = FALSE is > returned. > > + > > + @retval TRUE Data is waiting to be read from the serial = device. > > + @retval FALSE There is no data waiting to be read from th= e serial > device. > > + > > +**/ > > +BOOLEAN > > +EFIAPI > > +SerialPortPoll ( > > + VOID > > + ) > > +{ > > + /* > > + * Careful. OpenSBI with HTIF console will return -1 followed by -2 > > + * if there is no character received. So just check for values >=3D = 0. > > + */ > > + > > + if (mLastGetChar >=3D 0) { > > + return TRUE; > > + } > > + > > + if (mHaveDbcn) { > > + UINT8 Buffer; > > + SBI_RET Ret; > > + > > + Ret =3D SbiCall ( > > + SBI_EXT_DBCN, > > + SBI_EXT_DBCN_READ, > > + 3, > > + 1, > > + ((UINTN)&Buffer), > > + 0 > > + ); > > + if ((TranslateError (Ret.Error) =3D=3D EFI_SUCCESS) && > > + (Ret.Value =3D=3D 1)) > > + { > > + mLastGetChar =3D Buffer; > > + } > > + } else if (mHaveLegacyGetchar) { > > + mLastGetChar =3D (INT64)SbiCall (SBI_EXT_0_1_CONSOLE_GETCHAR, 0, > > + 0).Error; } > > + > > + return mLastGetChar >=3D 0; > > +} > > + > > +/** > > + Sets the control bits on a serial device. > > + > > + @param Control Sets the bits of Control that are sett= able. > > + > > + @retval RETURN_SUCCESS The new control bits were set on the > serial device. > > + @retval RETURN_UNSUPPORTED The serial device does not support > this operation. > > + @retval RETURN_DEVICE_ERROR The serial device is not functioning > correctly. > > + > > +**/ > > +RETURN_STATUS > > +EFIAPI > > +SerialPortSetControl ( > > + IN UINT32 Control > > + ) > > +{ > > + return RETURN_SUCCESS; > > +} > > + > > +/** > > + Retrieve the status of the control bits on a serial device. > > + > > + @param Control A pointer to return the current contro= l signals > from the serial device. > > + > > + @retval RETURN_SUCCESS The control bits were read from the se= rial > device. > > + @retval RETURN_UNSUPPORTED The serial device does not support > this operation. > > + @retval RETURN_DEVICE_ERROR The serial device is not functioning > correctly. > > + > > +**/ > > +RETURN_STATUS > > +EFIAPI > > +SerialPortGetControl ( > > + OUT UINT32 *Control > > + ) > > +{ > > + *Control =3D 0; > > + return RETURN_SUCCESS; > > +} > > + > > +/** > > + Sets the baud rate, receive FIFO depth, transmit/receice time out, > > +parity, > > + data bits, and stop bits on a serial device. > > + > > + @param BaudRate The requested baud rate. A BaudRate value = of 0 > will use the > > + device's default interface speed. > > + On output, the value actually set. > > + @param ReveiveFifoDepth The requested depth of the FIFO on the > receive side of the > > + serial interface. A ReceiveFifoDepth value= of 0 will use > > + the device's default FIFO depth. > > + On output, the value actually set. > > + @param Timeout The requested time out for a single charac= ter in > microseconds. > > + This timeout applies to both the transmit = and receive side > of the > > + interface. A Timeout value of 0 will use t= he device's > default time > > + out value. > > + On output, the value actually set. > > + @param Parity The type of parity to use on this serial d= evice. A > Parity value of > > + DefaultParity will use the device's defaul= t parity value. > > + On output, the value actually set. > > + @param DataBits The number of data bits to use on the seri= al > device. A DataBits > > + vaule of 0 will use the device's default d= ata bit setting. > > + On output, the value actually set. > > + @param StopBits The number of stop bits to use on this ser= ial > device. A StopBits > > + value of DefaultStopBits will use the devi= ce's default > number of > > + stop bits. > > + On output, the value actually set. > > + > > + @retval RETURN_SUCCESS The new attributes were set on the > serial device. > > + @retval RETURN_UNSUPPORTED The serial device does not support > this operation. > > + @retval RETURN_INVALID_PARAMETER One or more of the attributes > has an unsupported value. > > + @retval RETURN_DEVICE_ERROR The serial device is not functioni= ng > correctly. > > + > > +**/ > > +RETURN_STATUS > > +EFIAPI > > +SerialPortSetAttributes ( > > + IN OUT UINT64 *BaudRate, > > + IN OUT UINT32 *ReceiveFifoDepth, > > + IN OUT UINT32 *Timeout, > > + IN OUT EFI_PARITY_TYPE *Parity, > > + IN OUT UINT8 *DataBits, > > + IN OUT EFI_STOP_BITS_TYPE *StopBits > > + ) > > +{ > > + return RETURN_SUCCESS; > > +} > > diff --git a/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/Common.c > > b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/Common.c > > new file mode 100644 > > index 000000000000..4926ac675b62 > > --- /dev/null > > +++ b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/Common.c > > @@ -0,0 +1,132 @@ > > +/** @file > > + Serial Port Library backed by SBI console. > > + > > + Common functionality shared by PrePiDxeSerialPortLibRiscVSbi and > > + PrePiDxeSerialPortLibRiscVSbiRam implementations. > > + > > + Copyright (c) 2023, Intel Corporation. All rights reserved.
> > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > + > > +#include "Common.h" > > + > > +/** > > + Return whether the DBCN extension is implemented. > > + > > + @retval TRUE Extension is implemented. > > + @retval FALSE Extension is not implemented. > > + > > +**/ > > +BOOLEAN > > +SbiImplementsDbcn ( > > + VOID > > + ) > > +{ > > + SBI_RET Ret; > > + > > + Ret =3D SbiCall (SBI_EXT_BASE, SBI_EXT_BASE_PROBE_EXT, 1, > > + SBI_EXT_DBCN); if ((TranslateError (Ret.Error) =3D=3D EFI_SUCCESS) &= & > > + (Ret.Value !=3D 0)) > > + { > > + return TRUE; > > + } > > + > > + return FALSE; > > +} > > + > > +/** > > + Return whether the legacy console putchar extension is implemented. > > + > > + @retval TRUE Extension is implemented. > > + @retval FALSE Extension is not implemented. > > + > > +**/ > > +BOOLEAN > > +SbiImplementsLegacyPutchar ( > > + VOID > > + ) > > +{ > > + SBI_RET Ret; > > + > > + Ret =3D SbiCall (SBI_EXT_BASE, SBI_EXT_BASE_PROBE_EXT, 1, > > + SBI_EXT_0_1_CONSOLE_PUTCHAR); if ((TranslateError (Ret.Error) =3D=3D > EFI_SUCCESS) && > > + (Ret.Value !=3D 0)) > > + { > > + return TRUE; > > + } > > + > > + return FALSE; > > +} > > + > > +/** > > + Write data from buffer to console via SBI legacy putchar extension. > > + > > + The number of bytes actually written to the SBI console is returned. > > + If the return value is less than NumberOfBytes, then the write opera= tion > failed. > > + > > + @param Buffer The pointer to the data buffer to be writte= n. > > + @param NumberOfBytes The number of bytes to written to the seria= l > device. > > + > > + @retval >=3D0 The number of bytes written to the serial= device. > > + If this value is less than NumberOfBytes, t= hen the > > + write operation failed. > > + > > +**/ > > +UINTN > > +SbiLegacyPutchar ( > > + IN UINT8 *Buffer, > > + IN UINTN NumberOfBytes > > + ) > > +{ > > + SBI_RET Ret; > > + UINTN Index; > > + > > + for (Index =3D 0; Index < NumberOfBytes; Index++) { > > + Ret =3D SbiCall (SBI_EXT_0_1_CONSOLE_PUTCHAR, 0, 1, Buffer[Index]= ); > > + if ((INT64)Ret.Error < 0) { > > + break; > > + } > > + } > > + > > + return Index; > > +} > > + > > +/** > > + Write data from buffer to console via SBI DBCN. > > + > > + The number of bytes actually written to the SBI console is returned. > > + If the return value is less than NumberOfBytes, then the write opera= tion > failed. > > + > > + @param Buffer The pointer to the data buffer to be writte= n. > > + @param NumberOfBytes The number of bytes to written to the seria= l > device. > > + > > + @retval >=3D0 The number of bytes written to the serial= device. > > + If this value is less than NumberOfBytes, t= hen the > > + write operation failed. > > + > > +**/ > > +UINTN > > +SbiDbcnWrite ( > > + IN UINT8 *Buffer, > > + IN UINTN NumberOfBytes > > + ) > > +{ > > + SBI_RET Ret; > > + > > + Ret =3D SbiCall ( > > + SBI_EXT_DBCN, > > + SBI_EXT_DBCN_WRITE, > > + 3, > > + NumberOfBytes, > > + ((UINTN)Buffer), > > + 0 > > + ); > > + > > + /* > > + * May do partial writes. Don't bother decoding > > + * Ret.Error as we're only interested in number of > > + * bytes written to console. > > + */ > > + return Ret.Value; > > +} > > diff --git > > a/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSb > > iLib.uni > > b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSb > > iLib.uni > > new file mode 100644 > > index 000000000000..7b22caa5a090 > > --- /dev/null > > +++ b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRis > > +++ cVSbiLib.uni > > @@ -0,0 +1,16 @@ > > +// /** @file > > +// Serial Port Library backed by SBI console. > > +// > > +// Serial Port Library backed by SBI console. > Duplicate sentence. >=20 >=20 >=20 >=20 >=20