mbox series

[v4,00/10] Add RISC-V support

Message ID 20181125233815.56392-1-agraf@suse.de
Headers show
Series Add RISC-V support | expand

Message

Alexander Graf Nov. 25, 2018, 11:38 p.m. UTC
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

Alex

Alexander Graf (10):
  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
  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       |   6 +-
 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 |  44 +++++
 grub-core/kern/riscv/dl.c          | 340 +++++++++++++++++++++++++++++++++++
 grub-core/kern/riscv/efi/init.c    |  77 ++++++++
 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         |  12 +-
 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/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              | 268 ++++++++++++++++++++++++++++
 util/grub-mknetdir.c               |   4 +-
 util/grub-mkrescue.c               |  16 +-
 util/grub-module-verifier.c        |  56 ++++++
 util/mkimage.c                     |  32 ++++
 51 files changed, 1891 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

Comments

Alexander Graf Dec. 23, 2018, 3:16 a.m. UTC | #1
On 26.11.18 00:38, Alexander Graf wrote:
> 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,


Ping? Looking forward to someone applying patches too :)


Alex

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
Daniel Kiper Jan. 17, 2019, 11:32 a.m. UTC | #2
Hey,

Sorry for late reply but I was not able to review the patches due to
other important work and holiday season. Now I am taking a stab at it
and I hope that it will land soon in the GRUB git tree.

On Mon, Nov 26, 2018 at 12:38:05AM +0100, Alexander Graf wrote:
> 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,


May I ask you to rebase the patch set on the latest upstream? Patch #9
does not apply. Additionally, git complain in the following way on the
patch #05: new blank line at EOF.

How to build this target? Where I can find compiler and binutils need
to build it?

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
Alexander Graf Jan. 22, 2019, 3:43 p.m. UTC | #3
On 17.01.19 12:32, Daniel Kiper wrote:
> Hey,

> 

> Sorry for late reply but I was not able to review the patches due to

> other important work and holiday season. Now I am taking a stab at it

> and I hope that it will land soon in the GRUB git tree.

> 

> On Mon, Nov 26, 2018 at 12:38:05AM +0100, Alexander Graf wrote:

>> 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,

> 

> May I ask you to rebase the patch set on the latest upstream? Patch #9

> does not apply. Additionally, git complain in the following way on the

> patch #05: new blank line at EOF.

> 

> How to build this target? Where I can find compiler and binutils need

> to build it?


SiFive has a precompiled toolchain that I just use for testing:

  https://www.sifive.com/boards/

I'm sure your distro of choice may also have compilers available.


Alex

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel