From patchwork Wed Nov 25 05:16:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1405882 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=MudgtRQO; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=SSBNM1re; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-sharedspace-onmicrosoft-com header.b=c8vTohIM; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cgpzw5Ry9z9sRK for ; Wed, 25 Nov 2020 16:17:32 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=38xLTjpvTz3crhFCXOytJvV1dnJuLz9y6qTuP67zHNQ=; b=MudgtRQOI6pLOGqPighw5sfls SDlY/IEGVwouNuI6bo2ameCABnAUCoS273vUd4YUzqj57iEhMHKKKzWrJGhedwEVH7rtKbd233mBh dtXQyC0+CacaWudUejOgV4qqKFdFhJFShUVrwTWC9LfkEk3vSZNSq8HwA8QDqn9RtC97y2OueEf2w CTrYIlKq2DBlcMlsqVzBpMMQTpST5cRJqqFDc4lt0b3PDGr5ZXv7ogDAmLvzpTwN1PjoTUP3lTIvp sIsApdYG/W/9foszrcCfkef2C+TllAFX4cfpTgxJtyzfZ3HdLVfqZ+QqCuA6++tONZlhGrz2gigF1 7pOD4IcQg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khnBA-0004gJ-HG; Wed, 25 Nov 2020 05:17:20 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khnB7-0004f9-FW for opensbi@lists.infradead.org; Wed, 25 Nov 2020 05:17:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1606281437; x=1637817437; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=vQQIpo2Y03Xdqqq0Q7dSpIMZp1zCqHDfZ3rwpV3rAhs=; b=SSBNM1re52wQ+S1mf9XN5m6lyYomegeQquk3U/Cdl+Sfqm5bYXgGBsV4 5pSeAnmyhRPHT7NXIZPwVKoXsvxtUqmH3L5RIGgPmfha1eeU9S5nF+RlP DfP3poDilWxGAMEoaITMYwVfIKRjqewWpzI55NHuPmcFRCnQZBxM1NQkF w+DWS7FqiNkYPbDG3EFhZPQZGRaT3vs+Oh4qul3Q3uxtsxj++VYOcSlMG UYYJgbsP5Sc0dQcW4Xd8rVlJzbPqU2ykJXwiSBOW3j46eUUGlvbLvMSz4 si6znb7hmXumJ7UDgrmRWi1QeX0qqfL7v8YOaQscP2QNftb6vXXly6Wfp w==; IronPort-SDR: z9ZjTxwTXtZbLAtFbaVmxAJVA5bHHnzkXAe11kpTEX5krGM8ewAomXuieRQd+s2xXukeeBDXXt CzsAAYF3TSrR3ciEKaa+dfCBmzyXukEK+rJ+toHi3UaCZ155dTj89WXEN9exQi8GiGDRosELGo n6h6HuuCu3X4W1xdIzIaPPCoC54lODESxItv0q+OXDZ01htpLDZkErFc1kvdkQor6h7EfOILK4 4o24fJq3NSLt1OuSCA+xe1pSex1SZYeaiq6oRLbrBqYOpEOUh4BhF/lZz3aeMD+F1eGb+Uzdsw gJ4= X-IronPort-AV: E=Sophos;i="5.78,368,1599494400"; d="scan'208";a="263496198" Received: from mail-co1nam11lp2175.outbound.protection.outlook.com (HELO NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.175]) by ob1.hgst.iphmx.com with ESMTP; 25 Nov 2020 13:17:14 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=deri1bPoOTHQ35/ZFzivT+vSaCOZy9bTTIW2T20BBO6lqZtxTHCum+RLOVRWKDWfT7OEzHQww9lcxOAqNFqZyTZKUkSmzV4zlOzz5lIfMR0f2Fw17Up3VnwrNAUvQFN0gE7VBVPRPp0f8uHWzKIF0PdjLVKVlXFCieTEkoaeH5IWkQaC9zTX5sR/bn5DjCqfbTiKlcdkuJBKUciGhDCYbU3GQLZxbAWR0Lc1bxinQEfSXYGSi5ZUCn38caEWXUqKu79MpgqaXeCHR+OoSscFenuH0JVGCwKyWlRh3blnqnNdAtWVfpQmg6aXhtXKPQK9PeNK39F9UHSENDtqG1Newg== 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=CUNZMJ6bOJZ0kDJrvEn6TgJ0tS+KLTXjM7r6s/2pHQE=; b=SLXlU0QMzBWYkfAMjhrZqGEMcvd38He5ar5CuriXl3c/WtqBq3PAdiwU88StIB/hawB4a4zrbb4yir1ELdSqYkIugptNMRSe6gJRW9k3ogIRfKBULBXgIdWUPw+X1VH/+KIdu1p+1u1fnwmWupFDEQFQDRxLJHJ5Q0pww5hlaXQvrQtwpbTbYL2FUtL+OUmTI/auSmOdN8Gu/ZYV4IKe9Euka/B/ZNNoNBHxLSSOTB+3n8xTABDKGCRYpKr+uqli3y1ttzKB6vN4mRSvVu6RZPlhxoyYSnjV/zKLXr9GbvNaOF7t2TG4wRV+x1EQaDusOnzccdQeQLpbdw9fPDlzyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CUNZMJ6bOJZ0kDJrvEn6TgJ0tS+KLTXjM7r6s/2pHQE=; b=c8vTohIMUamqFuMX2lx0LL0WslGejxVbwrCzwQkUYH0Y3nTT6BU5q2N7r569zMp9JYCYMC2Tk2clIlfRY06f37MBDs01L7gyOn1FLI5BKM3hfN7+ddUigJfZE+9CxGNfmxOBEfuKkG0yJpNhJsBvIBKwFxF04XwUh4My1uSIPJw= Authentication-Results: wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=none action=none header.from=wdc.com; Received: from DM6PR04MB6201.namprd04.prod.outlook.com (2603:10b6:5:127::32) by DM6PR04MB5131.namprd04.prod.outlook.com (2603:10b6:5:fe::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20; Wed, 25 Nov 2020 05:17:13 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Wed, 25 Nov 2020 05:17:13 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH v3 1/5] include: sbi: Add SBI SRST extension related defines Date: Wed, 25 Nov 2020 10:46:43 +0530 Message-Id: <20201125051647.295472-2-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201125051647.295472-1-anup.patel@wdc.com> References: <20201125051647.295472-1-anup.patel@wdc.com> X-Originating-IP: [122.182.227.30] X-ClientProxiedBy: MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) To DM6PR04MB6201.namprd04.prod.outlook.com (2603:10b6:5:127::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.182.227.30) by MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20 via Frontend Transport; Wed, 25 Nov 2020 05:17:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 68e43cb2-1857-4483-ab38-08d891015de4 X-MS-TrafficTypeDiagnostic: DM6PR04MB5131: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:741; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fDPE420j3Gf0B9X5q6Ms7zt2wLtFe+1Tevk7PngeMpB8abQBCQ573DAsQ+3vWvKwyLRAVZ4UiPLvKr3r6IW5l2TghCCp+uyciLgCP6iph++RjhaPPsJTKESNuE6yvslU3GMF/ynF+vJq32ASY8RK3BZSWXqFePQ0LhvLHgUTYuzR2cUgEribLR2ycqoObyY3CpxFhRXV/Al+BYTJJpr3Raur02je+ceDnzc2OuLRim7I4ZMcUJ/sa3ZVKNQpto8o0q7BWwgMMV6WFXL/bsUvMTXrdGTt/zZLQ69VNffRg7GoHLprWoTMMiBfzvPmFzTF X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR04MB6201.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(396003)(39860400002)(376002)(366004)(7696005)(52116002)(16526019)(36756003)(186003)(83380400001)(2616005)(44832011)(5660300002)(110136005)(2906002)(6666004)(54906003)(4326008)(956004)(316002)(8936002)(8676002)(55016002)(478600001)(26005)(1076003)(86362001)(66946007)(66556008)(66476007)(6636002)(8886007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: ve39p6pqoI2mA0/FqRY1OfltW0wOq2MnWw1cJRtXORXbj8LOND96nlPDm6m1AW2xybtrEF77nM3iR4yyL49OEMEJFbG9TAIkwI8/u37YZnwvDr6/kWVrOGu74PP793+68mjCRnipjpw5yRI0yiGUogIFwz3e1AteEFknqmpZazi96AOBicLpYDcu6P6aBHt1pKccj41ZjUkxHPX2au8Zb+8TwVe7Q02k5MsdxBFXpjlVWCTURLkxIXCvKvbVEYXJxTDjzHdM1ejrlnj8n3wyBgh0lmP6HSeom0rOE6r4cc7zvYBsfJu6nm6TKNy4YUU2mxa+MiaOaXO400PX1PQuJdecUerPmfJfmreXGuh/BkzrGevZ9UBuosTWaB/DU0q3RwqE6Q2VQAWh4Lofle5C+2wmDgBdzfSRMApkLZ72MlOko0tJRmg9/LucJJfBiKZqOLL1wxflohWD7JLGw+VXZ89NA1kBEqCmDwmeF4EUz8zoey395VYmlRN6QTXGfYTx098GaEBHWXLD2CohkWldsZ9tKHjr2PrWN63+isfQTrnEwTYaZE8nUmDzzvcTlHXm5I9aTtrVpUA/Mo7kDVCt4rE4Rv1RVGG7tTvlAVaR3L5URduwuGvk9e2HKW4QxJcmI+9283n9wMXcZoEaHZ2kXMrz90p7Ux76P+KQ4ipfwgV2Sk9x3+CLD/57D985fXF847uNXEPsCK7FbjmD2N/ooKR0Lk9R+NAm+blX8qF5c9T+dfOcbiQPmio/WwO9MYOAvxu2zbMnz0eB1aQlHTU1r/jauMyhywdpL4umTIOTAvqm38/YyeI76KBcQe671BM8reaVl+eYGaeCkU5r7HjOK1f+sBH/FrV9n41HwCnCYQcGIb+vg+qCi35iaTvKZVvmiaVZ7enyOyanRNkiDXg+SQ== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68e43cb2-1857-4483-ab38-08d891015de4 X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2020 05:17:13.3214 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7I15uHQIwlshEaBa5xzKXJ8gEoOMI+d/XziwZdCpwhNGAwbJQHHHRSGA5kHORRNhGnv4aGZRYcWWme7lxYM7HA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB5131 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201125_001717_839280_88721560 X-CRM114-Status: GOOD ( 13.33 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [68.232.141.245 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org We extend the SBI ecall interface header for the SBI SRST extension recently accepted in SBI specification v0.3-draft. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Reviewed-by: Atish Patra --- include/sbi/sbi_ecall_interface.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h index af30500..002c6f9 100644 --- a/include/sbi/sbi_ecall_interface.h +++ b/include/sbi/sbi_ecall_interface.h @@ -27,6 +27,7 @@ #define SBI_EXT_IPI 0x735049 #define SBI_EXT_RFENCE 0x52464E43 #define SBI_EXT_HSM 0x48534D +#define SBI_EXT_SRST 0x53525354 /* SBI function IDs for BASE extension*/ #define SBI_EXT_BASE_GET_SPEC_VERSION 0x0 @@ -62,6 +63,17 @@ #define SBI_HSM_HART_STATUS_START_PENDING 0x2 #define SBI_HSM_HART_STATUS_STOP_PENDING 0x3 +/* SBI function IDs for SRST extension */ +#define SBI_EXT_SRST_RESET 0x0 + +#define SBI_SRST_RESET_TYPE_SHUTDOWN 0x0 +#define SBI_SRST_RESET_TYPE_COLD_REBOOT 0x1 +#define SBI_SRST_RESET_TYPE_WARM_REBOOT 0x2 +#define SBI_SRST_RESET_TYPE_LAST SBI_SRST_RESET_TYPE_WARM_REBOOT + +#define SBI_SRST_RESET_REASON_NONE 0x0 +#define SBI_SRST_RESET_REASON_SYSFAIL 0x1 + #define SBI_SPEC_VERSION_MAJOR_OFFSET 24 #define SBI_SPEC_VERSION_MAJOR_MASK 0x7f #define SBI_SPEC_VERSION_MINOR_MASK 0xffffff From patchwork Wed Nov 25 05:16:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1405881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=IOnTnfwW; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=AjSubrI8; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-sharedspace-onmicrosoft-com header.b=SKKmj14l; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cgpzw34scz9sTL for ; Wed, 25 Nov 2020 16:17:32 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UYDOuUiUY6xGiXfnO2vscRvrQixUGnH2ZgvFtwxXZo8=; b=IOnTnfwWqg7cnH9vnF/nx5hed TYxkYIWFViLSoCqGFU3U1AOFYCQmdZ+iM8posqyqwj+6Gr0PlxM1t8mUas2Lzi41+8+W4NLGOu5YH KKEQPuNnt+v0iHvxG48DQpwt8kNooyiGS3i6tTvhIyWa78i5zejcQF1137BeLEjlDxRQveaA6TO++ RyYw+qesrpzJI/T8EajaIhtmKGVhsP67Nod5YtOlG8+1U6cgMw8PBQz3nLu12AiBJ81+Lbf0sQkOu m+w8/VgDUAIpaJ5uhv4NX1Y5DaNxOo9v0FAdBsO7dCEa4tTrmhVEksMQ6oVuZYV3Bxo3LX0NyobuR F+lo9ewJw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khnBC-0004gr-6D; Wed, 25 Nov 2020 05:17:22 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khnB9-0004f2-J8 for opensbi@lists.infradead.org; Wed, 25 Nov 2020 05:17:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1606281439; x=1637817439; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=jmyNJMx3b0qoi1XdnstGprhMQSZ3J6weKUBCl2uGZl0=; b=AjSubrI88sHTr98g84pLdlY4qZig6w7sOnhkijBgKBLrCcvdFd7OZRkO wffuc/0+0WdP/cM00qDuYIvXwTPbdpXeAhF5ePkpoG44ufHpGDdf9q48j re5DAzW8/r21u49RDgWnkWwNvkJnkKlDwk0thW3jZUQM5o+9/W3ell+xt ALAT/tvvcDc9UNIu4i9UUjJkS4LriVosIYLXcppbtZaJMyjSY86T6yLPj QfS0O/ez2Tq9B4fHpYHaHISIB6cfCAF0w714R3gBzu1L0VT+ZGCwN2G5X WWOmA3hyAgk1frDq4E55rnyzjoAKlKsNi1X9ThiGfZhM7wKayA4yXOvr7 w==; IronPort-SDR: 8orGLV9nW8U9FTKTOvAukATLC1fGl6NnWgCyFnFqsw6EmRXKBI7/wXxmQJi4ZxPjSsF4HP4m6j 0XAKnoLAj5ezE41UTHMHjLdRn6A3bHTggGr/qWEivrsAQ9miSCz+zxPeHpD3oN1V2V6ZPrr6wl gni2FuMhABv47eLg6DuPdImd/eYtG6CObqZP2S3NjOm0354/T/vuT9h3LBfxpezG3lsSrIaBfJ Jy9HCRgSjaLzp+rTXEaZenfJnY8QV6S4mXhqpR5LjaUZlwT71f6qUVg3RFNH+YKySO90c+5V5m a5o= X-IronPort-AV: E=Sophos;i="5.78,368,1599494400"; d="scan'208";a="263496202" Received: from mail-co1nam11lp2169.outbound.protection.outlook.com (HELO NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.169]) by ob1.hgst.iphmx.com with ESMTP; 25 Nov 2020 13:17:16 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lRo/gIY8OozhxQy/Xjsudc4wHoZWTUhNvOr4nlvTH8k+FJ8/p83bSCmV5vuQI2UalExLY1MdPAX8508gfD0DOBpMQlshu6Vu0mBj7rBYVZpcewJGRBHdjgUS/ktdDVwSpgSqEzq1Kt1Yk1O9HakXeP66WSNMRGOMM0lpNpO1A8VI2ELykqi0h1brHR+U++fDGNRbVJw4xY0fDPLEOJfLdu0c0qx6nnzt9E4LClk1TV5XpqxUEUtMHHHsBlQFHMKA+/3+mTtlCco2BVVXiyrVYh6huB1wlsCQHglPKRWsSU8dYlOHLCsvsmzLh2Bh9bgBMESQZZ1futTar5Wk6xtP2A== 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=kdA2nA44p68XvRSsXZgU83MkfM+pdmtHyqXOECX4cOk=; b=aKxgDElS9+SuZ3NbFNFgOHNEAT6iuZNYJDhyP9xBPxdh625FJpYeRQ3UB+9kHq7xzD7kx+m58KoDFO/w2NrWn8D7v6jg6ce8UETIAqTjMcQq4AYJ4CXT1W8GgOYn4G1s5bkFtEtgdumSYkn7r2+TO+o8utnpzGl9gNbuvkQNnDxF79F34wUeg6wUGKuyeVkH8hkPaOobDfzsjpGUNoIBUjPfKIIfUvKTgIIbpUXUVHdXcLyfOHHZ/V6S5riUDOO8Z/TxBxEI8HFxcWcUQ6Z0Zj0gV5tSS/HRhwWaQV2lDpXFuop6g7C+C/Fb24g3i6vLipZVwHC2tvn0hrrixcRH7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kdA2nA44p68XvRSsXZgU83MkfM+pdmtHyqXOECX4cOk=; b=SKKmj14lraB9sXBq3NbHiDhu2+8O1ttCPPlF25mkPnHcs0Dt8tirnpzcKjq/RpPfHlcLcC9rFA9br0eoxXuG4dtjoEnsYPn7PiSqjwW1USI2q8Y6hvaM1wuvx8FcQ1WUXuwA3q+RVVxoaa056R1MK6xyqOlyb+uW/6mzutNo6i4= Authentication-Results: wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=none action=none header.from=wdc.com; Received: from DM6PR04MB6201.namprd04.prod.outlook.com (2603:10b6:5:127::32) by DM6PR04MB5131.namprd04.prod.outlook.com (2603:10b6:5:fe::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20; Wed, 25 Nov 2020 05:17:15 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Wed, 25 Nov 2020 05:17:15 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH v3 2/5] include: sbi: Remove opensbi specific reset type defines Date: Wed, 25 Nov 2020 10:46:44 +0530 Message-Id: <20201125051647.295472-3-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201125051647.295472-1-anup.patel@wdc.com> References: <20201125051647.295472-1-anup.patel@wdc.com> X-Originating-IP: [122.182.227.30] X-ClientProxiedBy: MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) To DM6PR04MB6201.namprd04.prod.outlook.com (2603:10b6:5:127::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.182.227.30) by MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20 via Frontend Transport; Wed, 25 Nov 2020 05:17:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b18af7fb-8f48-48ae-8ce3-08d891015f6e X-MS-TrafficTypeDiagnostic: DM6PR04MB5131: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fiytUZQLAYeheXXPIRjb3aeu1ynYmB0olo2seX7XY4eKntuKO+Lnpn5b/Ci17cNTb+TRL1jgt/TC+OuEfAq/nYIS3nnbHYe4r9PfqE/PR9y//o+Ng1zqE+wQ+dsHRb3rX+4V40LZB8enngnFl9vGLgbxYPvliPKXI0kGI7vUI+VYBeIPQI3JX404NTP9+0QGpTGl/hQr4kk8udMRrZLw5dqeJ3gDW822TI5MYBPMJ4UxGwJziKAHt6cx8liY1oDyPiDCF+hisS+5GRSl7tXtjKAGD8nj4SRo/02fnOF8vRtA6HtZR4Y93/4WdYfgp7jK X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR04MB6201.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(396003)(39860400002)(376002)(366004)(7696005)(52116002)(16526019)(36756003)(186003)(83380400001)(2616005)(44832011)(5660300002)(110136005)(2906002)(6666004)(54906003)(4326008)(956004)(316002)(8936002)(8676002)(55016002)(478600001)(26005)(1076003)(86362001)(66946007)(66556008)(66476007)(6636002)(8886007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: gwDSl/6adfOsw0f+OV7rroZPtOLzFP4+TNU4HC/3tBJc2zs+ur30sjqUIQ+WGyYCpOPTSKbMSxJrBsWyKFhCRXR/hkqL5u9GdsuaPdzvETzojk4Q3nA/EVZ20PBrgBPvngaihw5VelRLKla9AdHtYPma+JUcIZy/yosQZe6E2W/iv6xmQZeUlhvopZJVKHgMXpCraamOKXSOkVUQNGqF0yI6Qpg83E/WXrZngtW1CzwXIq6WMXvmJRcJEeFNlYHhMmwhB3IbykL2XXVdHpLS9Sj/GxJr/PsKdCvkvi2NN/odfwJhnCIYjf5ontTGwGVUlaHfbAYyGkHU4mhtCNAS8ILL9b+8TSPMeziLipPnFAXLKYv+1V71XzsbvP00Y/c7PJOg+brAaNBtb5cG70ALDlHCFn3QlGTD3d+KcDnXu2gxOlEF1XniFclZ6ZXyan0U9Lzu9cz5Qz40QtcasSB+f8HIQNOZbrP5Lie17laZghqAIlxF5GSgf0I4ErNeB1zu26K1fcLzsbnQzEoDR81QtGvRisZxvAf3tmBcibKyr6iWTbeFlAw2bn9NXq5NdExtSCL5WnOLmSZAHDQs83yXDjg4eBq9+fX2fVlzuSk1Cl1jwul65cVbSmHid0bYDeeInlBadhsiuwf61XEek1pCloph+dhG+K069SVWRP15cYDybyUC/4YpfhufoDpoz/nXZvdBNHJM/aCmNOItYO1T1bysvU7UBrPknabyeZo73mgsKW9i9ppUo0UFG/59CzauaexNFvSYn8evbV8AbO78Sor7kZN26Wg+/PGvKT4JqTSOjldXH1qprUstFFArXSo/NKND3sPi/sgAw0n3/veyfYAwzmaOATnPOu4TSqrOrLhuIS04v8bE89OzvH5kpeBSnOJ6LRkVp/JBQHGjCPdGzA== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: b18af7fb-8f48-48ae-8ce3-08d891015f6e X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2020 05:17:15.6489 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZCzide6O8S7ye2yHfoMd/g2okEo3ZGYwo0gz/mu3TLSYFo4MChVaTdaHT1N9fN7TK/0a3PPSj8D5RH2+QTljRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB5131 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201125_001719_813994_69DD28E9 X-CRM114-Status: GOOD ( 17.71 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [68.232.141.245 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org We can now use the standard SBI SRST extension reset types instead of the opensbi specific (SBI_PLATFORM_RESET_xyz) reset types hence remove related opensbi specific defines. The "platform_" prefix of the reset type parameter of sbi_system_reset() function should also be removed. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Reviewed-by: Atish Patra --- include/sbi/sbi_platform.h | 4 +--- include/sbi/sbi_system.h | 2 +- lib/sbi/sbi_ecall_legacy.c | 2 +- lib/sbi/sbi_system.c | 4 ++-- lib/utils/sys/sifive_test.c | 6 +++--- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h index 7a8c113..3f4a733 100644 --- a/include/sbi/sbi_platform.h +++ b/include/sbi/sbi_platform.h @@ -40,6 +40,7 @@ #ifndef __ASSEMBLY__ +#include #include #include #include @@ -139,9 +140,6 @@ struct sbi_platform_operations { int (*hart_stop)(void); /** Reset the platform */ -#define SBI_PLATFORM_RESET_SHUTDOWN 0 -#define SBI_PLATFORM_RESET_COLD 1 -#define SBI_PLATFORM_RESET_WARM 2 int (*system_reset)(u32 reset_type); /** platform specific SBI extension implementation probe function */ diff --git a/include/sbi/sbi_system.h b/include/sbi/sbi_system.h index d44ef12..309e263 100644 --- a/include/sbi/sbi_system.h +++ b/include/sbi/sbi_system.h @@ -12,6 +12,6 @@ #include -void __noreturn sbi_system_reset(u32 platform_reset_type); +void __noreturn sbi_system_reset(u32 reset_type); #endif diff --git a/lib/sbi/sbi_ecall_legacy.c b/lib/sbi/sbi_ecall_legacy.c index 909cbe3..683b8dc 100644 --- a/lib/sbi/sbi_ecall_legacy.c +++ b/lib/sbi/sbi_ecall_legacy.c @@ -103,7 +103,7 @@ static int sbi_ecall_legacy_handler(unsigned long extid, unsigned long funcid, } break; case SBI_EXT_0_1_SHUTDOWN: - sbi_system_reset(SBI_PLATFORM_RESET_SHUTDOWN); + sbi_system_reset(SBI_SRST_RESET_TYPE_SHUTDOWN); break; default: ret = SBI_ENOTSUPP; diff --git a/lib/sbi/sbi_system.c b/lib/sbi/sbi_system.c index 96290b3..2f1b7fb 100644 --- a/lib/sbi/sbi_system.c +++ b/lib/sbi/sbi_system.c @@ -18,7 +18,7 @@ #include #include -void __noreturn sbi_system_reset(u32 platform_reset_type) +void __noreturn sbi_system_reset(u32 reset_type) { ulong hbase = 0, hmask; u32 cur_hartid = current_hartid(); @@ -40,7 +40,7 @@ void __noreturn sbi_system_reset(u32 platform_reset_type) /* Platform specific reset if domain allowed system reset */ if (dom->system_reset_allowed) sbi_platform_system_reset(sbi_platform_ptr(scratch), - platform_reset_type); + reset_type); /* If platform specific reset did not work then do sbi_exit() */ sbi_exit(scratch); diff --git a/lib/utils/sys/sifive_test.c b/lib/utils/sys/sifive_test.c index 15369da..06fbfb2 100644 --- a/lib/utils/sys/sifive_test.c +++ b/lib/utils/sys/sifive_test.c @@ -24,11 +24,11 @@ int sifive_test_system_reset(u32 type) * was successful so that QEMU exits */ switch (type) { - case SBI_PLATFORM_RESET_SHUTDOWN: + case SBI_SRST_RESET_TYPE_SHUTDOWN: writew(FINISHER_PASS, sifive_test_base); break; - case SBI_PLATFORM_RESET_COLD: - case SBI_PLATFORM_RESET_WARM: + case SBI_SRST_RESET_TYPE_COLD_REBOOT: + case SBI_SRST_RESET_TYPE_WARM_REBOOT: writew(FINISHER_RESET, sifive_test_base); break; } From patchwork Wed Nov 25 05:16:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1405879 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=xXbJFZ8P; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=adFtCsQ/; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-sharedspace-onmicrosoft-com header.b=I5miNcAq; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cgpzr0ZpSz9sTL for ; Wed, 25 Nov 2020 16:17:28 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/lg2Gc0yxOMWqUi1MWRnbi1dxi9j/tDDEXsvPfopte8=; b=xXbJFZ8PWPRkFH0c1fWkvqa9h Z5+n60YPM5ksbkBiQq7i2Gn7vgerYBwNnIoaOkqZWcX2g6w6vtT5+G/7cYzXwea3mSGYVrc/3jZ96 6mwhV+9qUryhPwDs1mbZphKhz2xF7SMb0CcDH69j6bl7emu0pMi3GEM9VSr8Pdw7ejVdOtjsnCt7a 5KBAIB5EL9PMpeRQVExjFKoNmJVqxsK98rJk7gGNz1QFuiEg77ZEG20poeUJQipvg9fAkO8PQBZxX JFywrODR+hApOhtHD2pETT1JkCFDdcog0TXRiOhLtXl3gDHn5SrWKG2g0alLBUJc/CfQlS5VqbkQp sa4WryB0A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khnBC-0004hF-T3; Wed, 25 Nov 2020 05:17:22 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khnB9-0004f9-Je for opensbi@lists.infradead.org; Wed, 25 Nov 2020 05:17:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1606281439; x=1637817439; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=HaL/Ro9HmYAD4O5av6Y9CB7uQTBsj+7p13GfHGLQd0c=; b=adFtCsQ/Z0/6A/w0Y+YBzRwNpx0ALPxaUOYM5Bz8RsMVUktfDQlfZtbi cZTI4VfA3r3YtwQtkcufr4F86xs2GyAIwMDbWCZKI4GCBnb1laKqRf+wP 82htwSi6ALtllskUdyPp+gL+U0gpgKAQInfgaDkdr4l1217oPL+ojILY4 4S8T80nAMxej2oRzXiA1if7af2YzT9AISDapbtSvwUjJ4ue72fg88i5n7 pawaasLpxWstDcJHHMx9QvtMU4FHArWyQTZg/0Q9QzBVfavsrDRO8xiRy gEe+PXreL/mzBbHe0dpLJoJpJ0X3cxsbbIrJTfA7BDHLccDJhBooHt+em w==; IronPort-SDR: KShbRixDfKIcrSp6sIvgh9IqMu8Zt4csgO+dyAsT/OXm8uFJhnH4jH9izH9MFdcY47Q3X959HD R+aKhaA6VwlKlmCmeKkOBpTcL8TZHmNDYaJa0/+t1Hqn773nVMAaDPDtkXs8NNPzunmwc9gV3r QJwhn8NFa/QaMvautf0zWZMQ1QemHf5N55+wzBhY3sSW5x1p2/X0yE4PdNAbUL/OACH/ogd7RC 3zp593Eva14Kp75Ic92Svzqvf3Kjq8gfKdT2u54g0TfhnipyupvZQRlASVKRbf47Ti2O1TQVhN fS4= X-IronPort-AV: E=Sophos;i="5.78,368,1599494400"; d="scan'208";a="263496206" Received: from mail-co1nam11lp2176.outbound.protection.outlook.com (HELO NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.176]) by ob1.hgst.iphmx.com with ESMTP; 25 Nov 2020 13:17:18 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=obMoVlJpG4yD+GN51n3WVF4R1oBtkK+ixwRaZVOkWu4z8DeXp31YSN0SvdI1XLa4HTil1PLpGc8U/yAatuLZkRZicBA2LX5NOUEpbxQ0DXDKPELtITbF9HUk+yqdLacH+3lIwVkSbDQ+IQZJmNbnYRqi6STGk93zZ9YUT9rdVD6yAhqVgL0vpgFJjXMRT26R7tT4P/NHZULcQYSpwMKFBgArjhCJeFRS4drY/sDo2nwg137A9JcmJbEvinoa8xRHPyMmsGYqAdxq6UIEVx7cX7NkmsaDecxd9BHqDaG39ffy+oI9htBB8torDUH07kOugKyDsx5OPNL2BUi7j7Wscg== 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=5VLM4vvMyigz5ElWOzp8fegT1+8xWx/zDPtHBmmftrw=; b=WxG1salqhWWnFqrTMIeOeHW4oAsaVNTU7jgnCMiDaoH/e4NBLRD1tr/4zikLsDOAkOmtYgi1FmcLO4woMK7dWqtT1UIJd+CP+gYEeZTN82emOEGNKZEobMxJwcef/QsKE+ZTX1w7FdqV/MOWrGorOKny3okvJnpue+PSWAYrnmFR/QEgVYKk4/MpKNPUFN7HOpF+KbVYIeEQ7L7sR2B3DTtdWeUfyOpBUmzmHrzsjZw2S1B46jU/O+pU66QWQkfnpv6pLDX+hY617zipyY2f8PN+/VGVZMwGymHiXur13RDmHNZVr7pDDHh4jg49k4+y2IeSxI4UpC7hHx8zQgr/oQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5VLM4vvMyigz5ElWOzp8fegT1+8xWx/zDPtHBmmftrw=; b=I5miNcAqkh7++wwV8EWlCzcAuRf+8JKn5koLuYqjPxgk/d0rwRgJwBpKvICpQu1Ch/UO8HJ79N8xbDkePhEPaivUFSKMiIZEM5XgcPATQra0Q3Cg1H28RDlDzj6v5QnZoRXSSuwFIbsGFIOH2E2Rs/44TQWFTzV2S6lbBp5GQZs= Authentication-Results: wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=none action=none header.from=wdc.com; Received: from DM6PR04MB6201.namprd04.prod.outlook.com (2603:10b6:5:127::32) by DM6PR04MB5131.namprd04.prod.outlook.com (2603:10b6:5:fe::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20; Wed, 25 Nov 2020 05:17:18 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Wed, 25 Nov 2020 05:17:18 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH v3 3/5] platform: Remove dummy system reset functions Date: Wed, 25 Nov 2020 10:46:45 +0530 Message-Id: <20201125051647.295472-4-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201125051647.295472-1-anup.patel@wdc.com> References: <20201125051647.295472-1-anup.patel@wdc.com> X-Originating-IP: [122.182.227.30] X-ClientProxiedBy: MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) To DM6PR04MB6201.namprd04.prod.outlook.com (2603:10b6:5:127::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.182.227.30) by MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20 via Frontend Transport; Wed, 25 Nov 2020 05:17:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 769d75b4-309a-4999-4b74-08d8910160cb X-MS-TrafficTypeDiagnostic: DM6PR04MB5131: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kTzt14qAKJK+hOSNAoKt1vhBYjCx7aurdfR760SJVZIZGynQ5K0e7iVr6Ypqz+Jrh+icttmIR8panu3mzk6qsDZn+6/kAFI3zRqBDtftNYs3Do/nj4C4PTLSUOi0kb4rGEphWqG7By79wjpwucGe2MBxo8alZnELh6NEy1HSrJ9SHbKEHeE1fhJmLgRqIZbU24GLyTmn8Dl/PTis5O8akFut0BsojPB2O1ZdGGwnyNlLLvb5bX9Fj0roDIbn24VqJLfEaH5+lCTldVWZ9q0bLT4htSUIQ9VrNxzDqsU+Knby4kpJdej2wXOhmGwDIPrN9xu6a0MjQpUgRgjg1GT0BA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR04MB6201.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(396003)(39860400002)(376002)(366004)(7696005)(52116002)(16526019)(36756003)(186003)(83380400001)(2616005)(44832011)(5660300002)(110136005)(2906002)(6666004)(54906003)(4326008)(956004)(316002)(8936002)(8676002)(55016002)(478600001)(26005)(1076003)(86362001)(66946007)(66556008)(66476007)(6636002)(8886007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: CDTRHFSQw5din7/HxmFbPI72sHR9YqO301K6CzsJ8688dX4r7y8Uu3GyfPA471vr9rOiNhDEPmAuqsKRoqmoQbINC3VG6GN3Ygp+Z5Ctu63ewxFCPgVZXchf0SSE/8N4DBaw1ZRN/HESx1Yy8XbwuLbuxF2kki2fVS7KgglGTSQcx5gpP7VbaHQJGvwIznht/u9zSMX7F0Zw2LiwqIt+eOE3UDjdUkJuHx4Rub8U9mm9w9azFEoehnQccnvPuSENGowdhIpu7ZL9KomrKh74UrBMetrD5IUiQeGE2ykx3b6hi6A79CCjoxK5G1mbWx0pP4Afozm5g42pvZ92tY8SU43qNyWmQpHzyehZAV0MNPkRWeYAyERVJjJIWbS6WmOKH7CdTaKlgzIBw5mbVbCrkBwTPQJUEQbUHIQanjUdzvV4WmBNZ7s2u+IF0Dnd2Z+7WOlzsWhgdRawML306+wCm5XC7FuYOxTIBSVmG5brHCxQwUDJZKKZNaDpnU3zcvxE89n3j1Zd5/EmnPGhVtPT6uoK5JLLOSK3b3MblUQ94zTS9IH1EI2ryJqAiTyEPHfH/eoU9WHOobC/Kqlowjdpu85WP1SS/Gzuad+OWBJFv16yVJNLA01d4MHsHLagRRf+PmVDdDNzxGdLIKnbPjM178385MkTWwcjdJ4B1k56d7EOqSrNd3mOhQ/tmsJV+2hoHgbUsyesM3uXRIuDqeIvANMx8CvDnfpgYIfBc2S5actWqxmJo9x8PAe2jq03hzUCTQKBuh6/KcpPHz+ZgqRDBklJhLYffX893mLYPyA/nHLvry9P2GZ70yP4Dx8xBFYOljqOmvRWwWyw8w3th82aTCupvb5yiJUqHQSd8IVoOi3UezO46GjEvqfKPYkBgoL3tMN4dQbZXIZjDBoZ5NxVGg== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 769d75b4-309a-4999-4b74-08d8910160cb X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2020 05:17:18.1433 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: i2f92+YluDA1R7okPRL4RYNnRYwWKOCj1tUEBQdsLCW83xi0/4Yx5Sie2Xy/n9P5Q2SulS0UqNwJNXpv6Wy5+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB5131 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201125_001719_870298_8D815174 X-CRM114-Status: GOOD ( 16.16 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [68.232.141.245 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Few platforms have dummy system reset functions so let's remove these dummy system reset functions to allow generic code deal with it in the right way. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Reviewed-by: Atish Patra --- platform/andes/ae350/platform.c | 10 ---------- platform/fpga/ariane/platform.c | 11 ----------- platform/fpga/openpiton/platform.c | 11 ----------- platform/kendryte/k210/platform.c | 10 ---------- platform/sifive/fu540/platform.c | 7 ------- 5 files changed, 49 deletions(-) diff --git a/platform/andes/ae350/platform.c b/platform/andes/ae350/platform.c index 954942c..6d6ce4e 100644 --- a/platform/andes/ae350/platform.c +++ b/platform/andes/ae350/platform.c @@ -114,14 +114,6 @@ static int ae350_timer_init(bool cold_boot) return plmt_warm_timer_init(); } -/* Reset the platform. */ -static int ae350_system_reset(u32 type) -{ - /* For now nothing to do. */ - sbi_printf("System reset\n"); - return 0; -} - /* Vendor-Specific SBI handler */ static int ae350_vendor_ext_provider(long extid, long funcid, unsigned long *args, unsigned long *out_value, @@ -185,8 +177,6 @@ const struct sbi_platform_operations platform_ops = { .timer_event_start = plmt_timer_event_start, .timer_event_stop = plmt_timer_event_stop, - .system_reset = ae350_system_reset, - .vendor_ext_provider = ae350_vendor_ext_provider }; diff --git a/platform/fpga/ariane/platform.c b/platform/fpga/ariane/platform.c index a4d437e..ea179e5 100644 --- a/platform/fpga/ariane/platform.c +++ b/platform/fpga/ariane/platform.c @@ -147,16 +147,6 @@ static int ariane_timer_init(bool cold_boot) return clint_warm_timer_init(); } -/* - * Reset the ariane. - */ -static int ariane_system_reset(u32 type) -{ - /* For now nothing to do. */ - sbi_printf("System reset\n"); - return 0; -} - /* * Platform descriptor. */ @@ -174,7 +164,6 @@ const struct sbi_platform_operations platform_ops = { .timer_value = clint_timer_value, .timer_event_start = clint_timer_event_start, .timer_event_stop = clint_timer_event_stop, - .system_reset = ariane_system_reset }; const struct sbi_platform platform = { diff --git a/platform/fpga/openpiton/platform.c b/platform/fpga/openpiton/platform.c index 095004d..5eae477 100644 --- a/platform/fpga/openpiton/platform.c +++ b/platform/fpga/openpiton/platform.c @@ -173,16 +173,6 @@ static int openpiton_timer_init(bool cold_boot) return clint_warm_timer_init(); } -/* - * Reset the openpiton. - */ -static int openpiton_system_reset(u32 type) -{ - /* For now nothing to do. */ - sbi_printf("System reset\n"); - return 0; -} - /* * Platform descriptor. */ @@ -200,7 +190,6 @@ const struct sbi_platform_operations platform_ops = { .timer_value = clint_timer_value, .timer_event_start = clint_timer_event_start, .timer_event_stop = clint_timer_event_stop, - .system_reset = openpiton_system_reset }; const struct sbi_platform platform = { diff --git a/platform/kendryte/k210/platform.c b/platform/kendryte/k210/platform.c index 75883ed..944b388 100644 --- a/platform/kendryte/k210/platform.c +++ b/platform/kendryte/k210/platform.c @@ -129,14 +129,6 @@ static int k210_timer_init(bool cold_boot) return clint_warm_timer_init(); } -static int k210_system_reset(u32 type) -{ - /* For now nothing to do. */ - sbi_printf("System reset\n"); - - return 0; -} - const struct sbi_platform_operations platform_ops = { .final_init = k210_final_init, @@ -154,8 +146,6 @@ const struct sbi_platform_operations platform_ops = { .timer_value = clint_timer_value, .timer_event_stop = clint_timer_event_stop, .timer_event_start = clint_timer_event_start, - - .system_reset = k210_system_reset }; const struct sbi_platform platform = { diff --git a/platform/sifive/fu540/platform.c b/platform/sifive/fu540/platform.c index 755e479..cdd8293 100644 --- a/platform/sifive/fu540/platform.c +++ b/platform/sifive/fu540/platform.c @@ -154,12 +154,6 @@ static u32 fu540_hart_index2id[FU540_HART_COUNT - 1] = { [3] = 4, }; -static int fu540_system_reset(u32 type) -{ - /* For now nothing to do. */ - return 0; -} - const struct sbi_platform_operations platform_ops = { .final_init = fu540_final_init, .console_putc = sifive_uart_putc, @@ -174,7 +168,6 @@ const struct sbi_platform_operations platform_ops = { .timer_event_stop = clint_timer_event_stop, .timer_event_start = clint_timer_event_start, .timer_init = fu540_timer_init, - .system_reset = fu540_system_reset }; const struct sbi_platform platform = { From patchwork Wed Nov 25 05:16:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1405884 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=IloC9fSf; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=PNH9RUef; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-sharedspace-onmicrosoft-com header.b=Zfa+tPqQ; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cgpzx0zlmz9sTR for ; Wed, 25 Nov 2020 16:17:32 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TywjpbbP7+OZenUJ6H+EMF0lewgEf9gk/+NCAUOSNvk=; b=IloC9fSfiV1ROVWKxiowoMaES yIhS1HBIbo6POfivPDUOY3N8v3dimKn+mtRSfbU9JH82L+jLnWd22Y6iZtRCXIfR0PplKsVGBtRPU Fa1ot6NK9X5C3FNMYlSdhwX68IXssy4wAZ4Tl8Hr4lzYgt/IVQcySzX2zPs/YAPjA72mjh7YRVv2u 0Vnwn+p0+9PATfRSzRdkmkNnq81S5Fiemqrsg/h+qkTHHgAIrKP4h9N1LCIKtfv4zcx3/wRy/Be9V 7uu8WDblsXEzwHaj+9SUu+47yAhqJiwuXbIESArg0ExwzfeNQeHB9B7IQlusdKF4zXHpFvgAg+YhV XQ9es+5hQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khnBF-0004iG-Hz; Wed, 25 Nov 2020 05:17:25 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khnBB-0004f9-W9 for opensbi@lists.infradead.org; Wed, 25 Nov 2020 05:17:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1606281441; x=1637817441; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=vHZ/IQoyuPZWOIJpFrszKA0nKBiM13J3S0EtDHQd/Y4=; b=PNH9RUef2/hT43LbXnY71c2JgZZZCUCvs5NYt424oNlmntm2dRNxUFsZ m8xGZvBhJommf4iEbNnd1o6760JV1UkIEiSqkdnVJ3WFGfbRoDF88TC2w J7KrSot2Z04GWjbJgZQj+PSkKwatHKRWACZdKrXhxAnJPAH79BK41kFQr qJXc6NQztEM82C+zDjdGsYmQzqPyO90GElIrDx6TRIFlEojHBztgslpdz tyPFAGd/9HW5yn4UtJAVaBMbB3WGPrhsMsemm9VbxtNzSCv41mYfVpxR+ fKLGCl7Rx3qtwvwIifPq3q/hAKMWis30oV/xivGxOld/8Bf22hV+V/r0h A==; IronPort-SDR: +QcTTSq0ragvfTYcYrG8qftEyOtXR4yRit9UKGDE19y4A65a6nNurxWbo4dPW/1ymA615OBGXS kQt5Kf/LGVXqQAIf/aVY5g/2JuAfxaIEQ93YK42opbr6yFRPaagL4YC3rFQmYyIahvrxUd8wlf jqCSJhbo9FJ5Lgn3gmdMrLgCZoMnFf9DViCp9XR3ZA1haDtrAoGAnzB1J1DTwNG+jd+Z9Vw2Qg +FsZyBE/7++nq2maXBSLew3/RmR1OQgbkW7t+nGv6nT4xYKa9b5d+eaSzGHwXqO44dZKaDRqZN vfo= X-IronPort-AV: E=Sophos;i="5.78,368,1599494400"; d="scan'208";a="263496210" Received: from mail-co1nam11lp2172.outbound.protection.outlook.com (HELO NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.172]) by ob1.hgst.iphmx.com with ESMTP; 25 Nov 2020 13:17:21 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ndN3EcezN7vHduWZ6r+e8w1T72JNOq5+O0R06l0oSenhoWE/y6ua8Cwg/imhap++czBPQAiqBwAVkOu+o20Jw5EXOhTfEbrGghtmuJMUhvqeoqo6AoXAEw9RJ7lnQbYXQS/HTg+ieYNVr1BHv52Rvc0WJluMDo+BPDO/t+l3767cbGOl+TyaQHALOWzLoutqdqReU3NsZfwB8cU1//opjFI0044aBXLQZBNI1xir6fo0SaCDXC/VR5XRzHzNuoPO0UOQsULaqhX8MoLo+R/e4G+MGYPGrCvKKnqGi6D0skEBhhwo9ATrYxM3x66YpQdxERE4F2HhunqdawwA8T+tzw== 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=sN6Q+PEMv92v7lUekd79pwKSegnLib7CqxcTK1ujoN4=; b=fly7Pze8tSCOk5fwrXUR/VH/6OVx6851BB3f3CoWR7GME7YAx6aaVdLC7ENQyYSHyK2OiXcrHhfmlJ4GxXi6YrnVBzEVoT4gWaM0vHCwq7Z9OGsStxFv0Q05Y4uKZkOrLJPQCiQ4KDoEQBSV9GS4vKOVXenLddSkVx7XiE7C9PapmWnUmPpw/B1g+XbD3gIDz+i2Ywt1sD4gOjPxTgBhalTCAfqVy7rdX9WTo6Bqgn7878lxDUkiTelkn8N97H+0WBmRtOgy7P0Mo3DPN28mlhRdGibNGs7EbfD6NSSAChx34WTrufv8oUgH4oDpmEni1/9pUPvEf288y6waweE+9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sN6Q+PEMv92v7lUekd79pwKSegnLib7CqxcTK1ujoN4=; b=Zfa+tPqQcplyW9VabSzPd6dGn2Js1PENo/VSbU3p+VioxiHHXqYk8EZIQ/JY/DQ4YW02FDWtc117LPcWjO/sqMIqjVziSjrqBfkTyZrVMGYPpz7c94M2XMarmO+HP47q3VeBHbDm3vE4VD+k3hKZd10cpDDWewzHdMUrlxZMImw= Authentication-Results: wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=none action=none header.from=wdc.com; Received: from DM6PR04MB6201.namprd04.prod.outlook.com (2603:10b6:5:127::32) by DM6PR04MB5131.namprd04.prod.outlook.com (2603:10b6:5:fe::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20; Wed, 25 Nov 2020 05:17:20 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Wed, 25 Nov 2020 05:17:20 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH v3 4/5] lib: sbi: Improve system reset platform operations Date: Wed, 25 Nov 2020 10:46:46 +0530 Message-Id: <20201125051647.295472-5-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201125051647.295472-1-anup.patel@wdc.com> References: <20201125051647.295472-1-anup.patel@wdc.com> X-Originating-IP: [122.182.227.30] X-ClientProxiedBy: MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) To DM6PR04MB6201.namprd04.prod.outlook.com (2603:10b6:5:127::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.182.227.30) by MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20 via Frontend Transport; Wed, 25 Nov 2020 05:17:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2ed243ae-85b6-4557-326e-08d89101624a X-MS-TrafficTypeDiagnostic: DM6PR04MB5131: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U6Pu6AFScIFgfIGtOg+vEH1J6oEzn/yrk7MNom/awpLmPtBsLBC2pHYOd/8pdRV9O9dPbqFhZYdcj92WBCaM7ns8x0uGfczb1+G8+Dv9fEX7407OdW6xVHeb6XufOdUmKrs+MRLQHwUK4AWlUfq1oMqDXMdjm49W3ZJ+2CqpEl0aOCGS5OOuFNYnL8Enm4qGURU3fZW1bA36pc5pky6w4toOT/RxCK7HjwKizQcNnun7tn0PCOB8fMdupf3ilUICTUVTKA4LC3/rSQB3xAei0PWzaZqvYULtq2HwfP0L3wmWtAq7YLhIhL2Ti3R8uNkR X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR04MB6201.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(396003)(39860400002)(376002)(366004)(7696005)(52116002)(16526019)(36756003)(186003)(83380400001)(2616005)(44832011)(5660300002)(110136005)(2906002)(6666004)(54906003)(4326008)(956004)(316002)(8936002)(8676002)(55016002)(478600001)(26005)(1076003)(86362001)(66946007)(66556008)(66476007)(6636002)(8886007)(30864003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: JV7o1OqJSGPfElcpaq7YJfbwV+7BPKPq9uLZEljEB2vC2b5VmOEJ6946tJGvlmy3erWV1ohPJKchy79g/fGFnUbqyDUhV0CRp6CkNJgABLBST9oeXguaOF+T6efwy6Wdu1/RlBJKktqwbumbxnbI3qpNj/KKaOwtLsb7c2Rcls+QBtw1PhZDrwOmmuHf4ymqoCrm5GMHijHe+nukHRtxQdAWfRyf2pMAX1/i9fUiYhsrg3RNFQXtb2VhQOWi/AIVJv/hWhqlyycTBom8rYFjE948HCi6y/sYIx2m9c8yQNX+mmLAiAASKtVVMV4mUUM1WyxCohPYdDjWI7ZOoeNrfV+WHbd9smPBPUdpbiWWJ9d8OhPA1khE3BM3rw3gVU2Et+FmVCRXFizvDbtq8KhCpSLoeKkIt+60YSDYhVqM7qmeKquOLJL2T3kSKilB4Vm2w8odLbfgUfDU9Gi9chCUijj2UcJRqVEAlniNiASn8ttOFvNt9UlsE0oQdkO/+XZEO2lLCiLPBfuvZiUHFdm7F8VBWIYlDDOlwZR+/8DKZkMtnI9JOvdhc7YgxHBaFfPbChjUZM2VAxDl0Yp93mIDGkD7G5VQrMvHNRMbHJB0crfQqN4EWNRnWM9AxfeC9Dt2DOBiVRuob9iuX+bgLt7AtbBH5eP4nadzhroG/IpRz2pAG0/70b0KoVY+62u0ZD7Q4OAB67zLp2Jf/pKcwstMklbtyKpm7iBiNpsfkQqFjeHULbyhZvrSfYMJHSuMUGuQHdLMN80bhTpLHbTLIa5rKLQKoz2JZdTgZ1PUUPbPMMgyQj+5p+4vit/QMHwwGh5AovbZMKWqpD3yyUAAbzcrNN7vrzVLjlwcTwRPSaTawelhLTLOLyRv8ss+j8qiKTLaQaXKw8GQz7ShPjlAbTm6CA== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ed243ae-85b6-4557-326e-08d89101624a X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2020 05:17:20.4418 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0hz40Den0O6IEQ1A2eZthlOwYTevexqsg8ZJQ9Pxwndnmx0nqiuQfN1RCPJhM0B5zoZpSMWHdhX97hdBIcEwug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB5131 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201125_001722_394153_5C99D35C X-CRM114-Status: GOOD ( 24.27 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [68.232.141.245 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org To implement the SBI SRST extension, we need two platform operations for system reset: 1) system_reset_check() - This operation will check whether given reset type and reason are supported by the platform 2) system_reset() - This operation will do the actual platform system reset and it will not return if reset type and reason are supported by the platform This patch updates system reset related code everywhere as-per above. Signed-off-by: Anup Patel Reviewed-by: Atish Patra --- include/sbi/sbi_platform.h | 35 ++++++++++++++++---- include/sbi/sbi_system.h | 4 ++- include/sbi_utils/reset/fdt_reset.h | 7 ++-- include/sbi_utils/sys/htif.h | 4 ++- include/sbi_utils/sys/sifive_test.h | 4 ++- lib/sbi/sbi_ecall_legacy.c | 3 +- lib/sbi/sbi_system.c | 13 ++++++-- lib/utils/reset/fdt_reset.c | 13 ++++++-- lib/utils/reset/fdt_reset_htif.c | 1 + lib/utils/reset/fdt_reset_sifive.c | 1 + lib/utils/sys/htif.c | 7 +++- lib/utils/sys/sifive_test.c | 23 ++++++++++--- platform/generic/include/platform_override.h | 5 ++- platform/generic/platform.c | 23 ++++++++++--- platform/nuclei/ux600/platform.c | 9 +++-- platform/template/platform.c | 12 +++++-- platform/thead/c910/platform.c | 9 +++-- 17 files changed, 137 insertions(+), 36 deletions(-) diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h index 3f4a733..3681a78 100644 --- a/include/sbi/sbi_platform.h +++ b/include/sbi/sbi_platform.h @@ -139,8 +139,10 @@ struct sbi_platform_operations { */ int (*hart_stop)(void); + /* Check whether reset type and reason supported by the platform */ + int (*system_reset_check)(u32 reset_type, u32 reset_reason); /** Reset the platform */ - int (*system_reset)(u32 reset_type); + void (*system_reset)(u32 reset_type, u32 reset_reason); /** platform specific SBI extension implementation probe function */ int (*vendor_ext_check)(long extid); @@ -669,21 +671,40 @@ static inline void sbi_platform_timer_exit(const struct sbi_platform *plat) } /** - * Reset the platform + * Check whether reset type and reason supported by the platform * * @param plat pointer to struct sbi_platform * @param reset_type type of reset + * @param reset_reason reason for reset * - * @return 0 on success and negative error code on failure + * @return 0 if reset type and reason not supported and 1 if supported */ -static inline int sbi_platform_system_reset(const struct sbi_platform *plat, - u32 reset_type) +static inline int sbi_platform_system_reset_check( + const struct sbi_platform *plat, + u32 reset_type, u32 reset_reason) { - if (plat && sbi_platform_ops(plat)->system_reset) - return sbi_platform_ops(plat)->system_reset(reset_type); + if (plat && sbi_platform_ops(plat)->system_reset_check) + return sbi_platform_ops(plat)->system_reset_check(reset_type, + reset_reason); return 0; } +/** + * Reset the platform + * + * This function will not return for supported reset type and reset reason + * + * @param plat pointer to struct sbi_platform + * @param reset_type type of reset + * @param reset_reason reason for reset + */ +static inline void sbi_platform_system_reset(const struct sbi_platform *plat, + u32 reset_type, u32 reset_reason) +{ + if (plat && sbi_platform_ops(plat)->system_reset) + sbi_platform_ops(plat)->system_reset(reset_type, reset_reason); +} + /** * Check if a vendor extension is implemented or not. * diff --git a/include/sbi/sbi_system.h b/include/sbi/sbi_system.h index 309e263..34ba766 100644 --- a/include/sbi/sbi_system.h +++ b/include/sbi/sbi_system.h @@ -12,6 +12,8 @@ #include -void __noreturn sbi_system_reset(u32 reset_type); +bool sbi_system_reset_supported(u32 reset_type, u32 reset_reason); + +void __noreturn sbi_system_reset(u32 reset_type, u32 reset_reason); #endif diff --git a/include/sbi_utils/reset/fdt_reset.h b/include/sbi_utils/reset/fdt_reset.h index 789a6ac..cce441a 100644 --- a/include/sbi_utils/reset/fdt_reset.h +++ b/include/sbi_utils/reset/fdt_reset.h @@ -15,10 +15,13 @@ struct fdt_reset { const struct fdt_match *match_table; int (*init)(void *fdt, int nodeoff, const struct fdt_match *match); - int (*system_reset)(u32 reset_type); + int (*system_reset_check)(u32 reset_type, u32 reset_reason); + void (*system_reset)(u32 reset_type, u32 reset_reason); }; -int fdt_system_reset(u32 reset_type); +int fdt_system_reset_check(u32 reset_type, u32 reset_reason); + +void fdt_system_reset(u32 reset_type, u32 reset_reason); int fdt_reset_init(void); diff --git a/include/sbi_utils/sys/htif.h b/include/sbi_utils/sys/htif.h index 7384b48..a431723 100644 --- a/include/sbi_utils/sys/htif.h +++ b/include/sbi_utils/sys/htif.h @@ -14,6 +14,8 @@ void htif_putc(char ch); int htif_getc(void); -int htif_system_reset(u32 type); +int htif_system_reset_check(u32 type, u32 reason); + +void htif_system_reset(u32 type, u32 reason); #endif diff --git a/include/sbi_utils/sys/sifive_test.h b/include/sbi_utils/sys/sifive_test.h index 7e153d5..958622e 100644 --- a/include/sbi_utils/sys/sifive_test.h +++ b/include/sbi_utils/sys/sifive_test.h @@ -12,7 +12,9 @@ #include -int sifive_test_system_reset(u32 type); +int sifive_test_system_reset_check(u32 type, u32 reason); + +void sifive_test_system_reset(u32 type, u32 reason); int sifive_test_init(unsigned long base); diff --git a/lib/sbi/sbi_ecall_legacy.c b/lib/sbi/sbi_ecall_legacy.c index 683b8dc..7844fbb 100644 --- a/lib/sbi/sbi_ecall_legacy.c +++ b/lib/sbi/sbi_ecall_legacy.c @@ -103,7 +103,8 @@ static int sbi_ecall_legacy_handler(unsigned long extid, unsigned long funcid, } break; case SBI_EXT_0_1_SHUTDOWN: - sbi_system_reset(SBI_SRST_RESET_TYPE_SHUTDOWN); + sbi_system_reset(SBI_SRST_RESET_TYPE_SHUTDOWN, + SBI_SRST_RESET_REASON_NONE); break; default: ret = SBI_ENOTSUPP; diff --git a/lib/sbi/sbi_system.c b/lib/sbi/sbi_system.c index 2f1b7fb..08a8b47 100644 --- a/lib/sbi/sbi_system.c +++ b/lib/sbi/sbi_system.c @@ -18,7 +18,16 @@ #include #include -void __noreturn sbi_system_reset(u32 reset_type) +bool sbi_system_reset_supported(u32 reset_type, u32 reset_reason) +{ + if (sbi_platform_system_reset_check(sbi_platform_thishart_ptr(), + reset_type, reset_reason)) + return TRUE; + + return FALSE; +} + +void __noreturn sbi_system_reset(u32 reset_type, u32 reset_reason) { ulong hbase = 0, hmask; u32 cur_hartid = current_hartid(); @@ -40,7 +49,7 @@ void __noreturn sbi_system_reset(u32 reset_type) /* Platform specific reset if domain allowed system reset */ if (dom->system_reset_allowed) sbi_platform_system_reset(sbi_platform_ptr(scratch), - reset_type); + reset_type, reset_reason); /* If platform specific reset did not work then do sbi_exit() */ sbi_exit(scratch); diff --git a/lib/utils/reset/fdt_reset.c b/lib/utils/reset/fdt_reset.c index dfbd33e..dead8a3 100644 --- a/lib/utils/reset/fdt_reset.c +++ b/lib/utils/reset/fdt_reset.c @@ -21,13 +21,20 @@ static struct fdt_reset *reset_drivers[] = { static struct fdt_reset *current_driver = NULL; -int fdt_system_reset(u32 reset_type) +int fdt_system_reset_check(u32 reset_type, u32 reset_reason) { - if (current_driver && current_driver->system_reset) - return current_driver->system_reset(reset_type); + if (current_driver && current_driver->system_reset_check) + return current_driver->system_reset_check(reset_type, + reset_reason); return 0; } +void fdt_system_reset(u32 reset_type, u32 reset_reason) +{ + if (current_driver && current_driver->system_reset) + current_driver->system_reset(reset_type, reset_reason); +} + int fdt_reset_init(void) { int pos, noff, rc; diff --git a/lib/utils/reset/fdt_reset_htif.c b/lib/utils/reset/fdt_reset_htif.c index e453d05..587e7d6 100644 --- a/lib/utils/reset/fdt_reset_htif.c +++ b/lib/utils/reset/fdt_reset_htif.c @@ -18,5 +18,6 @@ static const struct fdt_match htif_reset_match[] = { struct fdt_reset fdt_reset_htif = { .match_table = htif_reset_match, + .system_reset_check = htif_system_reset_check, .system_reset = htif_system_reset }; diff --git a/lib/utils/reset/fdt_reset_sifive.c b/lib/utils/reset/fdt_reset_sifive.c index 6a171ca..38b520c 100644 --- a/lib/utils/reset/fdt_reset_sifive.c +++ b/lib/utils/reset/fdt_reset_sifive.c @@ -33,5 +33,6 @@ static const struct fdt_match sifive_test_reset_match[] = { struct fdt_reset fdt_reset_sifive = { .match_table = sifive_test_reset_match, .init = sifive_test_reset_init, + .system_reset_check = sifive_test_system_reset_check, .system_reset = sifive_test_system_reset }; diff --git a/lib/utils/sys/htif.c b/lib/utils/sys/htif.c index ed800a5..fd70fb9 100644 --- a/lib/utils/sys/htif.c +++ b/lib/utils/sys/htif.c @@ -140,7 +140,12 @@ int htif_getc(void) return ch - 1; } -int htif_system_reset(u32 type) +int htif_system_reset_check(u32 type, u32 reason) +{ + return 1; +} + +void htif_system_reset(u32 type, u32 reason) { while (1) { fromhost = 0; diff --git a/lib/utils/sys/sifive_test.c b/lib/utils/sys/sifive_test.c index 06fbfb2..fdf3169 100644 --- a/lib/utils/sys/sifive_test.c +++ b/lib/utils/sys/sifive_test.c @@ -8,7 +8,7 @@ */ #include -#include +#include #include #define FINISHER_FAIL 0x3333 @@ -17,7 +17,19 @@ static void *sifive_test_base; -int sifive_test_system_reset(u32 type) +int sifive_test_system_reset_check(u32 type, u32 reason) +{ + switch (type) { + case SBI_SRST_RESET_TYPE_SHUTDOWN: + case SBI_SRST_RESET_TYPE_COLD_REBOOT: + case SBI_SRST_RESET_TYPE_WARM_REBOOT: + return 1; + } + + return 0; +} + +void sifive_test_system_reset(u32 type, u32 reason) { /* * Tell the "finisher" that the simulation @@ -25,15 +37,16 @@ int sifive_test_system_reset(u32 type) */ switch (type) { case SBI_SRST_RESET_TYPE_SHUTDOWN: - writew(FINISHER_PASS, sifive_test_base); + if (reason == SBI_SRST_RESET_REASON_NONE) + writew(FINISHER_PASS, sifive_test_base); + else + writew(FINISHER_FAIL, sifive_test_base); break; case SBI_SRST_RESET_TYPE_COLD_REBOOT: case SBI_SRST_RESET_TYPE_WARM_REBOOT: writew(FINISHER_RESET, sifive_test_base); break; } - - return 0; } int sifive_test_init(unsigned long base) diff --git a/platform/generic/include/platform_override.h b/platform/generic/include/platform_override.h index 8a53cdf..77a90d6 100644 --- a/platform/generic/include/platform_override.h +++ b/platform/generic/include/platform_override.h @@ -20,7 +20,10 @@ struct platform_override { int (*final_init)(bool cold_boot, const struct fdt_match *match); void (*early_exit)(const struct fdt_match *match); void (*final_exit)(const struct fdt_match *match); - int (*system_reset)(u32 reset_type, const struct fdt_match *match); + int (*system_reset_check)(u32 reset_type, u32 reset_reason, + const struct fdt_match *match); + void (*system_reset)(u32 reset_type, u32 reset_reason, + const struct fdt_match *match); int (*fdt_fixup)(void *fdt, const struct fdt_match *match); }; diff --git a/platform/generic/platform.c b/platform/generic/platform.c index 63c405a..6c93a51 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -184,12 +184,24 @@ static u64 generic_tlbr_flush_limit(void) return SBI_PLATFORM_TLB_RANGE_FLUSH_LIMIT_DEFAULT; } -static int generic_system_reset(u32 reset_type) +static int generic_system_reset_check(u32 reset_type, u32 reset_reason) { - if (generic_plat && generic_plat->system_reset) - return generic_plat->system_reset(reset_type, - generic_plat_match); - return fdt_system_reset(reset_type); + if (generic_plat && generic_plat->system_reset_check) + return generic_plat->system_reset_check(reset_type, + reset_reason, + generic_plat_match); + return fdt_system_reset_check(reset_type, reset_reason); +} + +static void generic_system_reset(u32 reset_type, u32 reset_reason) +{ + if (generic_plat && generic_plat->system_reset) { + generic_plat->system_reset(reset_type, reset_reason, + generic_plat_match); + return; + } + + fdt_system_reset(reset_type, reset_reason); } const struct sbi_platform_operations platform_ops = { @@ -214,6 +226,7 @@ const struct sbi_platform_operations platform_ops = { .timer_event_start = fdt_timer_event_start, .timer_init = fdt_timer_init, .timer_exit = fdt_timer_exit, + .system_reset_check = generic_system_reset_check, .system_reset = generic_system_reset, }; diff --git a/platform/nuclei/ux600/platform.c b/platform/nuclei/ux600/platform.c index ba6803e..d0a45a2 100644 --- a/platform/nuclei/ux600/platform.c +++ b/platform/nuclei/ux600/platform.c @@ -186,13 +186,17 @@ static int ux600_timer_init(bool cold_boot) return clint_warm_timer_init(); } -static int ux600_system_reset(u32 type) +static int ux600_system_reset_check(u32 type, u32 reason) +{ + return 1; +} + +static void ux600_system_reset(u32 type, u32 reason) { /* Reset system using MSFTRST register in Nuclei Timer. */ writel(UX600_NUCLEI_TIMER_MSFTRST_KEY, (void *)(UX600_NUCLEI_TIMER_ADDR + UX600_NUCLEI_TIMER_MSFTRST_OFS)); while(1); - return 0; } const struct sbi_platform_operations platform_ops = { @@ -209,6 +213,7 @@ const struct sbi_platform_operations platform_ops = { .timer_event_stop = clint_timer_event_stop, .timer_event_start = clint_timer_event_start, .timer_init = ux600_timer_init, + .system_reset_check = ux600_system_reset_check, .system_reset = ux600_system_reset }; diff --git a/platform/template/platform.c b/platform/template/platform.c index 9cd750e..758e95f 100644 --- a/platform/template/platform.c +++ b/platform/template/platform.c @@ -178,13 +178,20 @@ static void platform_timer_event_stop(void) } /* - * Reset the platform. + * Check reset type and reason supported by the platform. */ -static int platform_system_reset(u32 type) +static int platform_system_reset_check(u32 type, u32 reason) { return 0; } +/* + * Reset the platform. + */ +static void platform_system_reset(u32 type, u32 reason) +{ +} + /* * Platform descriptor. */ @@ -202,6 +209,7 @@ const struct sbi_platform_operations platform_ops = { .timer_event_stop = platform_timer_event_stop, .timer_event_start = platform_timer_event_start, .timer_init = platform_timer_init, + .system_reset_check = platform_system_reset_check, .system_reset = platform_system_reset }; const struct sbi_platform platform = { diff --git a/platform/thead/c910/platform.c b/platform/thead/c910/platform.c index df7658a..dfa484a 100644 --- a/platform/thead/c910/platform.c +++ b/platform/thead/c910/platform.c @@ -108,10 +108,14 @@ static int c910_timer_init(bool cold_boot) return clint_warm_timer_init(); } -static int c910_system_reset(u32 type) +static int c910_system_reset_check(u32 type, u32 reason) +{ + return 1; +} + +static void c910_system_reset(u32 type, u32 reason) { asm volatile ("ebreak"); - return 0; } int c910_hart_start(u32 hartid, ulong saddr) @@ -135,6 +139,7 @@ const struct sbi_platform_operations platform_ops = { .timer_init = c910_timer_init, .timer_event_start = clint_timer_event_start, + .system_reset_check = c910_system_reset_check, .system_reset = c910_system_reset, .hart_start = c910_hart_start, From patchwork Wed Nov 25 05:16:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1405883 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=TWtmLDzT; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=AT4qvv5x; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-sharedspace-onmicrosoft-com header.b=WMnD35nr; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cgpzw6kXbz9sT6 for ; Wed, 25 Nov 2020 16:17:32 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gnan6yb15wCRmmj4L3e3PRrYu3NC8TcJXODyX687pcU=; b=TWtmLDzTxWN8vEiwvYx/BDN5q wxufkyGYLTvDu7j8apRKtd3SmY00vuMg+oc5EyMe4nBPbjM+7m8cNViwUaeAWZijtQ/SRrA1qiKyr g230CmLK1K9uMbTPLv3fmR+T57CT0Qvy6mata3SkoFD7opFDM/AogrSf0CB2LUOBfVhVIyIsh829C WRoP55D2LRuJWUPfzf2nT8+/Bv2FTH77oOyA1R7xmNVQvACyTMP8lLm4dzJbzQXrRNCTdYm29MrGT 7l9Z884LzJ47uz3qxyXE+MMXdB/Ms90PKsR9w9Wi/FzhyArs9aX2uxIBtpZNCzQivq5LBVxUG3Pea dgAM9sQLw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khnBG-0004id-B4; Wed, 25 Nov 2020 05:17:26 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khnBE-0004f9-38 for opensbi@lists.infradead.org; Wed, 25 Nov 2020 05:17:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1606281444; x=1637817444; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=HhTlb+U02O1fJwE4hwFP5RFFdSBQcabF9E7q69Fcl2E=; b=AT4qvv5xLx7PMjIV2b0dwPliz/0pQiXUiswMCf3kApT1SyjsFPKoARAV U1mznK7HkPYKzMMwjBJ1XNY3oPBgvgjuq3LwVl8nhZz4HaPIXosCDTLAT dS3JhR2O4dwVqZOJrR64dkrvR8vWys4uyxFC5dGHtgsd3e/AevuWxMGoj xfqHmMhWNfkbEfC0UWOcpUYXr9VdQek34o7PCPg0kXCD6EznNt+8FSIGi asX7Vi9vsaKt89ZgXgask09kXtPMf+WB6UalaEqRnFSCisPPvUyXQhZ39 wtk4AUnm6Rqn/gIrQbJkhmeL8wVrUTxZE/9cswDQnQ8e2yoIVBOaZkqEK g==; IronPort-SDR: UOD7R3pGsPvjlcQceYwYq8fvid5uD2ymsxl8YWZiNyId1bDhq8R98ZVeGaXle7h6oI0p0WekPX JCuuZGQk2N18ryFb7DTEzUo8agMz0EA2HdvJXNfNyAz1Z5unNdZzsQ3SbngqlHpiZSgU+xyPdp gg0Mws6A1ola0KU7gT2san3EEHt+25H9sFnUvy2V52Gc7+mLOIIrux6Xa4BK5080zN4AMLGsmh WAUrgH7y9sLebv0H69sVjLN/7t4LcNwBYTYaZiAIDOAoIs+2xrXvjZYXpovp3G+wSEHGNeax+m 4kc= X-IronPort-AV: E=Sophos;i="5.78,368,1599494400"; d="scan'208";a="263496216" Received: from mail-co1nam11lp2174.outbound.protection.outlook.com (HELO NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.174]) by ob1.hgst.iphmx.com with ESMTP; 25 Nov 2020 13:17:23 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KxbdGvFUNpL2duIHTWWNKP1B4AKhRZql+b7ivB9izHxv2fd85g0KZzzeetzSnv0h+BgX4ywDmtBvsGvq9AVYsqPSBGwpngHwAN3Pf35FIiC/x5Ba3EszQzalijb/IvG4EcixoVVamjrjJgEJJmEcZR11kAzUvYPolrwNJu1Qn93nZO4UPzGCx8XJuzc0ywEF7jygBRdxkXrFaTAdSNyGC5mMkDa7Cm1Nj+S+dPZW/BBZoOBXrVyhNbZXnDZVPJw9l6jpVg1qZZNpAQjg4nSSH4OUbkJgogGZNZ/BjVkT9IsYc/Yk65nnDQYsy0MUEfdZiVaCMuXuZ0r2ndEm65OctQ== 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=b+En7v7WTM7M+Kix0xWhFNxvBugrddcoPYgb3P5ZEsM=; b=I6I1+VXNTE8B8EfIGPpVSaTVQh6T1JXBV6Dnlj6F43MfIqYiWWLt0w31trLXpa0do7sVLm8EY+qukVXmbKkEqrm4A0CEvyuGsvdt5X0bPgrbrnqPUCfnS9Az1igdvDOuyMgap84zU/sF/PwTqUULHuxPH6ey38DXwtzPCd1U9Y5z0oOuGPBYDD5Ipa8p91UTyCHtaK4JdR47ISMLrglom6zAya+SLYOKDu57ZczVs/WvIvpZgkIsufLrxznVKH6ZGo7efs0palyjs/CBi2TarIS2WChP2mGoKcD9sVJbf+8bRg9+eEfozJQW+LHVJjQuMEyhTPLG720oKVnJVm4Fww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b+En7v7WTM7M+Kix0xWhFNxvBugrddcoPYgb3P5ZEsM=; b=WMnD35nrRRjq68+PJ0anKy7Fl1KdD9UwnFzHt9I0rEKPPMptGZHgSkN6DVD9wx+q6/K+lcjd9RpByRVitVxgGfqUpTQJpyVl6L+VQpzlSABArxMZMil53UFux4BmNXuvQL1sfFR1xiWUg5dxE+7XLvdpIT77QKyh2R08vG9PnNk= Authentication-Results: wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=none action=none header.from=wdc.com; Received: from DM6PR04MB6201.namprd04.prod.outlook.com (2603:10b6:5:127::32) by DM6PR04MB5131.namprd04.prod.outlook.com (2603:10b6:5:fe::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20; Wed, 25 Nov 2020 05:17:22 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Wed, 25 Nov 2020 05:17:22 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH v3 5/5] lib: sbi: Implement System Reset (SRST) SBI extension Date: Wed, 25 Nov 2020 10:46:47 +0530 Message-Id: <20201125051647.295472-6-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201125051647.295472-1-anup.patel@wdc.com> References: <20201125051647.295472-1-anup.patel@wdc.com> X-Originating-IP: [122.182.227.30] X-ClientProxiedBy: MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) To DM6PR04MB6201.namprd04.prod.outlook.com (2603:10b6:5:127::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.182.227.30) by MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20 via Frontend Transport; Wed, 25 Nov 2020 05:17:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4cc312be-527f-4b2f-c9f8-08d8910163a6 X-MS-TrafficTypeDiagnostic: DM6PR04MB5131: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ymGvwDPRG3gtRus3ZwDEK7IYH+N1uoFtd19XerFrUdqyRrBjixUX07Bd9En1caImRDNGC1zGxJAZTr+kKAjDtBbRxrz4ULHLkZ7UjnYgeHC+Wzyji9ydCgJEO5TpKq7Xis95WMG36zdA7VyjX/G5ZDtp47cel1iQLglPsinaEfeHTGJJF0Wm+rmlvioA+Oq+pJ1RRVC9ypqGwEeTOhXGHhheArrhrGIBa6GE7X37kkYIBJS5OIy3fiKlSMc3Hvv1A7HU4mHQp4Ym+/gg+BuesXbTM/KE4EP+IQqhL/6YvNjXtnEvrtW/9kDzLRK1k4mqGkR9NG+WRTCBbPscHqGYSXsWFZYSaJxpIZB9DRuXn8dvD/0AtabcgZU2aur8+x1Y+nlYI8fC8IYMPi8Wjlg2Cw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR04MB6201.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(396003)(39860400002)(376002)(366004)(7696005)(52116002)(16526019)(36756003)(186003)(83380400001)(2616005)(44832011)(5660300002)(110136005)(2906002)(6666004)(54906003)(4326008)(956004)(316002)(8936002)(8676002)(55016002)(478600001)(966005)(26005)(1076003)(86362001)(66946007)(66556008)(66476007)(6636002)(8886007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: rc8ytJ/wJK+rxmEi3ejDVKNDyqN8HLWjwWrtortpOskPGfUlDkRjbLROxMHQUZkPwXleC1ocG6THHSltEiLTFcIBQPEyezOGIKjlE5fhTN8mbfljjFaiHUpg/3xA+Uf9dcMJsfIa55R2ehFfsjNkSoNg2Qmxj72i6ev+1vMOFHqm6JujvO9DRgtD8bvRPwsVwhiRkTnccusyisMOxRFMQKR80PceJLpEVWzXdszjL5Ni+4mZN5iBR7IrCtLRsE9dyiHML6C51X6TxEoZiNDb0lr9dkVyJvJjfekJX3GtLSJuf7At38456/DlQ/w54XWL3ZAZf6hzcVly2aAKe8aKO/yLTeDwhIkd/VW91qtn6QvDudIqVw9B0nUFLneNadgqEyDbKN1nmEyHoTjl+sCf4xbHpbOfco5V7BMwkwVaJ9ylYqW47p3JFX252ZnBPkX2mqlFekiZB8XSg79mlU5TLcGfxVAJ5PYwYpjJcJ+dx9vdSylLcjGh1B6IfgJq+rNUIYBoWflCf8vMoT0EEUuomeUfv/bJil99bnvS/3dOxdmiLzTVDezIRjC2xJNIlYihHP/65OdNMH0yYiipsg0d0SIHDpc5cfr1HOQViWds1nsMrbFj3g7+3ftd0JwVIpaHxotjNVPSqMqQnxrXRBkaYFaaJ503VyXxxmeFZJ+tXB2FdChR/fQ0eyAsVsOITbxmO2BIYHmY5SheDyMP9B0JIMZGy5g1sy3fDfbcpR608Ia+OS9Ll26/UH1km52EmeGGJH+y6fOJXbF8ovn5PdIxP5AlcDZmR4w6RAg/nKlqYjAP58RuFGmYg2rNo+1mHZmDOtxwi/VX2bDH9EhO4jFYwyZ/+GfbLA2f7Xs2Wa4q4SfEAxy3bf0WB0FnccOnJepUWM7vj79jeocOs44zzilVWQ== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4cc312be-527f-4b2f-c9f8-08d8910163a6 X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2020 05:17:22.7334 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RpkjWRpB2BJfEXTGjHUWvV644LYHxXTtxVDLHpKaHeDiXhjZQcqta/o0Xezr+ezchI1leWGFUKxxHiAiAnFSWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB5131 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201125_001724_288169_ABA05A8F X-CRM114-Status: GOOD ( 22.21 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [68.232.141.245 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The SBI SRST extension has been accepted and merged in the latest SBI v0.3-draft specification. (Refer, https://github.com/riscv/riscv-sbi-doc) It allows to S-mode software to request system shutdown, cold reboot, and warm reboot. This patch implements SBI SRST extension as a replacement of the legacy sbi_shutdown() call of SBI v0.1 specification. Signed-off-by: Anup Patel Reviewed-by: Atish Patra --- include/sbi/sbi_ecall.h | 1 + lib/sbi/sbi_ecall.c | 3 ++ lib/sbi/sbi_ecall_replace.c | 60 +++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) diff --git a/include/sbi/sbi_ecall.h b/include/sbi/sbi_ecall.h index 3273ba6..1ef86e2 100644 --- a/include/sbi/sbi_ecall.h +++ b/include/sbi/sbi_ecall.h @@ -37,6 +37,7 @@ extern struct sbi_ecall_extension ecall_rfence; extern struct sbi_ecall_extension ecall_ipi; extern struct sbi_ecall_extension ecall_vendor; extern struct sbi_ecall_extension ecall_hsm; +extern struct sbi_ecall_extension ecall_srst; u16 sbi_ecall_version_major(void); diff --git a/lib/sbi/sbi_ecall.c b/lib/sbi/sbi_ecall.c index 64c9933..6d41cff 100644 --- a/lib/sbi/sbi_ecall.c +++ b/lib/sbi/sbi_ecall.c @@ -167,6 +167,9 @@ int sbi_ecall_init(void) if (ret) return ret; ret = sbi_ecall_register_extension(&ecall_hsm); + if (ret) + return ret; + ret = sbi_ecall_register_extension(&ecall_srst); if (ret) return ret; ret = sbi_ecall_register_extension(&ecall_legacy); diff --git a/lib/sbi/sbi_ecall_replace.c b/lib/sbi/sbi_ecall_replace.c index e460c30..d06dfa2 100644 --- a/lib/sbi/sbi_ecall_replace.c +++ b/lib/sbi/sbi_ecall_replace.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -127,3 +128,62 @@ struct sbi_ecall_extension ecall_ipi = { .extid_end = SBI_EXT_IPI, .handle = sbi_ecall_ipi_handler, }; + +static int sbi_ecall_srst_handler(unsigned long extid, unsigned long funcid, + unsigned long *args, unsigned long *out_val, + struct sbi_trap_info *out_trap) +{ + if (funcid == SBI_EXT_SRST_RESET) { + if ((((u32)-1U) <= ((u64)args[0])) || + (((u32)-1U) <= ((u64)args[1]))) + return SBI_EINVAL; + + switch (args[0]) { + case SBI_SRST_RESET_TYPE_SHUTDOWN: + case SBI_SRST_RESET_TYPE_COLD_REBOOT: + case SBI_SRST_RESET_TYPE_WARM_REBOOT: + break; + default: + return SBI_ENOTSUPP; + } + + switch (args[1]) { + case SBI_SRST_RESET_REASON_NONE: + case SBI_SRST_RESET_REASON_SYSFAIL: + break; + default: + return SBI_ENOTSUPP; + } + + if (sbi_system_reset_supported(args[0], args[1])) + sbi_system_reset(args[0], args[1]); + } + + return SBI_ENOTSUPP; +} + +static int sbi_ecall_srst_probe(unsigned long extid, unsigned long *out_val) +{ + u32 type, count = 0; + + /* + * At least one standard reset types should be supported by + * the platform for SBI SRST extension to be usable. + */ + + for (type = 0; type <= SBI_SRST_RESET_TYPE_LAST; type++) { + if (sbi_system_reset_supported(type, + SBI_SRST_RESET_REASON_NONE)) + count++; + } + + *out_val = (count) ? 1 : 0; + return 0; +} + +struct sbi_ecall_extension ecall_srst = { + .extid_start = SBI_EXT_SRST, + .extid_end = SBI_EXT_SRST, + .handle = sbi_ecall_srst_handler, + .probe = sbi_ecall_srst_probe, +};