From patchwork Wed Apr 12 08:38:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1767970 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=Z0qg+j+/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PxGMJ0F2Wz1yZK for ; Wed, 12 Apr 2023 18:38:36 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 04DD085D52; Wed, 12 Apr 2023 10:38:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="Z0qg+j+/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3786785AB5; Wed, 12 Apr 2023 10:38:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 302F585D7B for ; Wed, 12 Apr 2023 10:38:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from workstation5.fritz.box (ip-088-152-145-137.um26.pools.vodafone-ip.de [88.152.145.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 73AC2405B4; Wed, 12 Apr 2023 08:38:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1681288704; bh=YX3pcBjh8+N3Kw41uDu2MSRbOfU6q7Mc4OIFG/mcSBI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Z0qg+j+/d2Nzoz00qb6wYgVcbGiJPoiUoLOWgtlGKGh1VKB7v/YITSxSSyrxNJ3vU X9ukJlEMu1/tGY5a/iMzVar9NvUWBRnH/PvK7R5c6m/tefYlaZirxhlp0O4Ksx3uMC JYaWKos8LbbsUDGL9x2pGuSWKKrfBt74eHygrFQdtrZD7Xz4xIp7yKwsZTY8Iujj5u YLA44jJNMrHDRdD3a120e1/sWD+O8FoQoG7oubdE4AbyAcylY2CvealIh5l2K7PO34 RqNU9K7ajmCYPidrRg+MJMge18vk8nS8/N4Q8qQ4gK+tyv4bJg03YhGPZZBcNSZLkk yaLyJLsiBjJIg== From: Heinrich Schuchardt To: Rick Chen , Leo Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 1/1] cmd/sbi: display new extensions Date: Wed, 12 Apr 2023 10:38:16 +0200 Message-Id: <20230412083816.19809-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean OpenSBI already implements some extensions that are not ratified yet: * Debug Console Extension (DBCN) * System Suspend Extension (SUSP) * Collaborative Processor Performance Control Extension (CPPC) Allow the sbi command to display these. Provide the FID definitions of the Debug Console Extension. We can use that extension for an early debug console driver. Signed-off-by: Heinrich Schuchardt Reviewed-by: Leo Yu-Chi Liang --- arch/riscv/include/asm/sbi.h | 9 +++++++++ cmd/riscv/sbi.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 81fcfe0b36..769369997d 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -28,6 +28,9 @@ enum sbi_ext_id { SBI_EXT_HSM = 0x48534D, SBI_EXT_SRST = 0x53525354, SBI_EXT_PMU = 0x504D55, + SBI_EXT_DBCN = 0x4442434E, + SBI_EXT_SUSP = 0x53555350, + SBI_EXT_CPPC = 0x43505043, }; enum sbi_ext_base_fid { @@ -89,6 +92,12 @@ enum sbi_srst_reset_reason { SBI_SRST_RESET_REASON_SYS_FAILURE, }; +enum sbi_ext_dbcn_fid { + SBI_EXT_DBCN_CONSOLE_WRITE = 0, + SBI_EXT_DBCN_CONSOLE_READ, + SBI_EXT_DBCN_CONSOLE_WRITE_BYTE, +}; + #ifdef CONFIG_SBI_V01 #define SBI_EXT_SET_TIMER SBI_EXT_0_1_SET_TIMER #define SBI_FID_SET_TIMER 0 diff --git a/cmd/riscv/sbi.c b/cmd/riscv/sbi.c index 6f2cad4e7e..c4707fe520 100644 --- a/cmd/riscv/sbi.c +++ b/cmd/riscv/sbi.c @@ -46,6 +46,9 @@ static struct sbi_ext extensions[] = { { SBI_EXT_HSM, "Hart State Management Extension" }, { SBI_EXT_SRST, "System Reset Extension" }, { SBI_EXT_PMU, "Performance Monitoring Unit Extension" }, + { SBI_EXT_DBCN, "Debug Console Extension" }, + { SBI_EXT_SUSP, "System Suspend Extension" }, + { SBI_EXT_CPPC, "Collaborative Processor Performance Control Extension" }, }; static int do_sbi(struct cmd_tbl *cmdtp, int flag, int argc,