From patchwork Thu Jun 15 03:32:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Chien Peter Lin X-Patchwork-Id: 1795176 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=MhhjXF9u; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QhSf71GBJz20Wy for ; Thu, 15 Jun 2023 13:37:17 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=9BccDmmhafD6NQvb6OXWEsqImepiGy75ghcfi5/5X9c=; b=MhhjXF9ue17wk7 nA6zGlavZJHsY176MohOqk5GLH2B6nF80/QB++OTTssIJuIZdMHNIz5vtkuFijPXqT1VtCf230Sln tEiGXpd5NeHmDO4qrdezmfOSAVExDjas6lQJw0PaCyEOtf0Wd3CWl37bNeGGxjRblbb93V7tX60OH nNMu9vSoD/fXgS/rIZTlpLL9CC5Mn4wRn5MpjBjXt4ODIzuuR/TEXz5XtgUNjOYzBRwsz7MTtqQF2 5WLggfs6CbvIId1vExjyU68L2BPPEOFsmcYMeDbKTx3WYt/FwGyQIbM7VuhO9P/N5Yt60fgYFXtwN IfNjG84Y76FG5bM/Be1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q9djL-00DTzs-2W; Thu, 15 Jun 2023 03:33:03 +0000 Received: from 60-248-80-70.hinet-ip.hinet.net ([60.248.80.70] helo=Atcsqr.andestech.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q9djG-00DTyx-2d for openwrt-devel@lists.openwrt.org; Thu, 15 Jun 2023 03:33:00 +0000 Received: from mail.andestech.com (ATCPCS16.andestech.com [10.0.1.222]) by Atcsqr.andestech.com with ESMTP id 35F3Wh9u099427; Thu, 15 Jun 2023 11:32:43 +0800 (+08) (envelope-from peterlin@andestech.com) Received: from atcfdc88.andestech.com (10.0.15.158) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Thu, 15 Jun 2023 11:32:42 +0800 From: Yu Chien Peter Lin To: CC: , Yu Chien Peter Lin Subject: [PATCH] [procd] system: add RISC-V CPU info Date: Thu, 15 Jun 2023 11:32:33 +0800 Message-ID: <20230615033233.9354-1-peterlin@andestech.com> X-Mailer: git-send-email 2.38.0.68.ge85701b4af.dirty MIME-Version: 1.0 X-Originating-IP: [10.0.15.158] X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL: Atcsqr.andestech.com 35F3Wh9u099427 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230614_203259_296436_A8B8B15F X-CRM114-Status: UNSURE ( 6.95 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.4 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This patch adds the missing information about RISC-V architecture, which has been supported by OpenWrt. Currently, LuCI shows "?" at the field of Architecture, we add "RISC-V" with isa string parsed f [...] Content analysis details: (0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This patch adds the missing information about RISC-V architecture, which has been supported by OpenWrt. Currently, LuCI shows "?" at the field of Architecture, we add "RISC-V" with isa string parsed from /proc/cpuinfo. For example, the following platform generates "RISC-V (rv64imafdc)": root@OpenWrt:/# cat /proc/cpuinfo processor : 0 hart : 0 isa : rv64imafdc mmu : sv48 mvendorid : 0x31e marchid : 0x8000000000008a45 mimpid : 0x820 Signed-off-by: Yu Chien Peter Lin --- system.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system.c b/system.c index 93eac59..1f2be33 100644 --- a/system.c +++ b/system.c @@ -153,6 +153,12 @@ static int system_board(struct ubus_context *ctx, struct ubus_object *obj, blobmsg_add_string(&b, "system", line); break; } +#elif __riscv + if (!strcasecmp(key, "isa")) { + snprintf(line, sizeof(line), "RISC-V (%s)", val + 2); + blobmsg_add_string(&b, "system", line); + break; + } #else if (!strcasecmp(key, "system type") || !strcasecmp(key, "processor") ||