Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2750914ybn; Thu, 26 Sep 2019 17:15:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqx83rdR7R8MlNF1msS14smvcrT86uGgYoHwLu7KFCCV3GJyc4n3mTbiqAPlCxEEi6Lv/mit X-Received: by 2002:a50:fd01:: with SMTP id i1mr1670612eds.184.1569543357280; Thu, 26 Sep 2019 17:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569543357; cv=none; d=google.com; s=arc-20160816; b=Kl2DCqtQSTkHue16fF63tgMj7YKbaU7k+U+xZ62O3lrWAQDRZTrmYHWbqtZd24zZ6C LsU+Jo3yD+yWu0OOJMhqjgkXmByMA6DXmaI9mh3VFQgAb6fv2uSAN6lBkyCpS0gf8HC0 pRd4w/dZh5QS2x3n0wDWJ9H6RJLn/YdOC0j25B4V4ANloZ6SdCHDnxHbRffmC+5BwbEO REWcrKJk8sRdk0STZuJHY1ZI6+CHLVZYK/A05GcKdklpHYOzoi1CaT36Fhz4YDFGcDV3 qjdqqPftrPxGAFhxshMvoVKU9InIWUy2SLBjLti+YpBmpbAJldQGdkqmsn0ixfZmrUfs dRhQ== 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 :message-id:date:subject:cc:to:from:wdcironportexception :ironport-sdr:ironport-sdr:ironport-sdr:dkim-signature; bh=S9jMEY8v8U1bjXmaeqaTDgR/BCFPLFDZAbxc1zK5CQg=; b=bcNNJZT4aB8UepdF+F3IjVICzCT4ANCYWYJgLEIHe2S2kAewlYLC0MCcaZiuMOR/R+ K6GOypIk7b2/ZoWuEj0NLkGN8+JoW6o8aVvGuB1oDXCUtdHIKPhhoYXmIfHcSgsyzPwH QFCKgia6OMuT6v1KiYRRlcoWj1V5GZaNDIQJIL5sKHVVSMrCG+UTGtuXNLkydhKdL+sa uNjklXffnyLtXOPf/rYyRx19idGPh69OWLaTvJ98jzWaF2tyXOdSz+Ke5IAThq8RjAT5 //gBeMrv/oJD2HDirawClQ3IffZ7WVvgzcejIYT3PuTzj2kr7Xwk9LQNcl0bxIc5Wy8s 0jWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=Ej7e0p2a; 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 l22si594127edb.241.2019.09.26.17.15.32; Thu, 26 Sep 2019 17:15:57 -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=@wdc.com header.s=dkim.wdc.com header.b=Ej7e0p2a; 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 S1726205AbfI0AJ0 (ORCPT + 99 others); Thu, 26 Sep 2019 20:09:26 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:38047 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbfI0AJ0 (ORCPT ); Thu, 26 Sep 2019 20:09:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1569542987; x=1601078987; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=s8wencevRmeMDEGXC4oPCf69aZsPiCihnU+edmEPkWw=; b=Ej7e0p2aEbWVXAsiilTlTU+D0X/cIIOIIjZbJO9DaDH4BrDlwCKrcInw r+giZM579t717orVxTyTbQzsq4V/9+tx3CQqEDGVBOXCnX0/B+ZFBdo9p Wy0wcnlGwXa5zStQ6qxyOT98NBmEp4mxzqHPilLIcvEzJeFFRFqn9G0mo 1rlJ2o6Z7y65gvjbSolCPG1wTbEh/K7UYQXkUjEtpoMwYJ/pb4PZCdqsq Z1I2uy4gSNpHMt3s9yUlsgJUKuozMoJfqF5iBxJ6dLIX+VBtjvQAmbNXw 1810aLRghtfYObQYaEShpcWH8qZJVd0kVYh2RJsoMC8uJP+SjjmlTnZ5z A==; IronPort-SDR: hiueuz5vIpbAgMw++JQJQGVPQB+OGa7P2eMSBl1mqi0YPS7k4mCe+ZVfO2AxeZV4DdtDWGuBFv Uv+D7t873M0aVxV8whPGui/vInVPdSzZTvZlqIffBVstjUheTLTVnTVPRAjNVe0LSKFxstfIRW 7qIIBpsoFctIXGk4VwYWpAvA5ZPph03RTHu71GPEVkdypV/GU3yu3GKbSxRQmolJiBmPtGIT9o Mpo/4VoTYG6nOPn/EUZbih7uj3l02KE6+bY1SaT5hY8kjr8gBBPvH4KQeumZPr3MimDf8B3E7e dO4= X-IronPort-AV: E=Sophos;i="5.64,553,1559491200"; d="scan'208";a="220096732" 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 Sep 2019 08:09:45 +0800 IronPort-SDR: 8Yj5RDTQbH6D1JaWmeOYjj2sU1NhrtzL74OSNqBXhIJ++CufH4ZSdKVje7LPt9fQKci4N2k4N0 JF1LKnUXExZHSeJAWtzLlR5nP1ZtnhZvd+/ZgJGR0uuH8Vk4tGNkYsr4LAe7klyTV671Mi0bb7 sb+yTfgpZzlj3o0rUG9g8YvQNBdnzdMCjt4iS8saHVltLmeo6+HwCrWfdRDnrATwp3KvSSBrXJ Do+n56/tS5R+I9XXu4mRb3y1EP0jYb9Mj6tcJ+WxFFLRnGVVAkYSQRfnPZoAFUfRYUpL8z753K uJdYJ2rq2Ff7KLEfR9ncCpD7 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2019 17:05:45 -0700 IronPort-SDR: T01SUBszgnCFFTpYhAutlE/F0IhOeeTfpSKFyhZjg4LICu9Mvq8KbW/RSMGwTOz4weUwIa+U+2 43KU9rdSbkurKSoj5OJZKqdeCoSNyVuew2CNR10B2W6uLePqS1TAOgAJpV+5/qU3VvsiwY3zm4 BVB677+W3j0uE0iCNAZUiOKM///VB5QXiEwBT/MI3DhWhTOkjVpelMQbxgZgXvr60ToiHjuOUg WooKN/v+KeFPwlWv6CWkN4Btgt53KdeLVhRyk2wlt6UTdyehcKt8tpslx0z+oV5EN7JR+edF/f WzA= WDCIronportException: Internal Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip01.wdc.com with ESMTP; 26 Sep 2019 17:09:24 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Alan Kao , Albert Ou , Allison Randal , Anup Patel , Gary Guo , Greg Kroah-Hartman , linux-riscv@lists.infradead.org, Mike Rapoport , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner Subject: [PATCH v2 0/3] Add support for SBI v0.2 Date: Thu, 26 Sep 2019 17:09:12 -0700 Message-Id: <20190927000915.31781-1-atish.patra@wdc.com> X-Mailer: git-send-email 2.21.0 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 The Supervisor Binary Interface(SBI) specification[1] now defines a base extension that provides extendability to add future extensions while maintaining backward compatibility with previous versions. The new version is defined as 0.2 and older version is marked as 0.1. This series adds support v0.2 and a unified calling convention implementation between 0.1 and 0.2. It also adds minimal SBI functions from 0.2 as well to keep the series lean. [1] https://github.com/riscv/riscv-sbi-doc/blob/master/riscv-sbi.adoc The SBI v0.2 support for OpenSBI is already available at https://github.com/atishp04/opensbi/tree/sbi_v0.2_2 and in the OpenSBI mailing list. Tested on both BBL, OpenSBI with/without the above patch series. Changes from v1->v2 1. Removed the legacy calling convention. 2. Moved all SBI related calls to sbi.c. 3. Moved all SBI related macros to uapi. Atish Patra (3): RISC-V: Mark existing SBI as 0.1 SBI. RISC-V: Add basic support for SBI v0.2 RISC-V: Move SBI related macros under uapi. arch/riscv/include/asm/sbi.h | 109 +++++--------- arch/riscv/include/uapi/asm/sbi.h | 48 ++++++ arch/riscv/kernel/Makefile | 1 + arch/riscv/kernel/sbi.c | 241 ++++++++++++++++++++++++++++++ arch/riscv/kernel/setup.c | 2 + 5 files changed, 328 insertions(+), 73 deletions(-) create mode 100644 arch/riscv/include/uapi/asm/sbi.h create mode 100644 arch/riscv/kernel/sbi.c -- 2.21.0