From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 410CDC11D00 for ; Fri, 21 Feb 2020 00:45:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F09D524656 for ; Fri, 21 Feb 2020 00:44:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rZf/4j5a"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="aqYLMNEE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F09D524656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date :Subject:To:From:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A/+D2J6zIW3Ulh/6/EVmRAYYpcS1AG55zi+ucc8B3pM=; b=rZf/4j5aRo3Ayi Cwby01w9dWvxE5Pca0sXKh7+Z4ZaZXb/i5wp/qXOTWoGKRILja1t2FMs/Jdoxi46kVC9kTWBzLOVA C1jJMmr0C4+Niyw8vQZU9zRbaH7rnrIfsOkWAPSvjKVcPJrOaqyMnydtpv+YDUF0Gibc8tJ/KH7HX WRfA7gqZZQee+s5eAlmJFHrDvL7LwRkCje7GbrvOAZSqwmNj1wMqo9vQna2haBPuD4SVP8apW2HaR YEg8DKIMO22aNVbKggN6vdO9CYhBZtbzDXXz9cjV15pUiHtKv7YAqgFmYA2kTDll2dHpYaVYHz6lN 0Eg8+EoVEt5WhXdzo6yA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4wR8-0004TT-Fv; Fri, 21 Feb 2020 00:44:58 +0000 Received: from esa2.hgst.iphmx.com ([68.232.143.124]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4wR3-0004P7-Na for linux-riscv@lists.infradead.org; Fri, 21 Feb 2020 00:44:55 +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=1582245913; x=1613781913; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yDncWfSp6M8/jssWUl+xy8MMegbv2C/ZuQ85YJQuEro=; b=aqYLMNEEJeVO9Yor1J5nHUBWRSMNbAGmu5u2RG9Y3Py968Bpy4hUmwr3 qgh1eCtkylhQWrTOdzDHw0aMwdLm9vh6i7xnt88v2SeQ2NNNOFeDXf87J p6xKXTV3hNapvibE/T2dIrQ+cP+vwUJZPnKWE+Zk68OfA9IXXjb6xW7Od 7gExvqK/riF394NC7/LGTPoPp9Sky56nmhPtt/kR/3UcpFk31BNRDo09l uSj+d6Qo82Tzoi9cmyUJakJ6q4UGNuA3sDnRQri/1WxK6YzBb5CKDMNx3 V34dqhEiA1zs0gkaMhAXajMdqIbYQ+S9YywRr0aYEH0uiuOjyXvEMBBD1 Q==; IronPort-SDR: YcHB2ketBYMBbDAIg+3263JBOloaZVJDzG2mvx/JnwBVfpehZkwOMSzZyo6P9Qf/eCIDGBcYpf cT963ZUms5w0bRlJNygO3OuUZm16IhbsqdOkudDakgUmPEUu5PzUJcgrVDyAe3gBJne0RlHR1M hwVCxBWr31+67G0NebIGi/cWCyOzHIbOkrrv0V5BMb5mLlK9+wkFaMSWHdSC7jh8j+6dr1Rf3a HPeaXz6jGr+PUUZMPACSozPuA1/0BA0mYcKzN35qCIE711bzm3Y16/GqKUuu7kObEhwpaf0SE2 KhQ= X-IronPort-AV: E=Sophos;i="5.70,466,1574092800"; d="scan'208";a="232211048" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 21 Feb 2020 08:45:01 +0800 IronPort-SDR: DkHpo3kOrKELizjo0lpVPI9EUG9U6Yk5kABaci1r6L+bETKc+jr9lXNt7bA1sLECE/+TM72LZQ 5x/7T+nME28eU9g/sCrCn9M8A7UyZJSyoY0M6qXN8Uw/bQd/7FxCl1bPSQsKADhFy5o8Ksz0Hj nwLaTvQD4H3xIdv/aYgSAldeeGacAJu+ChvcOH6fpEFMDmNS94zv2WICZ7YCUo8mhNnzrOJeTe p6F8XCacIYj99W5WG4DxqTN5vhPSfQWT0M1K7gU8ilOMzo4PNga28TxXph3rdo0D4k4tY/9Oer F+jbNyd+n1iKGivhlXm3Um+r Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 16:37:20 -0800 IronPort-SDR: IfdrrNTyj4t+AKKpRxnTg6JcpdXfCtjjWuHNYKLcUu3a6Mq4B20NpHVjyzpllVCNQ9N2srRaIh YWtlmlYy+rFyz+xE4/5bzS6///pijnsS6DjZH8MvGgcWxDFzAGIVfrsgEVNsNFuf7MntjV/Stn oB0Fmek9akLIggLEipsVR7oHnmMiV4ybr1nBHTTnbi0uVqSq1nPrpUiPstIJ5voozYVo6YXPCp gAOUJx4BnncKhgervowcJxho+0jjN79hguvhbgSvRaMfr9g2lU/8w0900ElEgivgpXovdfX9O5 xgE= WDCIronportException: Internal Received: from yoda.sdcorp.global.sandisk.com (HELO yoda.int.fusionio.com) ([10.196.158.80]) by uls-op-cesaip01.wdc.com with ESMTP; 20 Feb 2020 16:44:45 -0800 From: Atish Patra To: linux-kernel@vger.kernel.org Subject: [PATCH v9 01/12] RISC-V: Mark existing SBI as 0.1 SBI. Date: Thu, 20 Feb 2020 16:44:02 -0800 Message-Id: <20200221004413.12869-2-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200221004413.12869-1-atish.patra@wdc.com> References: <20200221004413.12869-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200220_164453_848493_BD336A73 X-CRM114-Status: GOOD ( 12.92 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rafael J. Wysocki" , Palmer Dabbelt , Heiko Carstens , Atish Patra , linux-riscv@lists.infradead.org, Kees Cook , Marc Zyngier , Daniel Lezcano , Mike Rapoport , Geert Uytterhoeven , Borislav Petkov , Mao Han , Albert Ou , Jason Cooper , Paul Walmsley , Thomas Gleixner , Nick Hu , Greg Kroah-Hartman , Vincent Chen , Palmer Dabbelt , "Eric W. Biederman" , Anup Patel Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org As per the new SBI specification, current SBI implementation version is defined as 0.1 and will be removed/replaced in future. Each of the function call in 0.1 is defined as a separate extension which makes easier to replace them one at a time. Rename existing implementation to reflect that. This patch is just a preparatory patch for SBI v0.2 and doesn't introduce any functional changes. Signed-off-by: Atish Patra Reviewed-by: Anup Patel Reviewed-by: Palmer Dabbelt --- arch/riscv/include/asm/sbi.h | 44 ++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 2570c1e683d3..b38bc36f7429 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2015 Regents of the University of California + * Copyright (c) 2019 Western Digital Corporation or its affiliates. */ #ifndef _ASM_RISCV_SBI_H @@ -9,17 +10,17 @@ #include #ifdef CONFIG_RISCV_SBI -#define SBI_SET_TIMER 0 -#define SBI_CONSOLE_PUTCHAR 1 -#define SBI_CONSOLE_GETCHAR 2 -#define SBI_CLEAR_IPI 3 -#define SBI_SEND_IPI 4 -#define SBI_REMOTE_FENCE_I 5 -#define SBI_REMOTE_SFENCE_VMA 6 -#define SBI_REMOTE_SFENCE_VMA_ASID 7 -#define SBI_SHUTDOWN 8 +#define SBI_EXT_0_1_SET_TIMER 0x0 +#define SBI_EXT_0_1_CONSOLE_PUTCHAR 0x1 +#define SBI_EXT_0_1_CONSOLE_GETCHAR 0x2 +#define SBI_EXT_0_1_CLEAR_IPI 0x3 +#define SBI_EXT_0_1_SEND_IPI 0x4 +#define SBI_EXT_0_1_REMOTE_FENCE_I 0x5 +#define SBI_EXT_0_1_REMOTE_SFENCE_VMA 0x6 +#define SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID 0x7 +#define SBI_EXT_0_1_SHUTDOWN 0x8 -#define SBI_CALL(which, arg0, arg1, arg2, arg3) ({ \ +#define SBI_CALL(which, arg0, arg1, arg2, arg3) ({ \ register uintptr_t a0 asm ("a0") = (uintptr_t)(arg0); \ register uintptr_t a1 asm ("a1") = (uintptr_t)(arg1); \ register uintptr_t a2 asm ("a2") = (uintptr_t)(arg2); \ @@ -43,48 +44,50 @@ static inline void sbi_console_putchar(int ch) { - SBI_CALL_1(SBI_CONSOLE_PUTCHAR, ch); + SBI_CALL_1(SBI_EXT_0_1_CONSOLE_PUTCHAR, ch); } static inline int sbi_console_getchar(void) { - return SBI_CALL_0(SBI_CONSOLE_GETCHAR); + return SBI_CALL_0(SBI_EXT_0_1_CONSOLE_GETCHAR); } static inline void sbi_set_timer(uint64_t stime_value) { #if __riscv_xlen == 32 - SBI_CALL_2(SBI_SET_TIMER, stime_value, stime_value >> 32); + SBI_CALL_2(SBI_EXT_0_1_SET_TIMER, stime_value, + stime_value >> 32); #else - SBI_CALL_1(SBI_SET_TIMER, stime_value); + SBI_CALL_1(SBI_EXT_0_1_SET_TIMER, stime_value); #endif } static inline void sbi_shutdown(void) { - SBI_CALL_0(SBI_SHUTDOWN); + SBI_CALL_0(SBI_EXT_0_1_SHUTDOWN); } static inline void sbi_clear_ipi(void) { - SBI_CALL_0(SBI_CLEAR_IPI); + SBI_CALL_0(SBI_EXT_0_1_CLEAR_IPI); } static inline void sbi_send_ipi(const unsigned long *hart_mask) { - SBI_CALL_1(SBI_SEND_IPI, hart_mask); + SBI_CALL_1(SBI_EXT_0_1_SEND_IPI, hart_mask); } static inline void sbi_remote_fence_i(const unsigned long *hart_mask) { - SBI_CALL_1(SBI_REMOTE_FENCE_I, hart_mask); + SBI_CALL_1(SBI_EXT_0_1_REMOTE_FENCE_I, hart_mask); } static inline void sbi_remote_sfence_vma(const unsigned long *hart_mask, unsigned long start, unsigned long size) { - SBI_CALL_3(SBI_REMOTE_SFENCE_VMA, hart_mask, start, size); + SBI_CALL_3(SBI_EXT_0_1_REMOTE_SFENCE_VMA, hart_mask, + start, size); } static inline void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask, @@ -92,7 +95,8 @@ static inline void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask, unsigned long size, unsigned long asid) { - SBI_CALL_4(SBI_REMOTE_SFENCE_VMA_ASID, hart_mask, start, size, asid); + SBI_CALL_4(SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID, hart_mask, + start, size, asid); } #else /* CONFIG_RISCV_SBI */ /* stubs for code that is only reachable under IS_ENABLED(CONFIG_RISCV_SBI): */ -- 2.25.0