From patchwork Thu Apr 19 15:49:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 133834 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp792746ljf; Thu, 19 Apr 2018 08:54:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx49+LhgfU9bjsLsQo13lxsT3MfA4XB7jKrmZBGvLv9UGONbr79exxiTmrIaYPTyfV0nu986z X-Received: by 10.80.142.9 with SMTP id 9mr9146287edw.101.1524153255039; Thu, 19 Apr 2018 08:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524153255; cv=none; d=google.com; s=arc-20160816; b=ylIsb5h2qCJe5KeEyBqpJq68iPQgvwbTKNYs1YUjZ7T3SxPIbsbhIIABO9MHJoLGVG iDGjCkqra8O631Pmq2d95h30w5nIRoVCGwtnolMoyqyqMiSXrheZmCt1gY8UwfY9XjC8 1ZMQlW60kFek6AA/K3lzoEhRnY2sj1Xfodnp+vVkQgaEipvaWbpxQFTzrAtvdZk8hcYV Hm7QUG7kWSAi1CGHj9hAbjh7hhc0ohgYuaqqpH31kJxrBljDNxTPVdDUXd13G+phrh1e 1cA5K3uPQdKYNKM9fCiyE44cHxVOv3tKIP99aJqO03UjuNwPTTPq5YeAFpfRiR7o4xUX exLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :arc-authentication-results; bh=dJMHfUHwEa0ki+IlvST5sL0IXz4CanJ1FflNF21Nh7I=; b=n21INc2q5UhABGLaz18aYb/mhdP5x/UWSSFlfH93gJoWAdb6J34kopfhZ3GOtofQsT jADog4g5UxWaAr6nj0dvctR/LgY0khSY80skLm3cHji13CCmnJGx1DIZpqVCwigW5yum /HprT4uK5m/kWK72X6LFgOpqs09z0Hr3WStKPm5MIcuQbZkNvH4P4tSQCdKLQ1q5ugfJ 9WTHObEm0sjNCk4tFXim0oWRyn9AR2bXAej/GJhtWs/jjcpCQ1aO6fnciGGXYLd0UKP7 +ZxdhDrDeEbCnUKjot1ucITYHpbLGkz05AJBjHqvLEzlULOYntI3BqKgy/uXdqrphG91 wo+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id j8si3074495edj.26.2018.04.19.08.54.14; Thu, 19 Apr 2018 08:54:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 796B1C21FB2; Thu, 19 Apr 2018 15:51:33 +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=RCVD_IN_DNSWL_BLOCKED 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 095B0C22007; Thu, 19 Apr 2018 15:49:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A676CC21C38; Thu, 19 Apr 2018 15:49:27 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 84F88C21C38 for ; Thu, 19 Apr 2018 15:49:25 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 22471AF7C; Thu, 19 Apr 2018 15:49:25 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 19 Apr 2018 17:49:15 +0200 Message-Id: <20180419154923.70719-1-agraf@suse.de> X-Mailer: git-send-email 2.12.3 Cc: Heinrich Schuchardt , schwab@suse.de, Greentime Hu Subject: [U-Boot] [PATCH v2 0/8] riscv: Enable efi_loader support 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" We now have RISC-V support in U-Boot - which is great! However, not that we're finally making progress to converge on efi_loader and distro boot for booting on ARM platforms, we really want to make sure there is no technical reason not to do the same on RISC-V as well. So this patch set introduces distro boot and efi_loader support for RISC-V! So far, I've only tested it with the selftest and hello world target in U-Boot, as the number of target binaries to run is still slim. But it should at least give us a good starting point. v1 -> v2: - Allow 32bit target - Also save/restore ra, sp - Use edk2 default boot file names - Enable hello world binary - remove patch: efi_loader: selftest: Do not build relocation tests for risc-v - new patch: riscv: Add EFI application infrastructure Alexander Graf (8): riscv: Add setjmp/longjmp code riscv: Enable function sections riscv: Add EFI application infrastructure riscv: Add board_quiesce_devices stub efi_loader: Use EFI_CACHELINE_SIZE in the image loader too distro: Extend with RISC-V defines riscv: nx25: Enable distro boot efi_loader: Enable RISC-V support arch/riscv/config.mk | 7 ++- arch/riscv/cpu/nx25/u-boot.lds | 16 ++++++ arch/riscv/include/asm/setjmp.h | 26 ++++++++++ arch/riscv/include/asm/u-boot-riscv.h | 1 + arch/riscv/lib/Makefile | 12 +++++ arch/riscv/lib/bootm.c | 4 ++ arch/riscv/lib/elf_riscv32_efi.lds | 70 +++++++++++++++++++++++++ arch/riscv/lib/elf_riscv64_efi.lds | 70 +++++++++++++++++++++++++ arch/riscv/lib/reloc_riscv_efi.c | 97 +++++++++++++++++++++++++++++++++++ arch/riscv/lib/setjmp.S | 66 ++++++++++++++++++++++++ cmd/Kconfig | 2 +- configs/nx25-ae250_defconfig | 1 + include/config_distro_bootcmd.h | 14 ++++- include/configs/nx25-ae250.h | 17 ++++++ include/efi_loader.h | 7 +++ lib/efi_loader/Kconfig | 2 +- lib/efi_loader/efi_image_loader.c | 2 +- lib/efi_loader/efi_runtime.c | 48 ++++++++++++----- 18 files changed, 445 insertions(+), 17 deletions(-) create mode 100644 arch/riscv/include/asm/setjmp.h create mode 100644 arch/riscv/lib/elf_riscv32_efi.lds create mode 100644 arch/riscv/lib/elf_riscv64_efi.lds create mode 100644 arch/riscv/lib/reloc_riscv_efi.c create mode 100644 arch/riscv/lib/setjmp.S