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.web12.576.1572229931601003230 for ; Sun, 27 Oct 2019 19:32:11 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=02044412f4=abner.chang@hpe.com) Received: from pps.filterd (m0148664.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9S2VhD1008609; Mon, 28 Oct 2019 02:32:11 GMT Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0b-002e3701.pphosted.com with ESMTP id 2vvd90rx08-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Oct 2019 02:32:10 +0000 Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id 2F22D55; Mon, 28 Oct 2019 02:32:10 +0000 (UTC) Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id CDCCC49; Mon, 28 Oct 2019 02:32:08 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Leif Lindholm , Gilbert Chen Subject: [edk2-staging/RISC-V-V2 PATCH v3 30/39] RiscVPlatformPkg/OpensbiPlatformLibNull: NULL instance of RiscVOpensbiPlatformLib Date: Mon, 28 Oct 2019 09:59:08 +0800 Message-Id: <1572227957-13169-31-git-send-email-abner.chang@hpe.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1572227957-13169-1-git-send-email-abner.chang@hpe.com> References: <1572227957-13169-1-git-send-email-abner.chang@hpe.com> X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-27_09:2019-10-25,2019-10-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 malwarescore=0 spamscore=0 suspectscore=1 priorityscore=1501 mlxscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1910280025 NULL instance of RiscVOpensbiPlatformLib. Signed-off-by: Abner Chang Cc: Leif Lindholm Cc: Gilbert Chen --- .../OpensbiPlatformLibNull.inf | 38 +++++++++++++++++++ .../Library/OpensbiPlatformLibNull/Platform.c | 44 ++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 RiscVPlatformPkg/Library/OpensbiPlatformLibNull/OpensbiPlatformLibNull.inf create mode 100644 RiscVPlatformPkg/Library/OpensbiPlatformLibNull/Platform.c diff --git a/RiscVPlatformPkg/Library/OpensbiPlatformLibNull/OpensbiPlatformLibNull.inf b/RiscVPlatformPkg/Library/OpensbiPlatformLibNull/OpensbiPlatformLibNull.inf new file mode 100644 index 0000000..cdc5f65 --- /dev/null +++ b/RiscVPlatformPkg/Library/OpensbiPlatformLibNull/OpensbiPlatformLibNull.inf @@ -0,0 +1,38 @@ +## @file +# RISC-V OpenSbi Platform NULL Library +# +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x0001001b + BASE_NAME = RiscVOpensbiPlatformLibNull + FILE_GUID = 9424ED54-EBDA-4FB5-8FF6-8291B07BB151 + MODULE_TYPE = SEC + VERSION_STRING = 1.0 + LIBRARY_CLASS = RiscVOpensbiPlatformLib + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = RISCV64 +# + +[Sources] + Platform.c + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + RiscVPkg/RiscVPkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + DebugAgentLib + + diff --git a/RiscVPlatformPkg/Library/OpensbiPlatformLibNull/Platform.c b/RiscVPlatformPkg/Library/OpensbiPlatformLibNull/Platform.c new file mode 100644 index 0000000..e78d811 --- /dev/null +++ b/RiscVPlatformPkg/Library/OpensbiPlatformLibNull/Platform.c @@ -0,0 +1,44 @@ +/* + * + * Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.
+ * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Western Digital Corporation or its affiliates. + * + * Authors: + * Atish Patra + */ + +#include +#include + +const struct sbi_platform_operations platform_ops = { + .pmp_region_count = NULL, + .pmp_region_info = NULL, + .final_init = NULL, + .console_putc = NULL, + .console_getc = NULL, + .console_init = NULL, + .irqchip_init = NULL, + .ipi_send = NULL, + .ipi_clear = NULL, + .ipi_init = NULL, + .timer_value = NULL, + .timer_event_stop = NULL, + .timer_event_start = NULL, + .timer_init = NULL, + .system_reboot = NULL, + .system_shutdown = NULL +}; + +const struct sbi_platform platform = { + .opensbi_version = OPENSBI_VERSION, // The OpenSBI version this platform table is built bassed on. + .platform_version = SBI_PLATFORM_VERSION(0x0000, 0x0000), // SBI Platform version 1.0 + .name = "NULL platform", + .features = 0, + .hart_count = 0, + .hart_stack_size = 0, + .disabled_hart_mask = 0, + .platform_ops_addr = 0 +}; -- 2.7.4