Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4577948ybc; Tue, 26 Nov 2019 11:06:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxSeWHob40WTd9kX5wwSlkEIzBENToBJnBeveohqbz6F6mCmFGud/8TbPaTIJQBAx2uNzxi X-Received: by 2002:a50:9976:: with SMTP id l51mr21121976edb.6.1574795218733; Tue, 26 Nov 2019 11:06:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574795218; cv=none; d=google.com; s=arc-20160816; b=Jk0tQpzkeZTTqNnBYcPKTu74jOA5HsUv8SOnnuhjpyb4taSrbXdmiRcnjZNDI33Un4 LX/rhG0+FlCoPASUexkKcPFdWDp7eMZmmljwWFiHxgUJkKbaBw9lJ8a9gFOislRCMvbC 1vDnvjTQFCAlw+2JywU7IkVCjh40jzrau5XFomHd2I4TGxtEzopv9jP5LpyYqT7tqDGF uQy2s4hUU8wK/nZeaF2GmbCbkc2X5Q90P+UOkTsGtt2FgsuxQn/zpo6L/pTVblRzwd6w mNi9hXmxjjEgJZ1tl6uA8tLBWMj9fmFwhk81fHjy+o1pvPWUx4nmXSSmvN6qj960EJbw 8H3g== 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=z4oeCcJW1D8KpIBmPnkFLylbfTLvnkHhJ6xLYXs0lxE=; b=c6pv9HTt/55sgjwzd5qfLEY2Ua1Nkwr/XbBiFtNdtk5aCwychRqa7dybj7CHoWc+5X cw0SE133oQm1YX8h//G4/W136FKWF8i6XwfEmNjUfYm5ZUHfuoTfZYAmv5TVz08bc/iM e2W4RfJ/JxzVlgGTt0DtPa9EiAkS2vopBMCz5mZ2ci/AwQ++juJRRyAeeTaqSuJeD0+x 07o+qirc/6nfnanJFXHs0NeoD6ex9o41wF1JGnjc41MX25DkjArVbtC8OA/jJZeZPIeK cyCKXMdvSSq6ZhMU4fzhtPAw0af6eUaXvj4F7TQQmk04WG57nU/f0SNLmrnkMrD7xeLX RYdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=eSm7y2tL; 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 w27si8991355eda.296.2019.11.26.11.06.33; Tue, 26 Nov 2019 11:06:58 -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=eSm7y2tL; 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 S1727184AbfKZTFa (ORCPT + 99 others); Tue, 26 Nov 2019 14:05:30 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:62441 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726103AbfKZTF3 (ORCPT ); Tue, 26 Nov 2019 14:05:29 -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=1574795130; x=1606331130; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HnPViwKE8q6vsQja/SLcMxaJaNrdHJyfCbZPbQBXsAA=; b=eSm7y2tLtOcN5j2B2WNoaQIH9FlyZG3Ms57sN88G9KA/keRbgmHuqA6E A820dJ8JxGNhs9vGM7EozbVnyJXs+A0CnVrLBw4r9s67j8y3leOrp1RRn dqpJndt6s6aU16B3YMbVeyjtECeYRR1+q5gMApZqmLIsGfyn8YXcy00vW VxYa9rXlg5XcZpbU6GZkHB3m+7c+itTvIRkSCY6sWBRMpr0EHMOuKfamu DIGfQJNFDsyooJYwg6G4/4hZNp1eeuyWGwMsr6y0e4OSdCyZoakfmoSif YmkLQ26Omwj/r2MaUCXZUyLslyjoYvV5s8UVfcJEgBRdgAsQjh9O3cmSh Q==; IronPort-SDR: 3aSTlAIMffnB0C2yzUnTPJgFSBHDZmoLlQSrAS58IVY9UtXIN+QYEHIc6n9V8ozuO/G97O1Wvz 9KoGASs//M69mf3ZJN35hHq9onhSoi7CDHEN7EZ9E12zCCRvifHU6uo8XDK3KxMEH3VhGpMCJY N+jVa/GVwSLuoBGNzaYaaUkbUwM1PcQpcdr+NxQ55XF+UMtD4cl1kcuuKrZzdHMh551s/DTenG HENTYfnbAjTBk630YdV2AfibdPeliwfwv0T8VjMdyxvw3ZhQbaBvprHGQBo/UMG0qfuiakz8VH 0QQ= X-IronPort-AV: E=Sophos;i="5.69,246,1571673600"; d="scan'208";a="128481927" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 27 Nov 2019 03:05:29 +0800 IronPort-SDR: G300zk5B1HgVxiP6MSOvGv0xKl1pZNFvHUn03z62xMpx3/gE3ZK+oAtcVnW8lB5blpXmYQJBNM d13I4pc5YwShPXJrT03rhigNQ6yVOXcmQZsq5DjWh2VARBlJodq7uuP6Pxp0OOAI/GKXd7s3Li SEmssTAvskIfoCYonUHR9xP5dR20YWe2bWFlq36hrMBZrKuOMNWhW7faCFBS1Vrq+Du+64Xy8H fccOgLF4jVm8yn4MXlMmXpvrPGC+2Mc12qM+FiPqAdvT2gu+zczlPS1Ro39f022rJy9dGjUfF9 xLZvJH/nmJ+KEcJu99yrdsI9 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2019 11:00:06 -0800 IronPort-SDR: +fNXAONKPxiOyyg760c6ywWcik4PfVQ89SFSiUYCSVPe4Yp8p6Zt9COP8A6SEJjvgPo1uHedUG Noan6hbm7yo3Gs3251nh/bb0bKFzUM+6K3IW2lZcuGdpKpFxVmthRaN+7END7NUzm7+1V8E7HW 2bSQpgtZUAkNgJF+PR/InL8z4hqIOlokSWGreLlsVe3Ct++mWwvCHDheGzboE9jMYs1Ulkt/ke JxCNWj4DwdXUCiuCbvO7+AMXhwZQ96kjxS7MAw+d3ejAUHioZT3MCVSfUzNp3F+U1xEvUB8mlX H/Y= WDCIronportException: Internal Received: from usa003951.ad.shared (HELO yoda.hgst.com) ([10.86.50.226]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Nov 2019 11:05:29 -0800 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Anup Patel , Albert Ou , Alexios Zavras , linux-riscv@lists.infradead.org, Mao Han , Mike Rapoport , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner Subject: [PATCH v5 1/4] RISC-V: Mark existing SBI as 0.1 SBI. Date: Tue, 26 Nov 2019 11:05:00 -0800 Message-Id: <20191126190503.19303-2-atish.patra@wdc.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191126190503.19303-1-atish.patra@wdc.com> References: <20191126190503.19303-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 --- arch/riscv/include/asm/sbi.h | 43 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 2570c1e683d3..96aaee270ded 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -9,17 +9,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 +43,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 +94,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.23.0