Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4385212rdb; Thu, 28 Dec 2023 22:54:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEC1Rx1BwX0dN+xoIRrkTUsg9+QkfFeleQ14LDdmKRzW5K0ADXAt46l95ZbjXaivcZ6cA5N X-Received: by 2002:a17:906:a1c9:b0:a26:9916:a46b with SMTP id bx9-20020a170906a1c900b00a269916a46bmr4479316ejb.33.1703832875693; Thu, 28 Dec 2023 22:54:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703832875; cv=none; d=google.com; s=arc-20160816; b=VyZj9TCAbSddyL4HLwpSOwhRPtB4rgfqWxwGU0q/kKWOiTtOwPCN6u4e9fL5bc34Hf DfNb+cAXC/18ARyAigm8PxhkR/6ZKJETdeq30AoLJanG2mP/3xBUu0UL3vDD3nfZhr4l WMHGEx8T5OK1+KaZFk7AWt5tHhmM5BJoaNfgBeKHWgHcFXWBrs3J4tFphzVE7SDzBYON R57AdT6bWmeFqrxYxyJE/uyGu7nK/BduPoo6jAXjDaANG932Bd925X+DTAKmdivryxFn x2cLk6H5AfGty3GQyV2JUWMvlBwYtl5TyWA1X39ftZoGQsi7B5ASjbEJ8CdgMM2lEiXv IFIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=NOUOzVH6msMixl814kEDl//jby808gNDU5YQ+GvCc5k=; fh=ZYQJBVImpC6sYxKYKHV6SrBB7jlq5NQnfvghGRBJdJU=; b=rMEP4YsmFPn1TwGw6z8QJpInD1ncmDp+mWyEUBRrCqRkk++QbP+lDJt2CzAiFpjRMK ha4NaRclzlhjnQKl/1kTJ8V3ekrT8JbwTsrUyTqTptRdNbwiACH6X0lO+XFXwjoKmy3L +OlBffA5Mlm7buREMezFWmGii0h+I6pDDBvPllrZQ4PDVTN3thbFzkCtZiHzS56JK0T/ cxqTLDJvndjv4fjOAE2YeylckSydkX4wFhajmy8RR7R5ebPN3cb+nwqZlp1/9kmmiFho zWQUrnJ/fiJyzov9WRr+kg3gzXikTHVKt0zlZKIt/1RVqKQRyRo6Or9XqFEpPmRpyuHL BD4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12961-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12961-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id p10-20020a1709060e8a00b00a236fc6a8a9si7370110ejf.962.2023.12.28.22.54.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 22:54:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12961-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12961-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12961-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6BCD01F21AAB for ; Fri, 29 Dec 2023 06:54:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4BC46101; Fri, 29 Dec 2023 06:54:28 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DBA15669 for ; Fri, 29 Dec 2023 06:54:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id BE36824E03E; Fri, 29 Dec 2023 14:54:21 +0800 (CST) Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 29 Dec 2023 14:54:21 +0800 Received: from jsia-virtual-machine.localdomain (175.136.135.142) by EXMBX066.cuchost.com (172.16.6.66) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 29 Dec 2023 14:54:17 +0800 From: Sia Jee Heng To: , CC: , , , , , , , Subject: [RFC v1 1/1] RISC-V: ACPI: Enable SPCR table for console output on RISC-V Date: Fri, 29 Dec 2023 14:54:05 +0800 Message-ID: <20231229065405.235625-2-jeeheng.sia@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231229065405.235625-1-jeeheng.sia@starfivetech.com> References: <20231229065405.235625-1-jeeheng.sia@starfivetech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX066.cuchost.com (172.16.6.66) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: quoted-printable The ACPI SPCR code has been used to enable console output for ARM64 and X86. The same code can be reused for RISC-V. Vendor will enable/disable the SPCR table in the firmware based on the platform design. However, in cases where the SPCR table is not usable, a kernel parameter could be used to specify the preferred console. Signed-off-by: Sia Jee Heng --- arch/riscv/kernel/acpi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c index e619edc8b0cc..5ec2fdf9e09f 100644 --- a/arch/riscv/kernel/acpi.c +++ b/arch/riscv/kernel/acpi.c @@ -18,6 +18,7 @@ #include #include #include +#include =20 int acpi_noirq =3D 1; /* skip ACPI IRQ initialization */ int acpi_disabled =3D 1; @@ -151,6 +152,9 @@ void __init acpi_boot_table_init(void) if (!param_acpi_force) disable_acpi(); } + + if (!acpi_disabled) + acpi_parse_spcr(earlycon_acpi_spcr_enable, true); } =20 static int acpi_parse_madt_rintc(union acpi_subtable_headers *header, co= nst unsigned long end) --=20 2.34.1