From patchwork Tue Nov 6 17:58:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 150339 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4208441ljp; Tue, 6 Nov 2018 10:12:46 -0800 (PST) X-Google-Smtp-Source: AJdET5fFE4rJBNANi90leXmZ4E+4KOdGTgDy7GB7hvavV3wlyA/gl6eaocrBiyKR/kpAFxPI2nth X-Received: by 2002:a0c:e486:: with SMTP id n6mr27395251qvl.210.1541527966174; Tue, 06 Nov 2018 10:12:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541527966; cv=none; d=google.com; s=arc-20160816; b=rdjr/tV9Zi9Da/bNQqNKpX+89pJjUNgzG9SWYyLuXy3Axowdoz6Auxb4pOh7njXji4 RE5eqWKZJlTcohHVC/fgW0QuRe5Chx4O6P55yZeciTzRrgmGSYpvWtkopWvkas9pqIBq QkiJ4Kdc3NpDmSyn1KmrEReroRAolJUDSoObvWfkhB/JaDvTiW5xcdZ0PT8FvEZz2jBo V4KsYUnGBFuq03bUgtKa6t3zic+H7Y8bffWgMlYDlSVNEddrJicM3oNrAPYnovagCsm7 JYYk6XN0Y1RypYRaHjoUUbvYKYQQMOHQkZYpavWxrtmevWpJ3Qqw3L5AytVQeaCoHHKm 0Rgw== 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=vIa/lUIS3abUT2/7UL5y0YZN9yqSdebIYMiqPLmSNkw=; b=QkIO6isNWXgXmwEHg2Nzpa7PomreLB8NR0Y9JLO2tmfJlyfR+JALkUmMMMPrIq+c+7 voURMz33KvyRr4RdhqQfXEvATKFHHLosfX3QFxfAKDC4svdGbHHZ5DJpe4pqDE+pHHJk TAexmysaHJL+dJCA8mUruenF7J6cuGsxUa/biHZJ8FwUcO3nY9/HzgxiIbNAljk/FTYU i2WjJIjaqJ2VWFOQdWafOWc1n1Ztp3hf62AT4vAb28ByE6NkEHlkWWBlAvxi9QvPkMi4 jVNq63WxDIQIGtm9qElNjKRlPjtzUMfvmFZaDr/IooN5H5wU75t80MHOJ45hzsgUmN+j LrCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f46si3977793qta.336.2018.11.06.10.12.45 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 06 Nov 2018 10:12:46 -0800 (PST) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org" Received: from localhost ([::1]:42455 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK5qH-0002tR-Fk for patch@linaro.org; Tue, 06 Nov 2018 13:12:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK5nc-0007VA-MS for grub-devel@gnu.org; Tue, 06 Nov 2018 13:10:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gK5cw-0003Y7-89 for grub-devel@gnu.org; Tue, 06 Nov 2018 12:59:00 -0500 Received: from mx2.suse.de ([195.135.220.15]:38024 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 1gK5cs-0002un-9q for grub-devel@gnu.org; Tue, 06 Nov 2018 12:58:56 -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 881D2AD72; Tue, 6 Nov 2018 17:58:39 +0000 (UTC) From: Alexander Graf To: grub-devel@gnu.org Subject: [PATCH 0/9] Add RISC-V support Date: Tue, 6 Nov 2018 18:58:28 +0100 Message-Id: <20181106175837.9083-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" , David Abdurachmanov , schwab@suse.de, "greentime @ andestech . com" , leif.lindholm@linaro.org, atish.patra@wdc.com, Michael Chang , Alistair Francis , Lukas Auer , Paul Walmsley , Bin Meng 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, Alex Alexander Graf (9): 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 to build system configure.ac | 28 ++- gentpl.py | 9 +- grub-core/Makefile.am | 12 ++ grub-core/Makefile.core.def | 29 +++ grub-core/commands/file.c | 14 +- grub-core/kern/compiler-rt.c | 3 +- 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 | 64 +++++++ grub-core/kern/riscv/cache_flush.S | 40 +++++ grub-core/kern/riscv/dl.c | 335 +++++++++++++++++++++++++++++++++++ grub-core/kern/riscv/efi/init.c | 82 +++++++++ grub-core/kern/riscv/efi/startup.S | 49 ++++++ grub-core/lib/efi/halt.c | 3 +- grub-core/lib/riscv/setjmp.S | 82 +++++++++ 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 | 351 +++++++++++++++++++++++++++++++++++++ include/grub/arm/linux.h | 2 +- include/grub/arm64/linux.h | 2 +- include/grub/compiler-rt.h | 6 +- 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 | 59 +++++++ 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 | 268 ++++++++++++++++++++++++++++ util/grub-mknetdir.c | 4 +- util/grub-mkrescue.c | 16 +- util/grub-module-verifier.c | 56 ++++++ util/mkimage.c | 32 ++++ 48 files changed, 1875 insertions(+), 32 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