From patchwork Mon Jan 28 12:44:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 156725 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3386074jaa; Mon, 28 Jan 2019 04:45:17 -0800 (PST) X-Google-Smtp-Source: ALg8bN5kB25Zgrz4f5i3l5zskDy21oD2AEigRugsRLek7eFpBXTynRc2vx42Jxgib1W6YFZ9EyPk X-Received: by 2002:a5d:6710:: with SMTP id o16mr22412418wru.152.1548679517288; Mon, 28 Jan 2019 04:45:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548679517; cv=none; d=google.com; s=arc-20160816; b=hhOzUStirAV1wiKUkMv+42BP9PdQa8ZmhiuBHpLPn2MsO8Tfg8/2bovE06XztKBsii OIM+ZFMxFS47Se/03JTi7L2Gym1EfC2a+8RJEyWm5glxEMXISDiUQ3HjiZdvAMX4u8C9 V5EPOb54LX0F7d+aC1ubHysU+Y/YGam5dkuM3EkAMBSikwFE6JobSI2yvcKITIXe/Tmo k0vTaDm43zrHbcXajOYz0NEZ9fh5NyiA4Pztz+aHZWCyAhUl8mTLTiAcR2yf1Q/80teA 0W6+yZ2ktqLjvAOuHvPYQPIi4N0RX1cOqs0yp3Yi9ciGtrj6Q/iBPUr1A0TVtNJSn3S0 r2gw== 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:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from; bh=RHXxx/f7FJHDVIi10xSoWZrwz4+WwQhXnN3ub5OOJLM=; b=FtbttwP1gMNsMijOC2eun+yRRERwy4no381wCmX05mdikRNaAFiOP+3DhtTGZ/aCuG CXohW4tKSH9qJLjyw/aT5N9nXFIdR+70O6Auoowo8km0CGaaSfov0JKH/Yq0dXUMklnu 2oZ5fIbJomdSDbjENUeIRoJEZpt6YU7KEZ5S2AaoJYqu0h667JXX9m/xQUOiFkFA6jBi j7dx6ENNlh9jKkruxjXrCESrod/f0489mjW+budeqUEDo3disx4/x0FhwzbRNKHxcHDd RoDWD8dfRT27Yn2ify3qq44+pLWgj2Q6Gc6quv61kPrvG4K8I3+9rtDUjM+Nr1lQyLbn CRAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 187si28408539wma.1.2019.01.28.04.45.17 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Jan 2019 04:45:17 -0800 (PST) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org" Received: from localhost ([127.0.0.1]:59209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go6Hs-0007Wi-5s for patch@linaro.org; Mon, 28 Jan 2019 07:45:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go6He-0007Ql-1I for grub-devel@gnu.org; Mon, 28 Jan 2019 07:45:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1go6Ha-0003Wd-47 for grub-devel@gnu.org; Mon, 28 Jan 2019 07:45:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:59886 helo=mx1.suse.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1go6HY-0003Ky-71 for grub-devel@gnu.org; Mon, 28 Jan 2019 07:44:57 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 53874ACFA; Mon, 28 Jan 2019 12:44:48 +0000 (UTC) From: Alexander Graf To: grub-devel@gnu.org Subject: [PATCH v5 00/11] Add RISC-V support Date: Mon, 28 Jan 2019 13:44:36 +0100 Message-Id: <20190128124447.81028-1-agraf@suse.de> X-Mailer: git-send-email 2.12.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Cc: rickchen36@gmail.com, greentime , Andreas Schwab , David Abdurachmanov , leif.lindholm@linaro.org, atish.patra@wdc.com, Michael Chang , Alistair Francis , Lukas Auer , Paul Walmsley , Bin Meng , Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" As part of the plan for total world domination, we would like to make sure that booting on RISC-V is in a sane state before anyone goes and does quick hacks "just because". For that reason, U-Boot supports UEFI booting on RISC-V for a while now. This patch set is the second part of the puzzle, with grub learning how to deal with a UEFI enabled RISC-V target. The third bit (still missing) is to actually make a working Linux UEFI port. But that will come, I'm sure :). Looking forward to review feedback and testing, v1 -> v2: - adapt to new grub_open_file() API - adapt to new grub_create_loader_cmdline() API v2 -> v3: - fix riscv32 target v3 -> v4: - Rebase onto current git master - Change copyright from 2013 to 2018 - Coding style fixes - Add spec reference - Resurrect time reading code v4 -> v5: - Mark grub_arch_sync_dma_caches args as unused - Whitespace fix - Add spec link to mkimagexx.c - Remove curly braces - Use GRUB_EFI_LINUX_FDT_EXTRA_SPACE - Fix whitespace - s/failure/fail - Remove blank line at EOF - Add blank lines before and after license tag - New patch: RISC-V: Add libgcc helpers for clz Alexander Graf (11): efi: Rename armxx to arch PE: Add RISC-V definitions elf.h: Add RISC-V definitions RISC-V: Add setjmp implementation RISC-V: Add early startup code RISC-V: Add Linux load logic RISC-V: Add awareness for RISC-V reloations RISC-V: Add auxiliary files RISC-V: Add libgcc helpers for clz RISC-V: Add to build system fdt: Treat device tree file type like ACPI configure.ac | 28 ++- gentpl.py | 11 +- grub-core/Makefile.am | 12 ++ grub-core/Makefile.core.def | 29 +++ grub-core/commands/efi/shim_lock.c | 1 + grub-core/commands/file.c | 14 +- grub-core/kern/compiler-rt.c | 48 ++++- grub-core/kern/dl.c | 6 +- grub-core/kern/efi/mm.c | 2 +- grub-core/kern/emu/cache.c | 6 + grub-core/kern/emu/cache_s.S | 1 + grub-core/kern/emu/lite.c | 2 + grub-core/kern/riscv/cache.c | 63 +++++++ grub-core/kern/riscv/cache_flush.S | 44 +++++ grub-core/kern/riscv/dl.c | 340 +++++++++++++++++++++++++++++++++++ grub-core/kern/riscv/efi/init.c | 76 ++++++++ grub-core/kern/riscv/efi/startup.S | 48 +++++ grub-core/lib/efi/halt.c | 3 +- grub-core/lib/riscv/setjmp.S | 84 +++++++++ grub-core/lib/setjmp.S | 2 + grub-core/loader/arm64/linux.c | 10 +- grub-core/loader/arm64/xen_boot.c | 6 +- grub-core/loader/riscv/linux.c | 350 +++++++++++++++++++++++++++++++++++++ include/grub/arm/linux.h | 2 +- include/grub/arm64/linux.h | 2 +- include/grub/compiler-rt.h | 19 +- include/grub/dl.h | 6 +- include/grub/efi/api.h | 3 +- include/grub/efi/efi.h | 6 +- include/grub/efi/pe32.h | 5 + include/grub/elf.h | 58 ++++++ include/grub/file.h | 4 +- include/grub/misc.h | 3 +- include/grub/riscv32/efi/memory.h | 6 + include/grub/riscv32/linux.h | 41 +++++ include/grub/riscv32/setjmp.h | 27 +++ include/grub/riscv32/time.h | 28 +++ include/grub/riscv32/types.h | 34 ++++ include/grub/riscv64/efi/memory.h | 6 + include/grub/riscv64/linux.h | 43 +++++ include/grub/riscv64/setjmp.h | 27 +++ include/grub/riscv64/time.h | 28 +++ include/grub/riscv64/types.h | 34 ++++ include/grub/util/install.h | 2 + util/grub-install-common.c | 2 + util/grub-install.c | 28 +++ util/grub-mkimagexx.c | 259 +++++++++++++++++++++++++++ util/grub-mknetdir.c | 4 +- util/grub-mkrescue.c | 16 +- util/grub-module-verifier.c | 56 ++++++ util/mkimage.c | 32 ++++ 51 files changed, 1928 insertions(+), 39 deletions(-) create mode 100644 grub-core/kern/riscv/cache.c create mode 100644 grub-core/kern/riscv/cache_flush.S create mode 100644 grub-core/kern/riscv/dl.c create mode 100644 grub-core/kern/riscv/efi/init.c create mode 100644 grub-core/kern/riscv/efi/startup.S create mode 100644 grub-core/lib/riscv/setjmp.S create mode 100644 grub-core/loader/riscv/linux.c create mode 100644 include/grub/riscv32/efi/memory.h create mode 100644 include/grub/riscv32/linux.h create mode 100644 include/grub/riscv32/setjmp.h create mode 100644 include/grub/riscv32/time.h create mode 100644 include/grub/riscv32/types.h create mode 100644 include/grub/riscv64/efi/memory.h create mode 100644 include/grub/riscv64/linux.h create mode 100644 include/grub/riscv64/setjmp.h create mode 100644 include/grub/riscv64/time.h create mode 100644 include/grub/riscv64/types.h -- 2.12.3 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel