All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5 1/4] board/qemu/riscv32-virt: Update linux config
@ 2019-03-20  0:38 Alistair Francis
  2019-03-20  0:38 ` [Buildroot] [PATCH v5 3/4] configs: qemu_riscv*_virt: Use OpenSBI by default Alistair Francis
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Alistair Francis @ 2019-03-20  0:38 UTC (permalink / raw)
  To: buildroot

Update the Linux defconfig. This defconfig is the in tree defconfig with
32-bit support enabled.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 board/qemu/riscv32-virt/linux.config | 35 +++++++++++-----------------
 configs/qemu_riscv32_virt_defconfig  |  4 ++--
 2 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/board/qemu/riscv32-virt/linux.config b/board/qemu/riscv32-virt/linux.config
index c25583f768..fa8a9fd650 100644
--- a/board/qemu/riscv32-virt/linux.config
+++ b/board/qemu/riscv32-virt/linux.config
@@ -1,23 +1,14 @@
+CONFIG_32BIT=y
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PGTABLE_LEVELS=2
 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
+# CONFIG_ARCH_RV64I is not set
+CONFIG_MAXPHYSMEM_2GB=y
+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_GENERIC_LIB_UMODDI3=y
diff --git a/configs/qemu_riscv32_virt_defconfig b/configs/qemu_riscv32_virt_defconfig
index 6f9a61b11c..15b4c5624c 100644
--- a/configs/qemu_riscv32_virt_defconfig
+++ b/configs/qemu_riscv32_virt_defconfig
@@ -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"
 
 # Bootloader
 BR2_TARGET_RISCV_PK=y
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 3/4] configs: qemu_riscv*_virt: Use OpenSBI by default
  2019-03-20  0:38 [Buildroot] [PATCH v5 1/4] board/qemu/riscv32-virt: Update linux config Alistair Francis
@ 2019-03-20  0:38 ` Alistair Francis
  2019-03-20  0:38 ` [Buildroot] [PATCH v5 2/4] boot/opensbi: new package Alistair Francis
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2019-03-20  0:38 UTC (permalink / raw)
  To: buildroot

Use OpenSBI by default instead of riscv-pk (BBL).

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 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(-)

diff --git a/board/qemu/riscv32-virt/readme.txt b/board/qemu/riscv32-virt/readme.txt
index 2da99580e5..fb441723fd 100644
--- a/board/qemu/riscv32-virt/readme.txt
+++ b/board/qemu/riscv32-virt/readme.txt
@@ -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 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
 
 The login prompt will appear in the terminal that started Qemu.
 
-Tested with QEMU 2.12.1
+Tested with QEMU 3.1
diff --git a/board/qemu/riscv64-virt/readme.txt b/board/qemu/riscv64-virt/readme.txt
index 9f6e35c867..0af27f7bf2 100644
--- a/board/qemu/riscv64-virt/readme.txt
+++ b/board/qemu/riscv64-virt/readme.txt
@@ -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 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
 
 The login prompt will appear in the terminal that started Qemu.
 
-Tested with QEMU 2.12.1
+Tested with QEMU 3.1
diff --git a/configs/qemu_riscv32_virt_defconfig b/configs/qemu_riscv32_virt_defconfig
index 15b4c5624c..18a143a90f 100644
--- a/configs/qemu_riscv32_virt_defconfig
+++ b/configs/qemu_riscv32_virt_defconfig
@@ -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"
+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"
diff --git a/configs/qemu_riscv64_virt_defconfig b/configs/qemu_riscv64_virt_defconfig
index 596edf2fcd..05d2764003 100644
--- a/configs/qemu_riscv64_virt_defconfig
+++ b/configs/qemu_riscv64_virt_defconfig
@@ -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"
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 4/4] boot/riscv-pk: Deprecate riscv-pk and BBL
  2019-03-20  0:38 [Buildroot] [PATCH v5 1/4] board/qemu/riscv32-virt: Update linux config Alistair Francis
  2019-03-20  0:38 ` [Buildroot] [PATCH v5 3/4] configs: qemu_riscv*_virt: Use OpenSBI by default Alistair Francis
  2019-03-20  0:38 ` [Buildroot] [PATCH v5 2/4] boot/opensbi: new package Alistair Francis
@ 2019-03-20  0:38 ` Alistair Francis
  2019-03-20 19:20 ` [Buildroot] [PATCH v5 1/4] board/qemu/riscv32-virt: Update linux config Arnout Vandecappelle
  3 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2019-03-20  0:38 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 boot/riscv-pk/Config.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/boot/riscv-pk/Config.in b/boot/riscv-pk/Config.in
index b4fe36590f..cf9c5cd8ee 100644
--- a/boot/riscv-pk/Config.in
+++ b/boot/riscv-pk/Config.in
@@ -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.
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 2/4] boot/opensbi: new package
  2019-03-20  0:38 [Buildroot] [PATCH v5 1/4] board/qemu/riscv32-virt: Update linux config Alistair Francis
  2019-03-20  0:38 ` [Buildroot] [PATCH v5 3/4] configs: qemu_riscv*_virt: Use OpenSBI by default Alistair Francis
@ 2019-03-20  0:38 ` Alistair Francis
  2019-03-20 21:12   ` Thomas Petazzoni
  2019-03-20  0:38 ` [Buildroot] [PATCH v5 4/4] boot/riscv-pk: Deprecate riscv-pk and BBL Alistair Francis
  2019-03-20 19:20 ` [Buildroot] [PATCH v5 1/4] board/qemu/riscv32-virt: Update linux config Arnout Vandecappelle
  3 siblings, 1 reply; 12+ messages in thread
From: Alistair Francis @ 2019-03-20  0:38 UTC (permalink / raw)
  To: buildroot

OpenSBI is a much improved alternative to BBL (riscv-pk). Add OpenSBI
support to buildroot.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 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

diff --git a/DEVELOPERS b/DEVELOPERS
index 3e0ac08e11..91eda42949 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -122,6 +122,7 @@ F:	package/kvazaar/
 F:	package/v4l2loopback/
 
 N:	Alistair Francis <alistair@alistair23.me>
+F:	boot/opensbi/
 F:	package/xen/
 
 N:	Alvaro G. M <alvaro.gamez@hazent.com>
diff --git a/boot/Config.in b/boot/Config.in
index 74481e7545..97bd3de6e9 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -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"
diff --git a/boot/opensbi/Config.in b/boot/opensbi/Config.in
new file mode 100644
index 0000000000..5f3cc13312
--- /dev/null
+++ b/boot/opensbi/Config.in
@@ -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
diff --git a/boot/opensbi/opensbi.mk b/boot/opensbi/opensbi.mk
new file mode 100644
index 0000000000..341e2dcb19
--- /dev/null
+++ b/boot/opensbi/opensbi.mk
@@ -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),)
+OPENSBI_PLAT_INSTALL = \
+	$(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
+endif
+
+# Install libsbi.a in the host lib dir so it can be linked in the future.
+define OPENSBI_INSTALL_IMAGES_CMDS
+	$(OPENSBI_PLAT_INSTALL)
+	$(INSTALL) -m 0644 -D $(@D)/build/lib/libsbi.a $(HOST_DIR)/usr/lib
+endef
+
+$(eval $(generic-package))
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 1/4] board/qemu/riscv32-virt: Update linux config
  2019-03-20  0:38 [Buildroot] [PATCH v5 1/4] board/qemu/riscv32-virt: Update linux config Alistair Francis
                   ` (2 preceding siblings ...)
  2019-03-20  0:38 ` [Buildroot] [PATCH v5 4/4] boot/riscv-pk: Deprecate riscv-pk and BBL Alistair Francis
@ 2019-03-20 19:20 ` Arnout Vandecappelle
  2019-03-20 22:50   ` Alistair Francis
  3 siblings, 1 reply; 12+ messages in thread
From: Arnout Vandecappelle @ 2019-03-20 19:20 UTC (permalink / raw)
  To: buildroot

 Hi Alistair,

On 20/03/2019 01:38, Alistair Francis wrote:
> Update the Linux defconfig. This defconfig is the in tree defconfig with
> 32-bit support enabled.

 I would prefer two patches: a first patch that just converts the current
linux.config into a config fragment, without changing anything, and then a
second patch that adds features.

 To do the first patch, just do

make linux-configure
cp output/build/linux*/.config /tmp/riscv32.config
(select BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG)
make linux-reconfigure
utils/diffconfig -m output/build/linux*/.config /tmp/riscv32.config > \
	board/qemu/riscv32-virt/linux.config.fragment
(set BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES)
make linux-reconfigure
diff -u output/build/linux*/.config /tmp/riscv32.config

 For the second patch, you either use the same procedure as above, or you just
manually add the relevant symbols from the fragment.

> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  board/qemu/riscv32-virt/linux.config | 35 +++++++++++-----------------
>  configs/qemu_riscv32_virt_defconfig  |  4 ++--
>  2 files changed, 15 insertions(+), 24 deletions(-)
> 
> diff --git a/board/qemu/riscv32-virt/linux.config b/board/qemu/riscv32-virt/linux.config
> index c25583f768..fa8a9fd650 100644
> --- a/board/qemu/riscv32-virt/linux.config
> +++ b/board/qemu/riscv32-virt/linux.config
> @@ -1,23 +1,14 @@
> +CONFIG_32BIT=y
> +CONFIG_PAGE_OFFSET=0xC0000000

 This makes no sense... These are blind symbols, so their values will be ignored.

 Or am I missing something?

[snip]
> diff --git a/configs/qemu_riscv32_virt_defconfig b/configs/qemu_riscv32_virt_defconfig
> index 6f9a61b11c..15b4c5624c 100644
> --- a/configs/qemu_riscv32_virt_defconfig
> +++ b/configs/qemu_riscv32_virt_defconfig
> @@ -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"

 Since it's a fragment, better call it linux.config.fragment or linux.fragment
(we have both currently, but a bit more of linux.config.fragment).

 Regards,
 Arnout

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 2/4] boot/opensbi: new package
  2019-03-20  0:38 ` [Buildroot] [PATCH v5 2/4] boot/opensbi: new package Alistair Francis
@ 2019-03-20 21:12   ` Thomas Petazzoni
  2019-03-20 21:28     ` Alistair Francis
  2019-03-21 16:36     ` Mark Corbin
  0 siblings, 2 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2019-03-20 21:12 UTC (permalink / raw)
  To: buildroot

Hello Francis,

You are respining the patches too fast, without answering some of the
questions, and therefore there's still an issue, see below.

On Wed, 20 Mar 2019 00:38:05 +0000
Alistair Francis <Alistair.Francis@wdc.com> wrote:

> +ifneq ($(OPENSBI_PLAT),)
> +OPENSBI_PLAT_INSTALL = \
> +	$(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
> +endif
> +
> +# Install libsbi.a in the host lib dir so it can be linked in the future.
> +define OPENSBI_INSTALL_IMAGES_CMDS
> +	$(OPENSBI_PLAT_INSTALL)
> +	$(INSTALL) -m 0644 -D $(@D)/build/lib/libsbi.a $(HOST_DIR)/usr/lib

I suppose that libsbi.a contains code cross-compiled for RISC-V, so
installing it in $(HOST_DIR) is wrong in this case. It should go in
$(STAGING_DIR).

The second question, which I asked in my review of your v4 is whether
this library is meant to be linked into bare-metal code (which is what
I would expect for something related to firmware) or to Linux
user-space applications. In the latter case, installing to
$(STAGING_DIR)/usr/lib is the right thing to do. In the former case
however, it should probably be installed elsewhere, maybe
$(STAGING_DIR)/usr/share/opensbi (but I'm not a FHS expert).

Also, when -D is used, the destination path should include the filename.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 2/4] boot/opensbi: new package
  2019-03-20 21:12   ` Thomas Petazzoni
@ 2019-03-20 21:28     ` Alistair Francis
  2019-03-20 21:44       ` Thomas Petazzoni
  2019-03-21 16:36     ` Mark Corbin
  1 sibling, 1 reply; 12+ messages in thread
From: Alistair Francis @ 2019-03-20 21:28 UTC (permalink / raw)
  To: buildroot

On Wed, Mar 20, 2019 at 2:12 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Francis,
>
> You are respining the patches too fast, without answering some of the
> questions, and therefore there's still an issue, see below.

Sorry, I didn't realise I didn't respond to a question.

>
> On Wed, 20 Mar 2019 00:38:05 +0000
> Alistair Francis <Alistair.Francis@wdc.com> wrote:
>
> > +ifneq ($(OPENSBI_PLAT),)
> > +OPENSBI_PLAT_INSTALL = \
> > +     $(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
> > +endif
> > +
> > +# Install libsbi.a in the host lib dir so it can be linked in the future.
> > +define OPENSBI_INSTALL_IMAGES_CMDS
> > +     $(OPENSBI_PLAT_INSTALL)
> > +     $(INSTALL) -m 0644 -D $(@D)/build/lib/libsbi.a $(HOST_DIR)/usr/lib
>
> I suppose that libsbi.a contains code cross-compiled for RISC-V, so
> installing it in $(HOST_DIR) is wrong in this case. It should go in
> $(STAGING_DIR).

Yes, it does contain cross compiled code. I have changed it to the STAGING_DIR.

>
> The second question, which I asked in my review of your v4 is whether
> this library is meant to be linked into bare-metal code (which is what

Sorry, I missed your question. It is meant to be linked into bare metal code.

> I would expect for something related to firmware) or to Linux
> user-space applications. In the latter case, installing to
> $(STAGING_DIR)/usr/lib is the right thing to do. In the former case
> however, it should probably be installed elsewhere, maybe
> $(STAGING_DIR)/usr/share/opensbi (but I'm not a FHS expert).

$(STAGING_DIR)/usr/share/opensbi looks good to me. I will use that.

>
> Also, when -D is used, the destination path should include the filename.

Ok, fixed.

Alistair

>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 2/4] boot/opensbi: new package
  2019-03-20 21:28     ` Alistair Francis
@ 2019-03-20 21:44       ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2019-03-20 21:44 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 20 Mar 2019 14:28:59 -0700
Alistair Francis <alistair23@gmail.com> wrote:

> > I would expect for something related to firmware) or to Linux
> > user-space applications. In the latter case, installing to
> > $(STAGING_DIR)/usr/lib is the right thing to do. In the former case
> > however, it should probably be installed elsewhere, maybe
> > $(STAGING_DIR)/usr/share/opensbi (but I'm not a FHS expert).  
> 
> $(STAGING_DIR)/usr/share/opensbi looks good to me. I will use that.

Then it should go to a OPENSBI_INSTALL_STAGING_CMDS variable, not in
OPENSBI_INSTALL_IMAGES_CMDS.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 1/4] board/qemu/riscv32-virt: Update linux config
  2019-03-20 19:20 ` [Buildroot] [PATCH v5 1/4] board/qemu/riscv32-virt: Update linux config Arnout Vandecappelle
@ 2019-03-20 22:50   ` Alistair Francis
  0 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2019-03-20 22:50 UTC (permalink / raw)
  To: buildroot

On Wed, Mar 20, 2019 at 12:20 PM Arnout Vandecappelle <arnout@mind.be> wrote:
>
>  Hi Alistair,
>
> On 20/03/2019 01:38, Alistair Francis wrote:
> > Update the Linux defconfig. This defconfig is the in tree defconfig with
> > 32-bit support enabled.
>
>  I would prefer two patches: a first patch that just converts the current
> linux.config into a config fragment, without changing anything, and then a
> second patch that adds features.
>
>  To do the first patch, just do
>
> make linux-configure
> cp output/build/linux*/.config /tmp/riscv32.config
> (select BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG)
> make linux-reconfigure
> utils/diffconfig -m output/build/linux*/.config /tmp/riscv32.config > \
>         board/qemu/riscv32-virt/linux.config.fragment
> (set BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES)
> make linux-reconfigure
> diff -u output/build/linux*/.config /tmp/riscv32.config
>
>  For the second patch, you either use the same procedure as above, or you just
> manually add the relevant symbols from the fragment.

Ok, I have updated this in the v6.

>
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > ---
> >  board/qemu/riscv32-virt/linux.config | 35 +++++++++++-----------------
> >  configs/qemu_riscv32_virt_defconfig  |  4 ++--
> >  2 files changed, 15 insertions(+), 24 deletions(-)
> >
> > diff --git a/board/qemu/riscv32-virt/linux.config b/board/qemu/riscv32-virt/linux.config
> > index c25583f768..fa8a9fd650 100644
> > --- a/board/qemu/riscv32-virt/linux.config
> > +++ b/board/qemu/riscv32-virt/linux.config
> > @@ -1,23 +1,14 @@
> > +CONFIG_32BIT=y
> > +CONFIG_PAGE_OFFSET=0xC0000000
>
>  This makes no sense... These are blind symbols, so their values will be ignored.
>
>  Or am I missing something?

I have removed this one, it is generated by the kernel's menuconfig
but they don't seem to be required.

>
> [snip]
> > diff --git a/configs/qemu_riscv32_virt_defconfig b/configs/qemu_riscv32_virt_defconfig
> > index 6f9a61b11c..15b4c5624c 100644
> > --- a/configs/qemu_riscv32_virt_defconfig
> > +++ b/configs/qemu_riscv32_virt_defconfig
> > @@ -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"
>
>  Since it's a fragment, better call it linux.config.fragment or linux.fragment
> (we have both currently, but a bit more of linux.config.fragment).

Fxied!

Alistair

>
>  Regards,
>  Arnout
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 2/4] boot/opensbi: new package
  2019-03-20 21:12   ` Thomas Petazzoni
  2019-03-20 21:28     ` Alistair Francis
@ 2019-03-21 16:36     ` Mark Corbin
  2019-03-21 16:57       ` Thomas Petazzoni
  1 sibling, 1 reply; 12+ messages in thread
From: Mark Corbin @ 2019-03-21 16:36 UTC (permalink / raw)
  To: buildroot

Hello Thomas

On 20/03/2019 21:12, Thomas Petazzoni wrote:
> Hello Francis,
>
> You are respining the patches too fast, without answering some of the
> questions, and therefore there's still an issue, see below.

Just a heads-up that things have got a bit out of sync for RISC-V
architecture on the master branch...

a) commit 'allow BR2_LINUX_KERNEL_IMAGE on RISC-V'
(a3a4d4d4d307fd21f19ae43e77ac21b85adad7f2) is causing riscv builds to
fail for the existing qemu defconfigs because OpenSBI hasn't been added
yet and riscv-pk expects a 'vmlinux' file.

b) commit 'configs/qemu_riscv32_virt: upgrade to 4.20 kernel'
(e92d5624236e47e1abe44f2ace24fceb1882c0a5) results in a kernel that
won't boot with QEMU due to lack of OpenSBI and/or required kernel
configuration updates.

Might be worth backing these out if the other updates are going to take
a while?

Regards

Mark

-- 
Mark Corbin
Embecosm Ltd.
https://www.embecosm.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 2/4] boot/opensbi: new package
  2019-03-21 16:36     ` Mark Corbin
@ 2019-03-21 16:57       ` Thomas Petazzoni
  2019-03-23  6:44         ` Alistair Francis
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2019-03-21 16:57 UTC (permalink / raw)
  To: buildroot

Hello Mark,

Thanks for the heads-up!

On Thu, 21 Mar 2019 16:36:22 +0000
Mark Corbin <mark.corbin@embecosm.com> wrote:

> a) commit 'allow BR2_LINUX_KERNEL_IMAGE on RISC-V'
> (a3a4d4d4d307fd21f19ae43e77ac21b85adad7f2) is causing riscv builds to
> fail for the existing qemu defconfigs because OpenSBI hasn't been added
> yet and riscv-pk expects a 'vmlinux' file.

This one should be fixed by adding:

BR2_LINUX_KERNEL_VMLINUX=y

in the defconfig.

> b) commit 'configs/qemu_riscv32_virt: upgrade to 4.20 kernel'
> (e92d5624236e47e1abe44f2ace24fceb1882c0a5) results in a kernel that
> won't boot with QEMU due to lack of OpenSBI and/or required kernel
> configuration updates.

Which configuration updates are needed ? The ones that Alistair was
pushing ? If they were need for the 4.20 bump to work, then they should
have been part of the same commit :-/

Anyway, Alistair has been respinning his series very frequently, so I
assume we can get the remainder of the work merged very soon.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 2/4] boot/opensbi: new package
  2019-03-21 16:57       ` Thomas Petazzoni
@ 2019-03-23  6:44         ` Alistair Francis
  0 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2019-03-23  6:44 UTC (permalink / raw)
  To: buildroot

On Thu, Mar 21, 2019 at 6:57 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Mark,
>
> Thanks for the heads-up!

I am on holidays for the next few days so I won't be able to send any
more patches until next week.

>
> On Thu, 21 Mar 2019 16:36:22 +0000
> Mark Corbin <mark.corbin@embecosm.com> wrote:
>
> > a) commit 'allow BR2_LINUX_KERNEL_IMAGE on RISC-V'
> > (a3a4d4d4d307fd21f19ae43e77ac21b85adad7f2) is causing riscv builds to
> > fail for the existing qemu defconfigs because OpenSBI hasn't been added
> > yet and riscv-pk expects a 'vmlinux' file.
>
> This one should be fixed by adding:
>
> BR2_LINUX_KERNEL_VMLINUX=y
>
> in the defconfig.

I didn't realise that enabling Image would change the default.

>
> > b) commit 'configs/qemu_riscv32_virt: upgrade to 4.20 kernel'
> > (e92d5624236e47e1abe44f2ace24fceb1882c0a5) results in a kernel that
> > won't boot with QEMU due to lack of OpenSBI and/or required kernel
> > configuration updates.
>
> Which configuration updates are needed ? The ones that Alistair was
> pushing ? If they were need for the 4.20 bump to work, then they should
> have been part of the same commit :-/

Sorry about this. I tested them with a custom config that wasn't
commuted in the same patch.

>
> Anyway, Alistair has been respinning his series very frequently, so I
> assume we can get the remainder of the work merged very soon.

Are there any comments on the latest series? Or can they be merged to fix this.

Alistair

>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-03-23  6:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20  0:38 [Buildroot] [PATCH v5 1/4] board/qemu/riscv32-virt: Update linux config Alistair Francis
2019-03-20  0:38 ` [Buildroot] [PATCH v5 3/4] configs: qemu_riscv*_virt: Use OpenSBI by default Alistair Francis
2019-03-20  0:38 ` [Buildroot] [PATCH v5 2/4] boot/opensbi: new package Alistair Francis
2019-03-20 21:12   ` Thomas Petazzoni
2019-03-20 21:28     ` Alistair Francis
2019-03-20 21:44       ` Thomas Petazzoni
2019-03-21 16:36     ` Mark Corbin
2019-03-21 16:57       ` Thomas Petazzoni
2019-03-23  6:44         ` Alistair Francis
2019-03-20  0:38 ` [Buildroot] [PATCH v5 4/4] boot/riscv-pk: Deprecate riscv-pk and BBL Alistair Francis
2019-03-20 19:20 ` [Buildroot] [PATCH v5 1/4] board/qemu/riscv32-virt: Update linux config Arnout Vandecappelle
2019-03-20 22:50   ` Alistair Francis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.