Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5527736ybv; Tue, 11 Feb 2020 17:53:38 -0800 (PST) X-Google-Smtp-Source: APXvYqxeg50Ju7WEDJz+DW5GJCKHbbGBt7btQ5zCzMxVVsEPGnV6oCB/QkOlTIdqlJ04tO6kRhRn X-Received: by 2002:a05:6808:218:: with SMTP id l24mr4525999oie.108.1581472418588; Tue, 11 Feb 2020 17:53:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581472418; cv=none; d=google.com; s=arc-20160816; b=ODEpQvTnj2QKv8q4tlO6jOE4oC/UsPwfX1fc0oj7Yy8Gg+Jg7RMIO8WtmF5jBn1svM 9/Gq6IWOI0cxoYxcRHb/rvswCbaBccvSnBMiLh1MQoxQx/yM9PL5MMFyeUs0mREgAVw6 /EIcVj5R/nfPBtwtK7GtBb4j6SioZMNKZQ7Bs531fD8V5ldigxz9ts4v2cG2ltzuIhHn AE0Wbh/DyUQEQKsJWnjZQc65VNYW9eZlObErJWv5eLFk1ckKK0xgn5WU9A/hcQ9OAw2J DaUxqdL1s+pP2BXIUnldR6oDFA/u3HytstjZ06cOkdUR1zVo7SBSQT5ID8Dh7quh4mXQ 8N6g== 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 :wdcironportexception:ironport-sdr:ironport-sdr:ironport-sdr :dkim-signature; bh=O+c9WUtL6/Lnv35RbuPb68w31uHNCt8mbEATKbG+Chg=; b=roQCDd2iv5O9i93eEfASMNfvP1nqtvTKJnjQ8nh7yy1Jrx0B87tpFmN6p7Pyi4XWGz tj+bFqM+CRpxPXUFGqxJcuVuEMMVk5J43z82iZ7h+TG0sMJ+ttzZc/WcbDtYb3F/Mumi wFueTBjaJdnoGfBIBkB+HmyCLIR4l2QlySAB2ObOaWYX4GK65sR2Z8D+AWMKJ/gMY08t s+XQEBv2hIjNaY+IRHoo0+ZC0EO73UoRJh4+55DzPiCCfTNMeE4rNsr/VcqmNIHoiaaP Myopcr48yYFqn1RHuPxkF4IKQY46BpuG2MhWeEjADOrYkWsvu3VlLVP3nAvV4bb/vvvb SuqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=YexTbUpZ; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12si2929698oti.162.2020.02.11.17.53.26; Tue, 11 Feb 2020 17:53:38 -0800 (PST) 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=@wdc.com header.s=dkim.wdc.com header.b=YexTbUpZ; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728207AbgBLBvy (ORCPT + 99 others); Tue, 11 Feb 2020 20:51:54 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:60368 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728073AbgBLBvy (ORCPT ); Tue, 11 Feb 2020 20:51:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1581472314; x=1613008314; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UorqLKP57b6PMCT+1VL4L6XYE1Vd36TEURwukvr+gSY=; b=YexTbUpZNo8Jjyor8jCRATIVeF4lhp1GVQuE8T9FpgxIPPWNVSur9oCI S3Q1QmZyrohmfMDTsUqEL86o/1mxSMPXEWQumSTSvLhKDaEZNn3yVIRYo b7KMdD2C7Q2teOvBektu5X9QeAw6W6wHjtknbUUSV2N+soJmvz6jlMKXO 1j3dlOeJtC+dXXQAUWZzt6u6khyJck4PjrnnsozN74vczGHFXMKnLN5go fYyobLndSZ6uirJLYTiNnleul5fYqLaa9oBLKO9VRNcJqDMbSc4DGwBUv tcpFu5+BMTaUs/VcmzX4z5l+arE3ETtFwi0/MSrBgChtazPi8+E1pqvJe A==; IronPort-SDR: 0W/RFhhfru2OMzlKS2nKBJOjdAHou/yl7BaNgZOY+Qk661r7Gq6BJBS+fVMDxShGAX9uekwNOS CIIKgRw0dBTFHMmwUQQfdhUvtARR1Wm9MjO6ptFXVWUT1BTg9aeLIRU2WmXTb8LZakp1bFFMsW KUV2xkEgaADlFvuufQGTqthkFrwXc/lloKiwDUAcreSAjMBWBSVV3ttUt9H/6jtaxq9BnUY6+6 w2pDKblhCWhxCdkocxKIukbWuxvV0z3PIzudPlBUHLoHc6HurnpNeOrZEs7htd+zwEiaCpWTEq n7M= X-IronPort-AV: E=Sophos;i="5.70,428,1574092800"; d="scan'208";a="237648931" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 12 Feb 2020 09:51:53 +0800 IronPort-SDR: DRr0o4P4Mo70SK7NzyLom7mdkCaXwL9mNlEkTUX9i6kR0R2RmSRHWDyfmGp1Vg1skhJCJELZME 76W6oAPN5ll9bArMhBLOjZgm+KRffCVnwqxXJqGbSbbq8ySCE1dPTv7jOASq7PAkHAbDLx4Nju 4bHCbD58usdC49oQXrxHrb4zsypW1s56uLmQq5F7bzCVu/VKOzXi/NcTjxk2Z37nZluHAlpeoc Zas6ggnW58MTm13p6T+9ufgmglgHnRSEnAAShK1II811aREQ2wuFbq03RMND2KQm4iVrIAq+kk iFPOsb83VLDmWBcqZw0tZ67g Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2020 17:44:43 -0800 IronPort-SDR: IgX0S216h6D2hbXGY3kVD1E13NZqxFPoY/weaf/bvPL3vzwQUsRDaGsf0mdAoaLn6rzv6uO+IF UNoSB0kSEEKGcM2k1Z4t/9O+Hvw822wgNz90VtehOIoZVX+/uolaNI+b28yos/dRG9nYCctnPm D85wxWVam6UlSDiVSTbCRl0csfeayWhXwY9Fd7kkVEUG1QkK6WDz7rvBMmbgwAKkCFL7uQrzCw eg1mgbOmSc56LXlk0pp2qojkrtaecT49mcAhYKp1mhjT+rnCh/S3ARkb70lEXChudHg9MvrZML tf4= WDCIronportException: Internal Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Feb 2020 17:51:53 -0800 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Anup Patel , Palmer Dabbelt , Albert Ou , Allison Randal , Borislav Petkov , Daniel Lezcano , "Eric W. Biederman" , Geert Uytterhoeven , Heiko Carstens , Jason Cooper , Kees Cook , linux-riscv@lists.infradead.org, Mao Han , Marc Zyngier , Marek Szyprowski , Michael Ellerman , Mike Rapoport , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Vincent Chen Subject: [PATCH v8 01/11] RISC-V: Mark existing SBI as 0.1 SBI. Date: Tue, 11 Feb 2020 17:48:12 -0800 Message-Id: <20200212014822.28684-2-atish.patra@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200212014822.28684-1-atish.patra@wdc.com> References: <20200212014822.28684-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.24.0