Skip to contentSkip to conversation

board/qemu/riscv32-virt: Update linux config

PATCH New Alistair Francis 5 participants 12 messages Mar 20, 2019 – Mar 23, 2019 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/4 board/qemu/riscv32-virt: Update linux config

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

---
 board/qemu/riscv32-virt/linux.config | 35 +++++++++++-----------------
 configs/qemu_riscv32_virt_defconfig  |  4 ++--
 2 files changed, 15 insertions(+), 24 deletions(-)
board/qemu/riscv32-virt/linux.config +13 -22
index c25583f768..fa8a9fd650 100644
@@ -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
configs/qemu_riscv32_virt_defconfig +2 -2
index 6f9a61b11c..15b4c5624c 100644
@@ -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
Signature · 1 line
2.21.0
#1 lore raw

PATCH v5 2/4 boot/opensbi: new package

OpenSBI 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
index 3e0ac08e11..91eda42949 100644
@@ -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
index 74481e7545..97bd3de6e9 100644
@@ -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
new file mode 100644
index 0000000000..5f3cc13312
@@ -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
new file mode 100644
index 0000000000..341e2dcb19
@@ -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))
Signature · 1 line
2.21.0
#2 lore raw

PATCH v5 2/4 boot/opensbi: new package

Hello Francis,

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

boot/opensbi/opensbi.mk line 34

Quoted 10 lines · On Wed, 20 Mar 2019 00:38:05 +0000 Alistair Francis <[email protected]>…
boot/opensbi/opensbi.mk new file +10 -0
+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

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v5 2/4 boot/opensbi: new package

Quoted 5 lines · Thomas Petazzoni

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.

Quoted 4 lines

On Wed, 20 Mar 2019 00:38:05 +0000 Alistair Francis <[email protected]> wrote:

Quoted 14 lines

boot/opensbi/opensbi.mk line 34

Quoted 10 lines
boot/opensbi/opensbi.mk new file +10 -0
+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.

Quoted 3 lines

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.

Quoted 5 lines

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.

Quoted 2 lines

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

Ok, fixed.

Alistair

Quoted 8 lines

Best regards,

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

#4 lore raw

PATCH v5 2/4 boot/opensbi: new package

Hello,

Quoted 7 lines · On Wed, 20 Mar 2019 14:28:59 -0700 Alistair Francis <[email protected]>…
Quoted 5 lines

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

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH v5 2/4 boot/opensbi: new package

In reply to Thomas Petazzoni

Hello Thomas

Quoted 4 lines · Thomas Petazzoni

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

Signature · 3 lines
Mark Corbin
Embecosm Ltd.
https://www.embecosm.com
#6 lore raw

PATCH v5 2/4 boot/opensbi: new package

Hello Mark,

Thanks for the heads-up!

Quoted 4 lines · On Thu, 21 Mar 2019 16:36:22 +0000 Mark Corbin <[email protected]> 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.

Quoted 4 lines

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

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH v5 2/4 boot/opensbi: new package

Quoted 4 lines · Thomas Petazzoni

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.

Quoted 9 lines
Quoted 4 lines · On Thu, 21 Mar 2019 16:36:22 +0000 Mark Corbin <[email protected]> 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.

Quoted 5 lines

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.

Quoted 9 lines
Quoted 5 lines

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.

Quoted 3 lines

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

Quoted 8 lines

Best regards,

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

#8 lore raw

PATCH v5 3/4 configs: qemu_riscv*_virt: Use OpenSBI by default

In reply to Alistair Francis

Use 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
index 2da99580e5..fb441723fd 100644
@@ -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
board/qemu/riscv64-virt/readme.txt +3 -3
index 9f6e35c867..0af27f7bf2 100644
@@ -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
configs/qemu_riscv32_virt_defconfig +4 -1
index 15b4c5624c..18a143a90f 100644
@@ -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"
configs/qemu_riscv64_virt_defconfig +4 -1
index 596edf2fcd..05d2764003 100644
@@ -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
#9 lore raw

PATCH v5 4/4 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
index b4fe36590f..cf9c5cd8ee 100644
@@ -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
#10 lore raw

PATCH v5 1/4 board/qemu/riscv32-virt: Update linux config

In reply to Alistair Francis

Hi Alistair,

Quoted 2 lines · Alistair Francis

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.

board/qemu/riscv32-virt/linux.config line 2

Quoted 13 lines
---
 board/qemu/riscv32-virt/linux.config | 35 +++++++++++-----------------
 configs/qemu_riscv32_virt_defconfig  |  4 ++--
 2 files changed, 15 insertions(+), 24 deletions(-)
board/qemu/riscv32-virt/linux.config +2 -0
index c25583f768..fa8a9fd650 100644
@@ -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]

configs/qemu_riscv32_virt_defconfig BR2_LINUX_KERNEL=y · line 22

Quoted 12 lines
configs/qemu_riscv32_virt_defconfig +2 -2
index 6f9a61b11c..15b4c5624c 100644
@@ -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

#11 lore raw

PATCH v5 1/4 board/qemu/riscv32-virt: Update linux config

Quoted 23 lines · Arnout Vandecappelle

Hi Alistair,

Quoted 2 lines · Alistair Francis

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

Quoted 2 lines

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.

Quoted 17 lines
Quoted 12 lines
---
 board/qemu/riscv32-virt/linux.config | 35 +++++++++++-----------------
 configs/qemu_riscv32_virt_defconfig  |  4 ++--
 2 files changed, 15 insertions(+), 24 deletions(-)
board/qemu/riscv32-virt/linux.config +0 -0
index c25583f768..fa8a9fd650 100644

board/qemu/riscv32-virt/linux.config line 2

Quoted 2 lines
board/qemu/riscv32-virt/linux.config +2 -0
@@ -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.

Quoted 1 line

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.

Quoted 17 lines

[snip]

configs/qemu_riscv32_virt_defconfig BR2_LINUX_KERNEL=y · line 22

Quoted 12 lines
configs/qemu_riscv32_virt_defconfig +2 -2
index 6f9a61b11c..15b4c5624c 100644
@@ -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

Quoted 4 lines

Regards,
Arnout