From: Mark Corbin <mark.corbin@embecosm.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] configs/qemu: add qemu_riscv64_virt_defconfig
Date: Tue, 4 Sep 2018 16:14:58 +0100 [thread overview]
Message-ID: <6b529ca2-bfeb-227e-e76b-0465e52d8bf0@embecosm.com> (raw)
In-Reply-To: <20180902214755.139a1b23@windsurf>
Hello Thomas
On 02/09/18 20:47, Thomas Petazzoni wrote:
> Hello Mark,
>
> On Fri, 31 Aug 2018 15:38:53 +0100, Mark Corbin wrote:
>> Add RISC-V 64-bit defconfig for QEMU virt machine.
>>
>> Tested with QEMU 2.12.1
> Here you say 2.12.1, in the readme.txt file you say 2.12.92. I assume
> one or the other has a typo :-)
Oops..typo on my part. I did test against both versions in fact, but
I'll stick with 2.12.1 as it is an official release.
>
>> board/qemu/riscv64-virt/linux.config | 24 ++++++++++++++++++++++++
>> board/qemu/riscv64-virt/readme.txt | 22 ++++++++++++++++++++++
>> configs/qemu_riscv64_virt_defconfig | 24 ++++++++++++++++++++++++
>> 3 files changed, 70 insertions(+)
> Please add an entry in the DEVELOPERS file. When you will do a patch
> series with the base RISC-V support:
>
> - The patch introducing the RISC-V support should add an entry in the
> DEVELOPERS file for you, the arch/Config.in.riscv file and other
> files introduced by this first patch.
>
> - The patch introducing the RISC-V qemu defconfig should add more
> items to the DEVELOPERS file entry, to list the files related to
> this defconfig.
>
>> diff --git a/board/qemu/riscv64-virt/readme.txt b/board/qemu/riscv64-virt/readme.txt
>> new file mode 100644
>> index 0000000000..be563c969e
>> --- /dev/null
>> +++ b/board/qemu/riscv64-virt/readme.txt
>> @@ -0,0 +1,22 @@
>> +Run the emulation with:
>> +
>> + qemu-system-riscv64 -M virt -kernel <path-to-bl>/bbl -append "root=/dev/vda ro console=ttyS0" -drive file=<path-to-buildroot>/output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic
>> +
>> +The Buildroot generated vmlinux image will need to be combined with the Berkeley Boot Loader (BBL) as follows:
>> +
>> + export RISCV=<path-to-buildroot>/output/host
>> + export PATH=$PATH:$RISCV/bin
>> + git clone https://github.com/riscv/riscv-pk
>> + cd riscv-pk
>> + mkdir build
>> + cd build
>> + ../configure \
>> + --host=riscv64-buildroot-linux-gnu \
>> + --with-payload=<path-to-buildroot>/output/images/vmlinux
>> + make
> Then we want to create a package for the BBL, in boot/riscv-pk/. See
> boot/boot-wrapper-aarch64/ for an example of bootloader wraps the
> kernel image. It depends on the kernel build in Config.in:
>
> config BR2_TARGET_BOOT_WRAPPER_AARCH64
> bool "boot-wrapper-aarch64"
> depends on BR2_aarch64
> depends on BR2_LINUX_KERNEL
>
> And then in the .mk file, we ensure the Linux kernel is built before:
>
> BOOT_WRAPPER_AARCH64_DEPENDENCIES = linux
>
> And we pass the path to the kernel tree (which it needs to get the
> kernel image):
>
> BOOT_WRAPPER_AARCH64_CONF_OPTS = \
> --with-kernel-dir=$(LINUX_DIR) \
I had been reluctant to add riscv-pk to Buildroot as a bootloader, as I
see it as an interim solution until riscv support makes it into UBoot or
Barebox. On the other hand, riscv kernel images aren't much use without
it at the moment.
I do have a preliminary riscv-pk package working based on your helpful
pointers to boot-wrapper-aarch64. Do people prefer to add it as
'risc-pk' when it is only the Berkeley Boot Loader part that is
significant? I would have added it as 'bbl', but I can see the potential
confusion when the package/repository is 'riscv-pk'.
Regards
Mark
--
Mark Corbin
Embecosm Ltd.
https://www.embecosm.com
next prev parent reply other threads:[~2018-09-04 15:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 14:38 [Buildroot] [PATCH 1/1] configs/qemu: add qemu_riscv64_virt_defconfig Mark Corbin
2018-08-31 19:01 ` Thomas Petazzoni
2018-09-02 15:09 ` Christopher McCrory
2018-09-04 11:06 ` Mark Corbin
2018-09-02 19:47 ` Thomas Petazzoni
2018-09-04 15:14 ` Mark Corbin [this message]
2018-09-04 19:57 ` Arnout Vandecappelle
2018-09-05 6:45 ` Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6b529ca2-bfeb-227e-e76b-0465e52d8bf0@embecosm.com \
--to=mark.corbin@embecosm.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox