board/qemu/riscv32-virt: Convert defconfig into a fragment
PATCH v6 1/5 board/qemu/riscv32-virt: Convert defconfig into a fragment
Convert the config to the arch defconfig plus a fragment. When this fragment is applied we will generate the same config as we previously did.
--- board/qemu/riscv32-virt/linux.config | 23 ---- board/qemu/riscv32-virt/linux.config.fragment | 104 ++++++++++++++++++ configs/qemu_riscv32_virt_defconfig | 4 +- 3 files changed, 106 insertions(+), 25 deletions(-) delete mode 100644 board/qemu/riscv32-virt/linux.config create mode 100644 board/qemu/riscv32-virt/linux.config.fragment
board/qemu/riscv32-virt/linux.config deleted +0 -23
@@ -1,23 +0,0 @@ -CONFIG_ARCH_RV32I=y -CONFIG_SMP=y -CONFIG_NR_CPUS=8 -CONFIG_PCI=y -CONFIG_SYSVIPC=y -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_INET=y -# CONFIG_WIRELESS is not set -CONFIG_VIRTIO_BLK=y -CONFIG_NETDEVICES=y -CONFIG_VIRTIO_NET=y -# CONFIG_ETHERNET is not set -# CONFIG_WLAN is not set -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_VIRT_DRIVERS=y -CONFIG_VIRTIO_MMIO=y -CONFIG_EXT2_FS=y -CONFIG_EXT4_FS=y -CONFIG_TMPFS=y
board/qemu/riscv32-virt/linux.config.fragment new file +104 -0
104 lines not on this page · raw message
configs/qemu_riscv32_virt_defconfig +2 -2
@@ -18,8 +18,8 @@ BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/riscv/riscv-linux.git" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="8fe28cb58bcb235034b64cbbb7550a8a43fd88be" -BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y -BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/riscv32-virt/linux.config" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/qemu/riscv32-virt/linux.config.fragment" # Bootloader BR2_TARGET_RISCV_PK=y
Signature · 1 line
2.21.0
PATCH v6 2/5 board/qemu/riscv32-virt: Simplify the linux config
Reduce the config fragment to the bare minimum to enable 32-bit support. This means we are as close as possible to the arch defconfig.
--- board/qemu/riscv32-virt/linux.config.fragment | 100 +----------------- 1 file changed, 4 insertions(+), 96 deletions(-)
board/qemu/riscv32-virt/linux.config.fragment +4 -96
@@ -1,104 +1,12 @@ +CONFIG_32BIT=y CONFIG_ARCH_RV32I=y # CONFIG_ARCH_RV64I is not set -# CONFIG_ATA is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_AUTOFS_FS is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set -# CONFIG_BLK_DEV_INITRD is not set -# CONFIG_BLK_DEV_LOOP is not set -# CONFIG_BPF_SYSCALL is not set -# CONFIG_CGROUPS is not set -# CONFIG_CHECKPOINT_RESTORE is not set -# CONFIG_CMODEL_MEDANY is not set -CONFIG_CMODEL_MEDLOW=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_DEV_VIRTIO=y -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_ECHAINIV=y -CONFIG_CRYPTO_ENGINE=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_JITTERENTROPY=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_SHA256=y -# CONFIG_CRYPTO_USER_API_HASH is not set -# CONFIG_DEBUG_KERNEL is not set -CONFIG_DEBUG_MEMORY_INIT=y -# CONFIG_DRM is not set -# CONFIG_ETHERNET is not set -# CONFIG_EXPERT is not set -CONFIG_EXT2_FS=y -# CONFIG_EXT4_FS_POSIX_ACL is not set -# CONFIG_FB is not set -CONFIG_FRAME_WARN=1024 -# CONFIG_FTRACE is not set -CONFIG_HID_A4TECH=y -CONFIG_HID_APPLE=y -CONFIG_HID_BELKIN=y -CONFIG_HID_CHERRY=y -CONFIG_HID_CHICONY=y -CONFIG_HID_CYPRESS=y -CONFIG_HID_EZKEY=y -CONFIG_HID_ITE=y -CONFIG_HID_KENSINGTON=y -CONFIG_HID_LOGITECH=y -CONFIG_HID_MICROSOFT=y -CONFIG_HID_MONTEREY=y -CONFIG_HID_REDRAGON=y -# CONFIG_HVC_RISCV_SBI is not set -CONFIG_HW_RANDOM=y -# CONFIG_I2C is not set -# CONFIG_IKCONFIG is not set -CONFIG_INPUT_FF_MEMLESS=y -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_IP_ADVANCED_ROUTER is not set -# CONFIG_IP_MULTICAST is not set -# CONFIG_IP_PNP is not set -# CONFIG_KEYS is not set CONFIG_MAXPHYSMEM_2GB=y -# CONFIG_MDIO_DEVICE is not set -# CONFIG_MODULES is not set -# CONFIG_MSDOS_FS is not set -# CONFIG_NETLINK_DIAG is not set -# CONFIG_NFS_FS is not set -# CONFIG_NLS is not set -CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PCIE_XILINX is not set -CONFIG_PGTABLE_LEVELS=2 -# CONFIG_PHYLIB is not set -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_POWER_SUPPLY is not set -# CONFIG_PRINTK_TIME is not set -# CONFIG_PROC_CHILDREN is not set -# CONFIG_RAS is not set -# CONFIG_SCSI is not set -# CONFIG_SIFIVE_PLIC is not set -# CONFIG_SYNC_FILE is not set -# CONFIG_TMPFS_POSIX_ACL is not set -# CONFIG_TMPFS_XATTR is not set -# CONFIG_USB is not set -# CONFIG_USER_NS is not set -# CONFIG_VFAT_FS is not set -CONFIG_VIRT_DRIVERS=y -# CONFIG_VT_HW_CONSOLE_BINDING is not set -# CONFIG_WIRELESS is not set -# CONFIG_WLAN is not set -# CONFIG_XZ_DEC is not set -CONFIG_32BIT=y -# CONFIG_EXT2_FS_XATTR is not set +CONFIG_LBDAF=y +# CONFIG_SCSI_NSP32 is not set CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_LIB_ASHLDI3=y CONFIG_GENERIC_LIB_ASHRDI3=y CONFIG_GENERIC_LIB_LSHRDI3=y CONFIG_GENERIC_LIB_UCMPDI2=y -# CONFIG_HID_LOGITECH_HIDPP is not set -CONFIG_LBDAF=y -# CONFIG_LOGIG940_FF is not set -# CONFIG_LOGIRUMBLEPAD2_FF is not set -# CONFIG_LOGITECH_FF is not set -# CONFIG_LOGIWHEELS_FF is not set - +CONFIG_GENERIC_LIB_UMODDI3=y
Signature · 1 line
2.21.0
Thomas Petazzoni
AppliedPATCH v6 2/5 board/qemu/riscv32-virt: Simplify the linux config
Quoted 8 lines · On Wed, 20 Mar 2019 23:05:21 +0000 Alistair Francis <[email protected]>…
Reduce the config fragment to the bare minimum to enable 32-bit support. This means we are as close as possible to the arch defconfig.
Signed-off-by Alistair Francis <[email protected]>--- board/qemu/riscv32-virt/linux.config.fragment | 100 +----------------- 1 file changed, 4 insertions(+), 96 deletions(-)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v6 3/5 boot/opensbi: new package
In reply to Alistair FrancisOpenSBI is a much improved alternative to BBL (riscv-pk). Add OpenSBI support to buildroot.
--- DEVELOPERS | 1 + boot/Config.in | 1 + boot/opensbi/Config.in | 25 +++++++++++++++++++++++++ boot/opensbi/opensbi.mk | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 boot/opensbi/Config.in create mode 100644 boot/opensbi/opensbi.mk
DEVELOPERS +1 -0
@@ -122,6 +122,7 @@ F: package/kvazaar/ F: package/v4l2loopback/ N: Alistair Francis <[email protected]> +F: boot/opensbi/ F: package/xen/ N: Alvaro G. M <[email protected]>
boot/Config.in +1 -0
@@ -14,6 +14,7 @@ source "boot/lpc32xxcdl/Config.in" source "boot/mv-ddr-marvell/Config.in" source "boot/mxs-bootlets/Config.in" source "boot/optee-os/Config.in" +source "boot/opensbi/Config.in" source "boot/riscv-pk/Config.in" source "boot/s500-bootloader/Config.in" source "boot/shim/Config.in"
boot/opensbi/Config.in new file +25 -0
@@ -0,0 +1,25 @@ +config BR2_TARGET_OPENSBI + bool "opensbi" + depends on BR2_riscv + help + OpenSBI aims to provide an open-source and extensible + implementation of the RISC-V SBI specification for a platform + specific firmware (M-mode) and a general purpose OS, + hypervisor or bootloader (S-mode or HS-mode). OpenSBI + implementation can be easily extended by RISC-V platform or + System-on-Chip vendors to fit a particular hadware + configuration. + + https://github.com/riscv/opensbi.git + +if BR2_TARGET_OPENSBI +config BR2_TARGET_OPENSBI_PLAT + string "OpenSBI Platform" + default "" + help + Specifies the OpenSBI platform to build. If no platform is + specified only the OpenSBI platform independent static + library libsbi.a is built. If a platform is specified then + the platform specific static library libplatsbi.a and firmware + examples are built. +endif
boot/opensbi/opensbi.mk new file +37 -0
@@ -0,0 +1,37 @@ +################################################################################ +# +# opensbi +# +################################################################################ + +OPENSBI_VERSION = v0.3 +OPENSBI_SITE = $(call github,riscv,opensbi,$(OPENSBI_VERSION)) +OPENSBI_LICENSE = BSD-2-Clause +OPENSBI_LICENSE_FILES = COPYING.BSD +OPENSBI_INSTALL_IMAGES = YES + +OPENSBI_MAKE_ENV = \ + CROSS_COMPILE=$(TARGET_CROSS) + +OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_OPENSBI_PLAT)) +ifneq ($(OPENSBI_PLAT),) +OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT) +endif + +define OPENSBI_BUILD_CMDS + $(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D) +endef + +ifneq ($(OPENSBI_PLAT),) +define OPENSBI_INSTALL_IMAGES_CMDS + $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_jump.bin $(BINARIES_DIR)/fw_jump.bin + $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_jump.elf $(BINARIES_DIR)/fw_jump.elf +endef +endif + +# Install libsbi.a in the host lib dir so it can be linked in the future. +define OPENSBI_INSTALL_STAGING_CMDS + $(INSTALL) -m 0644 -D $(@D)/build/lib/libsbi.a $(STAGING_DIR)/usr/share/opensbi/libsbi.a +endef + +$(eval $(generic-package))
Signature · 1 line
2.21.0
PATCH v6 3/5 boot/opensbi: new package
Hello,
Quoted 4 lines · On Wed, 20 Mar 2019 23:05:21 +0000 Alistair Francis <[email protected]>…
OpenSBI is a much improved alternative to BBL (riscv-pk). Add OpenSBI support to buildroot.
Signed-off-by Alistair Francis <[email protected]>
I have applied, but after doing a few changes for things that were not completely correct. See below.
boot/opensbi/opensbi.mk line 11
Quoted 5 lines
boot/opensbi/opensbi.mk new file +5
-0+OPENSBI_VERSION = v0.3 +OPENSBI_SITE = $(call github,riscv,opensbi,$(OPENSBI_VERSION)) +OPENSBI_LICENSE = BSD-2-Clause +OPENSBI_LICENSE_FILES = COPYING.BSD +OPENSBI_INSTALL_IMAGES = YES
This is only really needed when OPENSBI_PLAT != "", so I've moved this statement inside the appropriate condition.
I've added OPENSBI_INSTALL_TARGET = NO, because we're not installing anything to target.
But more importantly, I've added OPENSBI_INSTALL_STAGING = YES, without which your OPENSBI_INSTALL_STAGING_CMDS is never called. I'm not sure how you tested this, but it clearly couldn't work as is.
Quoted 1 line
+# Install libsbi.a in the host lib dir so it can be linked in the future.
The library is not installed in host dir. So I've changed this to rather explain why we install in usr/share/opensbi and not in usr/lib.
Applied with those issues fixed. Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v6 3/5 boot/opensbi: new package
Quoted 6 lines · Thomas Petazzoni
Hello,
On Wed, 20 Mar 2019 23:05:21 +0000 Alistair Francis <[email protected]> wrote:
Quoted 7 lines
Quoted 4 lines
OpenSBI is a much improved alternative to BBL (riscv-pk). Add OpenSBI support to buildroot.
Signed-off-by Alistair Francis <[email protected]>I have applied, but after doing a few changes for things that were not completely correct. See below.
Thanks for applying this and the rest of the series.
Quoted 10 lines
boot/opensbi/opensbi.mk line 11
Quoted 6 lines
boot/opensbi/opensbi.mk new file +5
-0+OPENSBI_VERSION = v0.3 +OPENSBI_SITE = $(call github,riscv,opensbi,$(OPENSBI_VERSION)) +OPENSBI_LICENSE = BSD-2-Clause +OPENSBI_LICENSE_FILES = COPYING.BSD +OPENSBI_INSTALL_IMAGES = YESThis is only really needed when
OPENSBI_PLAT!= "", so I've moved this statement inside the appropriate condition.
Quoted 2 lines
I've added
OPENSBI_INSTALL_TARGET= NO, because we're not installing anything to target.
Thanks
Quoted 4 lines
But more importantly, I've added
OPENSBI_INSTALL_STAGING= YES, without which yourOPENSBI_INSTALL_STAGING_CMDSis never called. I'm not sure how you tested this, but it clearly couldn't work as is.
Ah, I tested it in the previous version when I was using the Image install, but must have missed checking it was installed in the latest version. Sorry about that.
Quoted 5 lines
Quoted 2 lines
+# Install libsbi.a in the host lib dir so it can be linked in the future.
The library is not installed in host dir. So I've changed this to rather explain why we install in
usr/share/opensbiand not in usr/lib.
Thanks for this.
Alistair
Quoted 8 lines
Applied with those issues fixed. Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH v6 4/5 configs: qemu_riscv*_virt: Use OpenSBI by default
In reply to Alistair FrancisUse OpenSBI by default instead of riscv-pk (BBL).
--- board/qemu/riscv32-virt/readme.txt | 6 +++--- board/qemu/riscv64-virt/readme.txt | 6 +++--- configs/qemu_riscv32_virt_defconfig | 5 ++++- configs/qemu_riscv64_virt_defconfig | 5 ++++- 4 files changed, 14 insertions(+), 8 deletions(-)
board/qemu/riscv32-virt/readme.txt +3 -3
@@ -1,7 +1,7 @@ -Run the emulation with: +Run Linux in emulation with: - qemu-system-riscv32 -M virt -kernel output/images/bbl -append "root=/dev/vda ro console=ttyS0" -drive file=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 + qemu-system-riscv32 -M virt -kernel output/images/fw_jump.elf -device loader,file=output/images/Image,addr=0x80400000 -append "root=/dev/vda ro" -drive file=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 login prompt will appear in the terminal that started Qemu. -Tested with QEMU 2.12.1 +Tested with QEMU 3.1
board/qemu/riscv64-virt/readme.txt +3 -3
@@ -1,7 +1,7 @@ -Run the emulation with: +Run Linux in emulation with: - qemu-system-riscv64 -M virt -kernel output/images/bbl -append "root=/dev/vda ro console=ttyS0" -drive file=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 + qemu-system-riscv64 -M virt -kernel output/images/fw_jump.elf -device loader,file=output/images/Image,addr=0x80200000 -append "root=/dev/vda ro" -drive file=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 login prompt will appear in the terminal that started Qemu. -Tested with QEMU 2.12.1 +Tested with QEMU 3.1
configs/qemu_riscv32_virt_defconfig +4 -1
@@ -20,6 +20,9 @@ BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/riscv/riscv-linux.git" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="8fe28cb58bcb235034b64cbbb7550a8a43fd88be" BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/qemu/riscv32-virt/linux.config.fragment" +BR2_LINUX_KERNEL_IMAGE=y # Bootloader -BR2_TARGET_RISCV_PK=y +BR2_TARGET_OPENSBI=y +BR2_TARGET_OPENSBI_USE_PLAT=y +BR2_TARGET_OPENSBI_PLAT="qemu/virt"
configs/qemu_riscv64_virt_defconfig +4 -1
@@ -19,6 +19,9 @@ BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/riscv/riscv-linux.git" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="8fe28cb58bcb235034b64cbbb7550a8a43fd88be" BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_IMAGE=y # Bootloader -BR2_TARGET_RISCV_PK=y +BR2_TARGET_OPENSBI=y +BR2_TARGET_OPENSBI_USE_PLAT=y +BR2_TARGET_OPENSBI_PLAT="qemu/virt"
Signature · 1 line
2.21.0
Thomas Petazzoni
AppliedPATCH v6 4/5 configs: qemu_riscv*_virt: Use OpenSBI by default
Quoted 9 lines · On Wed, 20 Mar 2019 23:05:21 +0000 Alistair Francis <[email protected]>…
Use OpenSBI by default instead of riscv-pk (BBL).
Signed-off-by Alistair Francis <[email protected]>--- board/qemu/riscv32-virt/readme.txt | 6 +++--- board/qemu/riscv64-virt/readme.txt | 6 +++--- configs/qemu_riscv32_virt_defconfig | 5 ++++- configs/qemu_riscv64_virt_defconfig | 5 ++++- 4 files changed, 14 insertions(+), 8 deletions(-)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v6 5/5 boot/riscv-pk: Deprecate riscv-pk and BBL
In reply to Alistair Francis--- boot/riscv-pk/Config.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
boot/riscv-pk/Config.in +4 -1
@@ -3,10 +3,13 @@ comment "riscv-pk needs a Linux kernel to be built" depends on !BR2_LINUX_KERNEL config BR2_TARGET_RISCV_PK - bool "riscv-pk" + bool "riscv-pk (deprecated)" depends on BR2_riscv depends on BR2_LINUX_KERNEL help + The RISC-V Proxy Kernel (pk) and Boot Loader (BBL) have + been deprecated. Please use OpenSBI instead. + The RISC-V Proxy Kernel (pk) package contains the Berkeley Boot Loader (BBL) which has been designed to boot a Linux kernel on a RISC-V processor.
Signature · 1 line
2.21.0
Thomas Petazzoni
AppliedPATCH v6 5/5 boot/riscv-pk: Deprecate riscv-pk and BBL
Quoted 4 lines · On Wed, 20 Mar 2019 23:05:22 +0000 Alistair Francis <[email protected]>…
Signed-off-by Alistair Francis <[email protected]>--- boot/riscv-pk/Config.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Thomas Petazzoni
AppliedPATCH v6 1/5 board/qemu/riscv32-virt: Convert defconfig into a fragment
In reply to Alistair FrancisQuoted 4 lines · On Wed, 20 Mar 2019 23:05:21 +0000 Alistair Francis <[email protected]>…
Convert the config to the arch defconfig plus a fragment. When this fragment is applied we will generate the same config as we previously did.
Quoted 8 lines
Signed-off-by Alistair Francis <[email protected]>--- board/qemu/riscv32-virt/linux.config | 23 ---- board/qemu/riscv32-virt/linux.config.fragment | 104 ++++++++++++++++++ configs/qemu_riscv32_virt_defconfig | 4 +- 3 files changed, 106 insertions(+), 25 deletions(-) delete mode 100644 board/qemu/riscv32-virt/linux.config create mode 100644 board/qemu/riscv32-virt/linux.config.fragment
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com