From patchwork Mon Feb 11 22:13:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Auer X-Patchwork-Id: 1040172 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aisec.fraunhofer.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43z0Sq297nz9sCh for ; Tue, 12 Feb 2019 09:14:35 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id EC766C22073; Mon, 11 Feb 2019 22:14:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 011FFC22002; Mon, 11 Feb 2019 22:14:31 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 79797C22002; Mon, 11 Feb 2019 22:14:29 +0000 (UTC) Received: from mail-edgeKA27.fraunhofer.de (mail-edgeka27.fraunhofer.de [153.96.1.27]) by lists.denx.de (Postfix) with ESMTPS id 1EED1C21FB1 for ; Mon, 11 Feb 2019 22:14:29 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2FbAAAO4PJb/xmnZsBiGgEBAQEBAgEBAQEHAgEBAQGBZYIEZnCNKIsdmz0NIwuEPoNwIjgSAQMBAQIBAQICAmkcDIJqTWsBAQEBAQEjAg2BHAFGgR4gDoMmAYIBD6hthC0BhWkFCQGHUIQrgVc/gRABhi0EGIIUhQ4CiwiUZwcCgRGBCQSEXIoiCxiJWIcljTmKXYFdIoFVMxokT4JtixuFPz4Bjw4BAQ X-IPAS-Result: A2FbAAAO4PJb/xmnZsBiGgEBAQEBAgEBAQEHAgEBAQGBZYIEZnCNKIsdmz0NIwuEPoNwIjgSAQMBAQIBAQICAmkcDIJqTWsBAQEBAQEjAg2BHAFGgR4gDoMmAYIBD6hthC0BhWkFCQGHUIQrgVc/gRABhi0EGIIUhQ4CiwiUZwcCgRGBCQSEXIoiCxiJWIcljTmKXYFdIoFVMxokT4JtixuFPz4Bjw4BAQ X-IronPort-AV: E=Sophos;i="5.56,253,1539640800"; d="scan'208";a="13360725" Received: from mail-mtadd25.fraunhofer.de ([192.102.167.25]) by mail-edgeKA27.fraunhofer.de with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2019 23:14:29 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0C0AgAq4PJb/xBhWMBiHAEBAQQBAQcEAQGBZYJqTyGNKKZaDSOESYQROBIBAwEBAgEBAm0cDIV1AUaBHiAOgyYBggEPqG2ELQGFagUJAYdQhgI/gRABhi0EGIIUhQ4CiwiUZwcCgRGBCQSEXIoiCxiJWIcljTmKXYFdIYFVMxokT4JtixuFPz4DjwwBAQ X-IronPort-AV: E=Sophos;i="5.56,253,1539640800"; d="scan'208";a="31721288" Received: from fgdemucivp01ltm.xch.fraunhofer.de (HELO FGDEMUCIMP11EXC.ads.fraunhofer.de) ([192.88.97.16]) by mail-mtaDD25.fraunhofer.de with ESMTP/TLS/AES256-SHA; 11 Feb 2019 23:14:26 +0100 Received: from localhost.de (10.80.233.50) by FGDEMUCIMP11EXC.ads.fraunhofer.de (10.80.232.42) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 11 Feb 2019 23:16:13 +0100 From: Lukas Auer To: Date: Mon, 11 Feb 2019 23:13:37 +0100 Message-ID: <20190211221345.31980-1-lukas.auer@aisec.fraunhofer.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-11.0.0.4179-8.200.1013-24422.005 X-TM-AS-Result: No--4.863600-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Cc: Baruch Siach , Palmer Dabbelt , Andreas Schwab , Alexander Graf , Stefan Roese Subject: [U-Boot] [PATCH 0/7] SMP support for RISC-V X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch series adds SMP support for RISC-V to U-Boot. It allows U-Boot to run on multi-hart systems and will boot images passed to bootm on all harts. The bootm command is currently the only one that will boot images on all harts, bootefi is not yet supported. The patches have been successfully tested on both QEMU (machine and supervisor mode) and the HiFive Unleashed board [1] (supervisor mode), using BBL and OpenSBI. Mainline QEMU requires two patches [2, 3] to run in this configuration. I will send a follow-up patch to enable SMP support on the HiFive Unleashed board. [1]: https://patchwork.ozlabs.org/project/uboot/list/?series=91125 [2]: https://patchwork.ozlabs.org/patch/1039493/ [3]: https://patchwork.ozlabs.org/patch/1039082/ Lukas Auer (7): riscv: add infrastructure for calling functions on other harts riscv: import the supervisor binary interface header file riscv: implement IPI platform functions using SBI riscv: delay initialization of caches and debug UART riscv: add support for multi-hart systems riscv: boot images passed to bootm on all harts riscv: qemu: enable SMP arch/riscv/Kconfig | 36 +++++++++ arch/riscv/cpu/start.S | 116 +++++++++++++++++++++++++-- arch/riscv/include/asm/csr.h | 1 + arch/riscv/include/asm/global_data.h | 5 ++ arch/riscv/include/asm/sbi.h | 94 ++++++++++++++++++++++ arch/riscv/include/asm/smp.h | 53 ++++++++++++ arch/riscv/lib/Makefile | 2 + arch/riscv/lib/bootm.c | 13 ++- arch/riscv/lib/sbi_ipi.c | 25 ++++++ arch/riscv/lib/smp.c | 110 +++++++++++++++++++++++++ board/emulation/qemu-riscv/Kconfig | 1 + 11 files changed, 447 insertions(+), 9 deletions(-) create mode 100644 arch/riscv/include/asm/sbi.h create mode 100644 arch/riscv/include/asm/smp.h create mode 100644 arch/riscv/lib/sbi_ipi.c create mode 100644 arch/riscv/lib/smp.c