From patchwork Thu Mar 26 16:04:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 244332 List-Id: U-Boot discussion From: bmeng.cn at gmail.com (Bin Meng) Date: Thu, 26 Mar 2020 09:04:52 -0700 Subject: [PATCH 1/3] Dockerfile: Install riscv32 toolchain from kernel.org Message-ID: <1585238694-2714-1-git-send-email-bmeng.cn@gmail.com> This is required to build GRUB UEFI target for RISC-V 32-bit. Signed-off-by: Bin Meng --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 32d43f7..dc9d6c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_ RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/7.3.0/x86_64-gcc-7.3.0-nolibc_microblaze-linux.tar.xz | tar -C /opt -xJ RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/7.3.0/x86_64-gcc-7.3.0-nolibc_nios2-linux.tar.xz | tar -C /opt -xJ RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/7.3.0/x86_64-gcc-7.3.0-nolibc_powerpc-linux.tar.xz | tar -C /opt -xJ +RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/7.3.0/x86_64-gcc-7.3.0-nolibc_riscv32-linux.tar.xz | tar -C /opt -xJ RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/7.3.0/x86_64-gcc-7.3.0-nolibc_riscv64-linux.tar.xz | tar -C /opt -xJ RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/7.3.0/x86_64-gcc-7.3.0-nolibc_sh2-linux.tar.xz | tar -C /opt -xJ From patchwork Thu Mar 26 16:04:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 244333 List-Id: U-Boot discussion From: bmeng.cn at gmail.com (Bin Meng) Date: Thu, 26 Mar 2020 09:04:53 -0700 Subject: [PATCH 2/3] Dockerfile: Build GRUB UEFI target for RISC-V 32-bit In-Reply-To: <1585238694-2714-1-git-send-email-bmeng.cn@gmail.com> References: <1585238694-2714-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1585238694-2714-2-git-send-email-bmeng.cn@gmail.com> Build GRUB UEFI target grubriscv32.efi. Signed-off-by: Bin Meng --- Dockerfile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dc9d6c9..a19067e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -96,7 +96,7 @@ RUN wget http://mirrors.kernel.org/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.4-1_amd # Manually install a new enough version of efitools (must be v1.5.2 or later) RUN wget http://mirrors.kernel.org/ubuntu/pool/universe/e/efitools/efitools_1.8.1-0ubuntu2_amd64.deb && sudo dpkg -i efitools_1.8.1-0ubuntu2_amd64.deb && rm efitools_1.8.1-0ubuntu2_amd64.deb -# Build GRUB UEFI targets grubarm.efi and grubaa64.efi +# Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub && \ cd /tmp/grub && \ git checkout grub-2.04 && \ @@ -143,6 +143,20 @@ RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub && \ lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \ search search_fs_file search_fs_uuid search_label serial sleep test \ true && \ + make clean && \ + ./configure --target=riscv32 --with-platform=efi \ + CC=gcc \ + TARGET_CC=/opt/gcc-7.3.0-nolibc/riscv32-linux/bin/riscv32-linux-gcc \ + TARGET_OBJCOPY=/opt/gcc-7.3.0-nolibc/riscv32-linux/bin/riscv32-linux-objcopy \ + TARGET_STRIP=/opt/gcc-7.3.0-nolibc/riscv32-linux/bin/riscv32-linux-strip \ + TARGET_NM=/opt/gcc-7.3.0-nolibc/riscv32-linux/bin/riscv32-linux-nm \ + TARGET_RANLIB=/opt/gcc-7.3.0-nolibc/riscv32-linux/bin/riscv32-linux-ranlib && \ + make && \ + ./grub-mkimage -O riscv32-efi -o /opt/grub/grubriscv32.efi --prefix= -d \ + grub-core cat chain configfile echo efinet ext2 fat halt help linux \ + lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \ + search search_fs_file search_fs_uuid search_label serial sleep test \ + true && \ rm -rf /tmp/grub RUN git clone git://git.qemu.org/qemu.git /tmp/qemu && \ From patchwork Thu Mar 26 16:04:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 244334 List-Id: U-Boot discussion From: bmeng.cn at gmail.com (Bin Meng) Date: Thu, 26 Mar 2020 09:04:54 -0700 Subject: [PATCH 3/3] Dockerfile: Build QEMU for RISC-V 32-bit In-Reply-To: <1585238694-2714-1-git-send-email-bmeng.cn@gmail.com> References: <1585238694-2714-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1585238694-2714-3-git-send-email-bmeng.cn@gmail.com> Build qemu-system-riscv32 executable for U-Boot testing. Signed-off-by: Bin Meng --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a19067e..3a94eb4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -163,7 +163,7 @@ RUN git clone git://git.qemu.org/qemu.git /tmp/qemu && \ cd /tmp/qemu && \ git submodule update --init dtc && \ git checkout v4.2.0 && \ - ./configure --prefix=/opt/qemu --target-list="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,mips64el-softmmu,mipsel-softmmu,ppc-softmmu,riscv64-softmmu,x86_64-softmmu,xtensa-softmmu" && \ + ./configure --prefix=/opt/qemu --target-list="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,mips64el-softmmu,mipsel-softmmu,ppc-softmmu,riscv32-softmmu,riscv64-softmmu,x86_64-softmmu,xtensa-softmmu" && \ make -j$(nproc) all install && \ rm -rf /tmp/qemu