Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1279765ybg; Fri, 18 Oct 2019 15:07:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlaQWnfFSoa5ZkQqsF5oFrqFstGaAmSreeH1vM/r2H9wSmV1BCoE+aoPbFf1/fkbm0q4cx X-Received: by 2002:a17:906:4757:: with SMTP id j23mr10442433ejs.174.1571436472643; Fri, 18 Oct 2019 15:07:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571436472; cv=none; d=google.com; s=arc-20160816; b=N/fq58XGGKcuV7ancjb8cRjx8auxpGi14DOBcvCj9/FCBq2XIu2Fqv1B07NnNTw9qn UwITA0WNPlNWs1ZuoTEIrpJfrffU8dzPa5PJw8uS7A5R7V8mVUybj5yw/VZjU5MNhLqB F1m4q9+oDrsacC/t+/YUTijVv/8JZhkLYtJDXLg2pZ0Iu3KygRno4+CyIsSl+5bkGpog aUoAsRGV7Hs5A8os37gPfQn9xhdh5qB+TLojvQQ0BLEfPy2rjiykQR2HF75xthYE/aMQ ra0IAFMWHBsNmZ1zP0Fal7fTxXxPzEqS0A3f/+xOgEem5ZzmyDngXnJeLqDFfLbwy21h cFEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yCcZdwwkx82faMNj1J82WfdjvYqcNb5jT+ohjwodn8U=; b=VCmBDaH1CuaDHpQLGyD0Xl8/JNDU9YHbCgh0lCHrhx4WBYMJ1o/9rGP5n4SA0aat9M 9Q3swz6umO6eINv1JaR42K+lvXTYnUbQvDp0LRpuTMiXf+ZbIHRAfvLNPClsoVBqSOi9 p0p2zwbErPQrNEJ0Y63gEOVwCYtWNCfZqjpLCeZe6bra8izcLD3IMC+DGGuqR7xwv9ko vfR5h5fT3HkuQJqjIwNiqz0KYck3skNm5gkUcIhBRX4nt3lp32tNYtyC4+fHykV/Vput hkqmUz4H8pwda+S24NndarMi0/aAsrU4WgoJko83BVIq6GD1y+e0Ey2VPXaJiULtLZbh Bo3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Q5YAST/I"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s27si4790574edm.226.2019.10.18.15.07.29; Fri, 18 Oct 2019 15:07:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Q5YAST/I"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503060AbfJQRiA (ORCPT + 99 others); Thu, 17 Oct 2019 13:38:00 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:35408 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440745AbfJQRh6 (ORCPT ); Thu, 17 Oct 2019 13:37:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yCcZdwwkx82faMNj1J82WfdjvYqcNb5jT+ohjwodn8U=; b=Q5YAST/IKAvFyWqOCBEo44AHwb oUo6RpTL00B4TEqPIU5kw+o6KSfR+aGS/9fymZlPDJ/WpkAC4pNoTBMUQ/awSEpRjKP44QuE5GJdb 7oftEPEkjbr+UXltBnksMd/0EHXdPFW+F45UEka/z+lRXgd5IUrTwGsqq2Xg/soqYEL4/FHCZTiUh 4Df79h+sV2PgRt0ggoBd3G0X6hXqkmsEhbsMXaPKm2zQ+uyQL+rP7Rv+v8mZRSAQXjzDln97DZBJO 1jeUmMdNBqrS1cx4O/KUR0nIJwex8vJM6L1jHxlUNlcViPi567tmx7Xr3E61Ihb4z/9haFS2dklyn g5jSaWgQ==; Received: from [2001:4bb8:18c:d7b:c70:4a89:bc61:3] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iL9il-0007OQ-Mr; Thu, 17 Oct 2019 17:37:56 +0000 From: Christoph Hellwig To: Palmer Dabbelt , Paul Walmsley Cc: Damien Le Moal , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/15] riscv: don't allow selecting SBI based drivers for M-mode Date: Thu, 17 Oct 2019 19:37:32 +0200 Message-Id: <20191017173743.5430-5-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191017173743.5430-1-hch@lst.de> References: <20191017173743.5430-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Damien Le Moal When running in M-mode we can't use SBI based drivers. Add a new CONFIG_RISCV_SBI that drivers that do SBI calls can depend on instead. Signed-off-by: Damien Le Moal Signed-off-by: Christoph Hellwig --- arch/riscv/Kconfig | 6 ++++++ drivers/tty/hvc/Kconfig | 2 +- drivers/tty/serial/Kconfig | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 86b7e8b0471c..b85492c42ccb 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -76,6 +76,12 @@ config ARCH_MMAP_RND_BITS_MAX config RISCV_M_MODE bool +# set if we are running in S-mode and can use SBI calls +config RISCV_SBI + bool + depends on !RISCV_M_MODE + default y + config MMU def_bool y diff --git a/drivers/tty/hvc/Kconfig b/drivers/tty/hvc/Kconfig index 4d22b911111f..4487a6b9acc8 100644 --- a/drivers/tty/hvc/Kconfig +++ b/drivers/tty/hvc/Kconfig @@ -89,7 +89,7 @@ config HVC_DCC config HVC_RISCV_SBI bool "RISC-V SBI console support" - depends on RISCV + depends on RISCV_SBI select HVC_DRIVER help This enables support for console output via RISC-V SBI calls, which diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 67a9eb3f94ce..540142c5b7b3 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -88,7 +88,7 @@ config SERIAL_EARLYCON_ARM_SEMIHOST config SERIAL_EARLYCON_RISCV_SBI bool "Early console using RISC-V SBI" - depends on RISCV + depends on RISCV_SBI select SERIAL_CORE select SERIAL_CORE_CONSOLE select SERIAL_EARLYCON -- 2.20.1