From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.2109.1680903908685764456 for ; Fri, 07 Apr 2023 14:45:09 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=mHc8BfVc; spf=pass (domain: intel.com, ip: 192.55.52.115, 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=1680903908; x=1712439908; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=i9loG3tyzOS1ghOnIR5vYDDaAys+XXnYc99ADRWY+24=; b=mHc8BfVcQDkL8LeSR+ZH74+yvYraYGIYHQZdxdJjnFIxADyT/E+NQyQZ REOsRpNwitkYmE7kFMtgQBtEFjrVgPqgn7YLasMgZyhgxXlHeNbhMiP7w hyaH0rVJ+5gdb+5JxMieaAMjy8M1DyFoX84UMjPHiJ5vUF70SKMDo9bW3 oGRP4Yr24wkq33qFV1EXaiO0+TbjSLXOG+0h1qgpNyo7PrzZoLUaD5AMq xOLTOEgQl+UjgaDypDRryaXmJIJ94qKGkMzJUoyOzvdCLa0kjOReKW5WF BUzdnV8z6cAgiWvVqcXpwJ+t7CWGoEmKHQXhOsRuUYhMRttwt9o4V46z9 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10673"; a="343081062" X-IronPort-AV: E=Sophos;i="5.98,328,1673942400"; d="scan'208";a="343081062" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2023 14:44:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10673"; a="717964748" X-IronPort-AV: E=Sophos;i="5.98,328,1673942400"; d="scan'208";a="717964748" Received: from jsilva4x-mobl.amr.corp.intel.com (HELO awarkent-mobl1.amr.corp.intel.com) ([10.212.106.145]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2023 14:44:33 -0700 From: "Andrei Warkentin" To: devel@edk2.groups.io Cc: Andrei Warkentin Subject: [PATCH v7 0/3] RISC-V SBI-backed SerialLib Date: Fri, 7 Apr 2023 16:44:22 -0500 Message-Id: <20230407214425.4360-1-andrei.warkentin@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hello, Here are three patches that provide a SerialLib backed by SBI console. Both legacy and DBCN mechanisms are supported in various execution environments and have been tested with UART and HTIF consoles. MdePkg reviewers: please review MdePkg.dsc changes. This is also available at https://github.com/andreiw/edk2-rv-wip/tree/patchset-2 A CI run is at https://github.com/tianocore/edk2/pull/4252 Compared to v6: - Unify the two SerialLib implementations under one directory and factor out the code somewhat. - Sunil's feedback on correctness. Compared to v5: Rename components as per Michael Kinney's suggestions. Compared to v4: (not sent out). CC MdePkg maintainers, fix copyright date in SecMain.c. Compared to v3 EccCheck fixes. Add MdePkg infs to DSC. Compared to v2: - Probes legacy extension as well. - Encode supported module types in the INF file. This is done using LIBRARY_CLASS, as MODULE_TYPE cannot encode multiple types, so MODULE_TYPE is retained as BASE. - Update INF version and generate brand new GUIDs instead of editing them. - Checked that all patches retain ^M endings. Andrei Warkentin (3): MdePkg: BaseRiscVSbiLib: make more useful to consumers MdePkg: add SBI-based SerialPortLib for RISC-V OvmfPkg: RiscVVirt: Add missing SerialPortInitialize to Sec MdePkg/MdePkg.dsc | 2 + MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.inf | 40 +++ MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLibRam.inf | 37 +++ OvmfPkg/RiscVVirt/Sec/SecMain.inf | 1 + MdePkg/Include/Library/BaseRiscVSbiLib.h | 40 ++- MdePkg/Library/BaseSerialPortLibRiscVSbiLib/Common.h | 41 +++ OvmfPkg/RiscVVirt/Sec/SecMain.h | 1 + MdePkg/Library/BaseRiscVSbiLib/BaseRiscVSbiLib.c | 3 +- MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.c | 208 ++++++++++++++ MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLibRam.c | 289 ++++++++++++++++++++ MdePkg/Library/BaseSerialPortLibRiscVSbiLib/Common.c | 132 +++++++++ OvmfPkg/RiscVVirt/Sec/SecMain.c | 4 +- MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.uni | 16 ++ 13 files changed, 808 insertions(+), 6 deletions(-) create mode 100644 MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.inf create mode 100644 MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLibRam.inf create mode 100644 MdePkg/Library/BaseSerialPortLibRiscVSbiLib/Common.h create mode 100644 MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.c create mode 100644 MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLibRam.c create mode 100644 MdePkg/Library/BaseSerialPortLibRiscVSbiLib/Common.c create mode 100644 MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.uni -- 2.25.1