* [Buildroot] [PATCH v2 0/5] Lichee RV and Lichee RV dock support
@ 2022-10-14 6:58 Angelo Compagnucci
2022-10-14 6:58 ` [Buildroot] [PATCH v2 1/5] linux: enable CONFIG_EXTRA_FIRMWARE_DIR Angelo Compagnucci
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Angelo Compagnucci @ 2022-10-14 6:58 UTC (permalink / raw)
To: buildroot; +Cc: Angelo Compagnucci
In order to support bluetooth on the dock, I had to fully enable the
CONFIG_EXTRA_FIRMWARE mechanism: indeed the bluetooth driver requires a
firmware which is not available at the moment of loading if not embedded
in the kernel image.
I choose to install the extra firmware files in staging, so there is no
need to clean the target filesystem for those files after building the
kernel.
The macro KCONFIG_APPEND_OPT was needed so each one of the packages
willing to have a firmware embedded can simply have a
$(call KCONFIG_APPEND_OPT,CONFIG_EXTRA_FIRMWARE,firmware.bin)
Changelog:
v2:
* Renamed the configs from lichee_rv_* to sipeed_lichee_rv_*
* Moved the boards directories intoboard/sipeed
* Added bluetooth support for lichee_rv_dock
* Updated the opensbi, uboot, linux version to the same as nezha
Angelo Compagnucci (5):
linux: enable CONFIG_EXTRA_FIRMWARE_DIR
package/pkg-utils: add KCONFIG_APPEND_OPT
ackage/rtl8723ds-bt: new package
configs/lichee_rv: new defconfig
configs/lichee_rv_dock: new defconfig
board/sipeed/lichee_rv/genimage.cfg | 37 +++++++++++++
...t-building-u-boot.toc1-for-lichee-rv.patch | 54 +++++++++++++++++++
board/sipeed/lichee_rv/readme.txt | 26 +++++++++
board/sipeed/lichee_rv_dock/genimage.cfg | 37 +++++++++++++
.../overlay/etc/network/interfaces | 7 +++
.../overlay/etc/wpa_supplicant.conf | 8 +++
...t-building-u-boot.toc1-for-lichee-rv.patch | 54 +++++++++++++++++++
...-d1-lichee-rv-dock-add-bluetooth-bin.patch | 33 ++++++++++++
board/sipeed/lichee_rv_dock/readme.txt | 45 ++++++++++++++++
configs/sipeed_lichee_rv_defconfig | 34 ++++++++++++
configs/sipeed_lichee_rv_dock_defconfig | 40 ++++++++++++++
linux/linux.mk | 6 ++-
package/Config.in | 1 +
package/pkg-utils.mk | 10 ++++
package/rtl8723ds-bt/Config.in | 6 +++
package/rtl8723ds-bt/rtl8723ds-bt.hash | 2 +
package/rtl8723ds-bt/rtl8723ds-bt.mk | 28 ++++++++++
17 files changed, 427 insertions(+), 1 deletion(-)
create mode 100644 board/sipeed/lichee_rv/genimage.cfg
create mode 100644 board/sipeed/lichee_rv/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-lichee-rv.patch
create mode 100644 board/sipeed/lichee_rv/readme.txt
create mode 100644 board/sipeed/lichee_rv_dock/genimage.cfg
create mode 100644 board/sipeed/lichee_rv_dock/overlay/etc/network/interfaces
create mode 100644 board/sipeed/lichee_rv_dock/overlay/etc/wpa_supplicant.conf
create mode 100644 board/sipeed/lichee_rv_dock/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-lichee-rv.patch
create mode 100644 board/sipeed/lichee_rv_dock/patches/uboot/0002-RISCV-dts-sun20i-d1-lichee-rv-dock-add-bluetooth-bin.patch
create mode 100644 board/sipeed/lichee_rv_dock/readme.txt
create mode 100644 configs/sipeed_lichee_rv_defconfig
create mode 100644 configs/sipeed_lichee_rv_dock_defconfig
create mode 100644 package/rtl8723ds-bt/Config.in
create mode 100644 package/rtl8723ds-bt/rtl8723ds-bt.hash
create mode 100644 package/rtl8723ds-bt/rtl8723ds-bt.mk
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v2 1/5] linux: enable CONFIG_EXTRA_FIRMWARE_DIR
2022-10-14 6:58 [Buildroot] [PATCH v2 0/5] Lichee RV and Lichee RV dock support Angelo Compagnucci
@ 2022-10-14 6:58 ` Angelo Compagnucci
2022-10-30 20:43 ` Thomas Petazzoni via buildroot
2022-10-30 21:23 ` Yann E. MORIN
2022-10-14 6:58 ` [Buildroot] [PATCH v2 2/5] package/pkg-utils: add KCONFIG_APPEND_OPT Angelo Compagnucci
` (3 subsequent siblings)
4 siblings, 2 replies; 12+ messages in thread
From: Angelo Compagnucci @ 2022-10-14 6:58 UTC (permalink / raw)
To: buildroot; +Cc: Angelo Compagnucci
CONFIG_EXTRA_FIRMWARE_DIR must point to the directory where firmware
file from CONFIG_EXTRA_FIRMWARE will be taken to be embedded to the
kernel.
The option is removed if CONFIG_EXTRA_FIRMWARE is not used, but it
defaults to a sensible value when used.
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
linux/linux.mk | 3 +++
1 file changed, 3 insertions(+)
diff --git a/linux/linux.mk b/linux/linux.mk
index efdc21eff2..9a909c7d7b 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -408,6 +408,9 @@ define LINUX_KCONFIG_FIXUP_CMDS
$(call KCONFIG_ENABLE_OPT,CONFIG_LOGO)
$(call KCONFIG_ENABLE_OPT,CONFIG_LOGO_LINUX_CLUT224))
$(call KCONFIG_DISABLE_OPT,CONFIG_GCC_PLUGINS)
+ # The kernel CONFIG_EXTRA_FIRMWARE feature requires to have the firmware full
+ # path for locating firmware file.
+ $(call KCONFIG_SET_OPT,CONFIG_EXTRA_FIRMWARE_DIR,"$(STAGING_DIR)/lib/firmware")
$(PACKAGES_LINUX_CONFIG_FIXUPS)
endef
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v2 2/5] package/pkg-utils: add KCONFIG_APPEND_OPT
2022-10-14 6:58 [Buildroot] [PATCH v2 0/5] Lichee RV and Lichee RV dock support Angelo Compagnucci
2022-10-14 6:58 ` [Buildroot] [PATCH v2 1/5] linux: enable CONFIG_EXTRA_FIRMWARE_DIR Angelo Compagnucci
@ 2022-10-14 6:58 ` Angelo Compagnucci
2022-10-14 6:58 ` [Buildroot] [PATCH v2 3/5] ackage/rtl8723ds-bt: new package Angelo Compagnucci
` (2 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Angelo Compagnucci @ 2022-10-14 6:58 UTC (permalink / raw)
To: buildroot; +Cc: Angelo Compagnucci
This macro can be used to append a value to a previously configured
option where the intent is to join the old value with the new one.
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
package/pkg-utils.mk | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index 0945e6ed31..d812946934 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -33,6 +33,16 @@ define KCONFIG_ENABLE_OPT
$(call KCONFIG_MUNGE_DOT_CONFIG, $(1), $(1)=y, $(2)); \
fi
endef
+# KCONFIG_APPEND_OPT (option, value, [, file])
+# If the option is already set append, else add new.
+define KCONFIG_APPEND_OPT
+ $(Q)if ! grep -q '^$(strip $(1))' $(call KCONFIG_DOT_CONFIG,$(3)); then \
+ $(call KCONFIG_MUNGE_DOT_CONFIG, $(1), $(1)=$(2), $(3)); \
+ else \
+ grep -E '$(strip $(1)).*$(strip $(2))' $(call KCONFIG_DOT_CONFIG,$(3)) || \
+ $(SED) 's|$(1)="\(.*\)"|$(1)="\1 $(2)"|g' $(call KCONFIG_DOT_CONFIG,$(3)); \
+ fi
+endef
# KCONFIG_SET_OPT (option, value [, file])
KCONFIG_SET_OPT = $(call KCONFIG_MUNGE_DOT_CONFIG, $(1), $(1)=$(2), $(3))
# KCONFIG_DISABLE_OPT (option [, file])
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v2 3/5] ackage/rtl8723ds-bt: new package
2022-10-14 6:58 [Buildroot] [PATCH v2 0/5] Lichee RV and Lichee RV dock support Angelo Compagnucci
2022-10-14 6:58 ` [Buildroot] [PATCH v2 1/5] linux: enable CONFIG_EXTRA_FIRMWARE_DIR Angelo Compagnucci
2022-10-14 6:58 ` [Buildroot] [PATCH v2 2/5] package/pkg-utils: add KCONFIG_APPEND_OPT Angelo Compagnucci
@ 2022-10-14 6:58 ` Angelo Compagnucci
2022-10-30 20:48 ` Thomas Petazzoni via buildroot
2022-10-14 6:58 ` [Buildroot] [PATCH v2 4/5] configs/lichee_rv: new defconfig Angelo Compagnucci
2022-10-14 6:59 ` [Buildroot] [PATCH v2 5/5] configs/lichee_rv_dock: " Angelo Compagnucci
4 siblings, 1 reply; 12+ messages in thread
From: Angelo Compagnucci @ 2022-10-14 6:58 UTC (permalink / raw)
To: buildroot; +Cc: Angelo Compagnucci
This package enables the Bluetooth device embedded in the RTL8723DS
chip.
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
linux/linux.mk | 3 ++-
package/Config.in | 1 +
package/rtl8723ds-bt/Config.in | 6 ++++++
package/rtl8723ds-bt/rtl8723ds-bt.hash | 2 ++
package/rtl8723ds-bt/rtl8723ds-bt.mk | 28 ++++++++++++++++++++++++++
5 files changed, 39 insertions(+), 1 deletion(-)
create mode 100644 package/rtl8723ds-bt/Config.in
create mode 100644 package/rtl8723ds-bt/rtl8723ds-bt.hash
create mode 100644 package/rtl8723ds-bt/rtl8723ds-bt.mk
diff --git a/linux/linux.mk b/linux/linux.mk
index 9a909c7d7b..8ae5a97a80 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -78,7 +78,8 @@ LINUX_DEPENDENCIES += \
$(if $(BR2_PACKAGE_INTEL_MICROCODE),intel-microcode) \
$(if $(BR2_PACKAGE_LINUX_FIRMWARE),linux-firmware) \
$(if $(BR2_PACKAGE_FIRMWARE_IMX),firmware-imx) \
- $(if $(BR2_PACKAGE_WIRELESS_REGDB),wireless-regdb)
+ $(if $(BR2_PACKAGE_WIRELESS_REGDB),wireless-regdb) \
+ $(if $(BR2_PACKAGE_RTL8723DS_BT),rtl8723ds-bt)
# Starting with 4.16, the generated kconfig paser code is no longer
# shipped with the kernel sources, so we need flex and bison, but
diff --git a/package/Config.in b/package/Config.in
index e3a34d6e97..4f6e508106 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -578,6 +578,7 @@ endmenu
source "package/rtl8189fs/Config.in"
source "package/rtl8723bu/Config.in"
source "package/rtl8723ds/Config.in"
+ source "package/rtl8723ds-bt/Config.in"
source "package/rtl8812au-aircrack-ng/Config.in"
source "package/rtl8821au/Config.in"
source "package/sane-backends/Config.in"
diff --git a/package/rtl8723ds-bt/Config.in b/package/rtl8723ds-bt/Config.in
new file mode 100644
index 0000000000..ab4ba0bf11
--- /dev/null
+++ b/package/rtl8723ds-bt/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_RTL8723DS_BT
+ bool "rtl8723ds-bt"
+ help
+ rtl8723ds UART attached Bluetooth driver
+
+ https://github.com/wsyco/RTL8723DS_BT_Linux
diff --git a/package/rtl8723ds-bt/rtl8723ds-bt.hash b/package/rtl8723ds-bt/rtl8723ds-bt.hash
new file mode 100644
index 0000000000..1ec4e350f9
--- /dev/null
+++ b/package/rtl8723ds-bt/rtl8723ds-bt.hash
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 9e70a981946abeeb6437d9a27d8437cea15aa4df72f8d56ded0ae28af484d2f4 rtl8723ds-bt-14cedf3a9fec1aa8c500fa52f3e3acc433cbcf08.tar.gz
diff --git a/package/rtl8723ds-bt/rtl8723ds-bt.mk b/package/rtl8723ds-bt/rtl8723ds-bt.mk
new file mode 100644
index 0000000000..be1b9a9cc2
--- /dev/null
+++ b/package/rtl8723ds-bt/rtl8723ds-bt.mk
@@ -0,0 +1,28 @@
+################################################################################
+#
+# rtl8723ds-bt
+#
+################################################################################
+
+RTL8723DS_BT_VERSION = 14cedf3a9fec1aa8c500fa52f3e3acc433cbcf08
+RTL8723DS_BT_SITE = $(call github,wsyco,RTL8723DS_BT_Linux,$(RTL8723DS_BT_VERSION))
+RTL8723DS_BT_LICENSE = PROPRIETARY
+RTL8723DS_BT_INSTALL_STAGING = YES
+
+define RTL8723DS_BT_LINUX_CONFIG_FIXUPS
+ $(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_DEV_BUS)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_DEV_CTRL_TTYPORT)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_BT)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_BT_HCIUART)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_BT_HCIUART_3WIRE)
+ $(call KCONFIG_ENABLE_OPT,CONFIG_BT_HCIUART_RTL)
+ $(call KCONFIG_APPEND_OPT,CONFIG_EXTRA_FIRMWARE,rtl_bt/rtl8723ds_fw.bin rtl_bt/rtl8723ds_config.bin)
+endef
+
+define RTL8723DS_BT_INSTALL_STAGING_CMDS
+ mkdir -p $(STAGING_DIR)/lib/firmware/rtl_bt/
+ cp $(@D)/8723D/rtl8723d_fw $(STAGING_DIR)/lib/firmware/rtl_bt/rtl8723ds_fw.bin
+ cp $(@D)/8723D/rtl8723d_config $(STAGING_DIR)/lib/firmware/rtl_bt/rtl8723ds_config.bin
+endef
+
+$(eval $(generic-package))
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v2 4/5] configs/lichee_rv: new defconfig
2022-10-14 6:58 [Buildroot] [PATCH v2 0/5] Lichee RV and Lichee RV dock support Angelo Compagnucci
` (2 preceding siblings ...)
2022-10-14 6:58 ` [Buildroot] [PATCH v2 3/5] ackage/rtl8723ds-bt: new package Angelo Compagnucci
@ 2022-10-14 6:58 ` Angelo Compagnucci
2022-10-14 6:59 ` [Buildroot] [PATCH v2 5/5] configs/lichee_rv_dock: " Angelo Compagnucci
4 siblings, 0 replies; 12+ messages in thread
From: Angelo Compagnucci @ 2022-10-14 6:58 UTC (permalink / raw)
To: buildroot; +Cc: Angelo Compagnucci
Lichee RV - Nezha CM is a compute module with modular design, equipped
with Allwinner D1 chip (based on T-Head XuanTie C906 core), 512MB DDR3
RAM.
Board support is based on the nezha defconfig already available in
buildroot.
https://wiki.sipeed.com/hardware/en/lichee/RV/RV.html
https://linux-sunxi.org/Sipeed_Lichee_RV
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
board/sipeed/lichee_rv/genimage.cfg | 37 +++++++++++++
...t-building-u-boot.toc1-for-lichee-rv.patch | 54 +++++++++++++++++++
board/sipeed/lichee_rv/readme.txt | 26 +++++++++
configs/sipeed_lichee_rv_defconfig | 34 ++++++++++++
4 files changed, 151 insertions(+)
create mode 100644 board/sipeed/lichee_rv/genimage.cfg
create mode 100644 board/sipeed/lichee_rv/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-lichee-rv.patch
create mode 100644 board/sipeed/lichee_rv/readme.txt
create mode 100644 configs/sipeed_lichee_rv_defconfig
diff --git a/board/sipeed/lichee_rv/genimage.cfg b/board/sipeed/lichee_rv/genimage.cfg
new file mode 100644
index 0000000000..52603c3f70
--- /dev/null
+++ b/board/sipeed/lichee_rv/genimage.cfg
@@ -0,0 +1,37 @@
+# Minimal SD card image for the sipeed Lichee RV
+
+image sdcard.img {
+ hdimage {
+ }
+
+ partition boot0-1 {
+ in-partition-table = "no"
+ image = "boot0_sdcard_sun20iw1p1.bin"
+ offset = 8K
+ }
+
+ partition boot0-2 {
+ in-partition-table = "no"
+ image = "boot0_sdcard_sun20iw1p1.bin"
+ offset = 128K
+ }
+
+ partition u-boot-1 {
+ in-partition-table = "no"
+ image = "u-boot.toc1"
+ offset = 12M
+ }
+
+ partition u-boot-2 {
+ in-partition-table = "no"
+ image = "u-boot.toc1"
+ offset = 16400K
+ }
+
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext4"
+ bootable = "true"
+ offset = 18M
+ }
+}
diff --git a/board/sipeed/lichee_rv/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-lichee-rv.patch b/board/sipeed/lichee_rv/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-lichee-rv.patch
new file mode 100644
index 0000000000..69ebe3b21d
--- /dev/null
+++ b/board/sipeed/lichee_rv/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-lichee-rv.patch
@@ -0,0 +1,54 @@
+From 4a923e0e4ef6d2b41cb89d658e269adada847573 Mon Sep 17 00:00:00 2001
+From: Peter Korsgaard <peter@korsgaard.com>
+Date: Thu, 4 Nov 2021 22:32:04 +0100
+Subject: [PATCH] Makefile: HACK: Support building u-boot.toc1 for nezda board
+
+For easier integration into Buildroot. The boot0 / toc1 logic is WIP until
+U-Boot gains SPL support for the D1, so add a hack to make it easier to
+integrate in Buildroot as-is.
+
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+---
+ Makefile | 9 +++++++++
+ nezha.cfg | 9 +++++++++
+ 2 files changed, 18 insertions(+)
+ create mode 100644 nezha.cfg
+
+diff --git a/Makefile b/Makefile
+index f911f70344..259d93bf80 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1084,6 +1084,15 @@ endif
+ .binman_stamp: FORCE
+ @touch $@
+
++fw_dynamic.bin: $(OPENSBI)
++ $(call if_changed,copy)
++
++MKIMAGEFLAGS_u-boot.toc1 = -T sunxi_toc1
++u-boot.toc1: lichee-rv.cfg fw_dynamic.bin inputs
++ $(call if_changed,mkimage)
++
++all: u-boot.toc1
++
+ ifeq ($(CONFIG_DEPRECATED),y)
+ $(warning "You have deprecated configuration options enabled in your .config! Please check your configuration.")
+ endif
+diff --git a/lichee-rv.cfg b/lichee-rv.cfg
+new file mode 100644
+index 0000000000..2d23b9b388
+--- /dev/null
++++ b/lichee-rv.cfg
+@@ -0,0 +1,9 @@
++[opensbi]
++file = fw_dynamic.bin
++addr = 0x40000000
++[dtb]
++file = arch/riscv/dts/sun20i-d1-lichee-rv.dtb
++addr = 0x44000000
++[u-boot]
++file = u-boot-nodtb.bin
++addr = 0x4a000000
+--
+2.20.1
+
diff --git a/board/sipeed/lichee_rv/readme.txt b/board/sipeed/lichee_rv/readme.txt
new file mode 100644
index 0000000000..008be3a3bc
--- /dev/null
+++ b/board/sipeed/lichee_rv/readme.txt
@@ -0,0 +1,26 @@
+Lichee RV
+===============
+
+Lichee RV - Nezha CM is a compute module with modular design, equipped
+with Allwinner D1 chip (based on T-Head XuanTie C906 core), 512MB DDR3 RAM.
+It can boot from TF card or SD-NAND, uses two sets of M.2 b key 67 pin
+connectors to route all IO, making it convient for wide use and easy to replace.
+
+How to build
+============
+
+$ make lichee_rv_defconfig
+$ make
+
+How to write the SD card
+========================
+
+Once the build process is finished you will have an image called "sdcard.img"
+in the output/images/ directory.
+
+Copy the bootable "sdcard.img" onto an SD card with "dd":
+
+ $ sudo dd if=output/images/sdcard.img of=/dev/sdX
+
+Connect a TTL UART to the debug connector, insert the microSD card and
+plug in a USB-C cable to the PWR connector to boot the system.
diff --git a/configs/sipeed_lichee_rv_defconfig b/configs/sipeed_lichee_rv_defconfig
new file mode 100644
index 0000000000..355d5caa70
--- /dev/null
+++ b/configs/sipeed_lichee_rv_defconfig
@@ -0,0 +1,34 @@
+BR2_riscv=y
+BR2_GLOBAL_PATCH_DIR="board/sipeed/lichee_rv/patches"
+BR2_ROOTFS_OVERLAY="board/nezha/overlay"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/sipeed/lichee_rv/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,linux,fe178cf0153d98b71cb01a46c8cc050826a17e77)/linux-fe178cf0153d98b71cb01a46c8cc050826a17e77.tar.gz"
+BR2_LINUX_KERNEL_DEFCONFIG="nezha"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1-lichee-rv"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_OPENSBI=y
+BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
+BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
+BR2_TARGET_OPENSBI_PLAT="generic"
+# BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
+BR2_TARGET_SUN20I_D1_SPL=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,u-boot,d1-2022-05-26)/uboot-d1-2022-05-26.tar.gz"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="lichee_rv"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
+BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
+BR2_TARGET_UBOOT_NEEDS_OPENSBI=y
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.toc1"
+BR2_PACKAGE_HOST_GENIMAGE=y
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH v2 5/5] configs/lichee_rv_dock: new defconfig
2022-10-14 6:58 [Buildroot] [PATCH v2 0/5] Lichee RV and Lichee RV dock support Angelo Compagnucci
` (3 preceding siblings ...)
2022-10-14 6:58 ` [Buildroot] [PATCH v2 4/5] configs/lichee_rv: new defconfig Angelo Compagnucci
@ 2022-10-14 6:59 ` Angelo Compagnucci
4 siblings, 0 replies; 12+ messages in thread
From: Angelo Compagnucci @ 2022-10-14 6:59 UTC (permalink / raw)
To: buildroot; +Cc: Angelo Compagnucci
Lichee RV Dock is a RISC-V Linux development kits with high integration,
small size and affordable price designed for opensource developer.
https://wiki.sipeed.com/hardware/en/lichee/RV/Dock.html
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
board/sipeed/lichee_rv_dock/genimage.cfg | 37 +++++++++++++
.../overlay/etc/network/interfaces | 7 +++
.../overlay/etc/wpa_supplicant.conf | 8 +++
...t-building-u-boot.toc1-for-lichee-rv.patch | 54 +++++++++++++++++++
...-d1-lichee-rv-dock-add-bluetooth-bin.patch | 33 ++++++++++++
board/sipeed/lichee_rv_dock/readme.txt | 45 ++++++++++++++++
configs/sipeed_lichee_rv_dock_defconfig | 40 ++++++++++++++
7 files changed, 224 insertions(+)
create mode 100644 board/sipeed/lichee_rv_dock/genimage.cfg
create mode 100644 board/sipeed/lichee_rv_dock/overlay/etc/network/interfaces
create mode 100644 board/sipeed/lichee_rv_dock/overlay/etc/wpa_supplicant.conf
create mode 100644 board/sipeed/lichee_rv_dock/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-lichee-rv.patch
create mode 100644 board/sipeed/lichee_rv_dock/patches/uboot/0002-RISCV-dts-sun20i-d1-lichee-rv-dock-add-bluetooth-bin.patch
create mode 100644 board/sipeed/lichee_rv_dock/readme.txt
create mode 100644 configs/sipeed_lichee_rv_dock_defconfig
diff --git a/board/sipeed/lichee_rv_dock/genimage.cfg b/board/sipeed/lichee_rv_dock/genimage.cfg
new file mode 100644
index 0000000000..016acc3611
--- /dev/null
+++ b/board/sipeed/lichee_rv_dock/genimage.cfg
@@ -0,0 +1,37 @@
+# Minimal SD card image for the sipeed Lichee RV dock
+
+image sdcard.img {
+ hdimage {
+ }
+
+ partition boot0-1 {
+ in-partition-table = "no"
+ image = "boot0_sdcard_sun20iw1p1.bin"
+ offset = 8K
+ }
+
+ partition boot0-2 {
+ in-partition-table = "no"
+ image = "boot0_sdcard_sun20iw1p1.bin"
+ offset = 128K
+ }
+
+ partition u-boot-1 {
+ in-partition-table = "no"
+ image = "u-boot.toc1"
+ offset = 12M
+ }
+
+ partition u-boot-2 {
+ in-partition-table = "no"
+ image = "u-boot.toc1"
+ offset = 16400K
+ }
+
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext4"
+ bootable = "true"
+ offset = 18M
+ }
+}
diff --git a/board/sipeed/lichee_rv_dock/overlay/etc/network/interfaces b/board/sipeed/lichee_rv_dock/overlay/etc/network/interfaces
new file mode 100644
index 0000000000..62153aabd1
--- /dev/null
+++ b/board/sipeed/lichee_rv_dock/overlay/etc/network/interfaces
@@ -0,0 +1,7 @@
+auto lo
+iface lo inet loopback
+
+auto wlan0
+iface wlan0 inet dhcp
+pre-up modprobe 8723ds
+wpa-conf /etc/wpa_supplicant.conf
diff --git a/board/sipeed/lichee_rv_dock/overlay/etc/wpa_supplicant.conf b/board/sipeed/lichee_rv_dock/overlay/etc/wpa_supplicant.conf
new file mode 100644
index 0000000000..b43292b0a7
--- /dev/null
+++ b/board/sipeed/lichee_rv_dock/overlay/etc/wpa_supplicant.conf
@@ -0,0 +1,8 @@
+ap_scan=1
+
+network={
+ ssid="YOURSSID"
+ scan_ssid=1
+ key_mgmt=WPA-PSK
+ psk="YOURPASSWD"
+}
diff --git a/board/sipeed/lichee_rv_dock/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-lichee-rv.patch b/board/sipeed/lichee_rv_dock/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-lichee-rv.patch
new file mode 100644
index 0000000000..396d928b85
--- /dev/null
+++ b/board/sipeed/lichee_rv_dock/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-lichee-rv.patch
@@ -0,0 +1,54 @@
+From 4a923e0e4ef6d2b41cb89d658e269adada847573 Mon Sep 17 00:00:00 2001
+From: Peter Korsgaard <peter@korsgaard.com>
+Date: Thu, 4 Nov 2021 22:32:04 +0100
+Subject: [PATCH] Makefile: HACK: Support building u-boot.toc1 for nezda board
+
+For easier integration into Buildroot. The boot0 / toc1 logic is WIP until
+U-Boot gains SPL support for the D1, so add a hack to make it easier to
+integrate in Buildroot as-is.
+
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+---
+ Makefile | 9 +++++++++
+ nezha.cfg | 9 +++++++++
+ 2 files changed, 18 insertions(+)
+ create mode 100644 nezha.cfg
+
+diff --git a/Makefile b/Makefile
+index f911f70344..259d93bf80 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1084,6 +1084,15 @@ endif
+ .binman_stamp: FORCE
+ @touch $@
+
++fw_dynamic.bin: $(OPENSBI)
++ $(call if_changed,copy)
++
++MKIMAGEFLAGS_u-boot.toc1 = -T sunxi_toc1
++u-boot.toc1: lichee-rv-dock.cfg fw_dynamic.bin inputs
++ $(call if_changed,mkimage)
++
++all: u-boot.toc1
++
+ ifeq ($(CONFIG_DEPRECATED),y)
+ $(warning "You have deprecated configuration options enabled in your .config! Please check your configuration.")
+ endif
+diff --git a/lichee-rv-dock.cfg b/lichee-rv-dock.cfg
+new file mode 100644
+index 0000000000..2d23b9b388
+--- /dev/null
++++ b/lichee-rv-dock.cfg
+@@ -0,0 +1,9 @@
++[opensbi]
++file = fw_dynamic.bin
++addr = 0x40000000
++[dtb]
++file = arch/riscv/dts/sun20i-d1-lichee-rv-dock.dtb
++addr = 0x44000000
++[u-boot]
++file = u-boot-nodtb.bin
++addr = 0x4a000000
+--
+2.20.1
+
diff --git a/board/sipeed/lichee_rv_dock/patches/uboot/0002-RISCV-dts-sun20i-d1-lichee-rv-dock-add-bluetooth-bin.patch b/board/sipeed/lichee_rv_dock/patches/uboot/0002-RISCV-dts-sun20i-d1-lichee-rv-dock-add-bluetooth-bin.patch
new file mode 100644
index 0000000000..091afeacdc
--- /dev/null
+++ b/board/sipeed/lichee_rv_dock/patches/uboot/0002-RISCV-dts-sun20i-d1-lichee-rv-dock-add-bluetooth-bin.patch
@@ -0,0 +1,33 @@
+From add5f78e04e22f12da309f11122c1a9133b09d0b Mon Sep 17 00:00:00 2001
+From: Angelo Compagnucci <angelo@amarulasolutions.com>
+Date: Thu, 13 Oct 2022 22:37:29 +0200
+Subject: [PATCH] RISCV: dts: sun20i: d1: lichee-rv-dock: add bluetooth binding
+
+UART1 is attached to a rtl8723ds bluetooth module
+
+Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
+---
+ arch/riscv/dts/sun20i-d1-lichee-rv-dock.dts | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/arch/riscv/dts/sun20i-d1-lichee-rv-dock.dts b/arch/riscv/dts/sun20i-d1-lichee-rv-dock.dts
+index 0b0f356e2e..c27e682c5e 100644
+--- a/arch/riscv/dts/sun20i-d1-lichee-rv-dock.dts
++++ b/arch/riscv/dts/sun20i-d1-lichee-rv-dock.dts
+@@ -158,6 +158,13 @@
+ pinctrl-0 = <&uart1_pg6_pins>, <&uart1_pg8_rts_cts_pins>;
+ pinctrl-names = "default";
+ status = "okay";
++
++ bluetooth {
++ compatible = "realtek,rtl8723ds-bt";
++ device-wake-gpios = <&gpio 6 15 GPIO_ACTIVE_HIGH>; /* PG16 */
++ enable-gpios = <&gpio 6 18 GPIO_ACTIVE_HIGH>; /* PG18 */
++ host-wake-gpios = <&gpio 6 17 GPIO_ACTIVE_HIGH>; /* PG17 */
++ };
+ };
+
+ &usbphy {
+--
+2.25.1
+
diff --git a/board/sipeed/lichee_rv_dock/readme.txt b/board/sipeed/lichee_rv_dock/readme.txt
new file mode 100644
index 0000000000..34478cafcc
--- /dev/null
+++ b/board/sipeed/lichee_rv_dock/readme.txt
@@ -0,0 +1,45 @@
+Lichee RV dock
+===============
+
+Lichee RV Dock is a RISC-V Linux development kits with high integration, small
+size and affordable price designed for opensource developer. It's equipped with
+HDMI interface and it supports many screen by its screen convert board. It's
+also equipped with many peripherals, including a UAB-A port, 2.4G Wifi-BT module,
+an analog microphone and a speaker jack interface.
+
+How to build
+============
+
+$ make lichee_rv_dock_defconfig
+$ make
+
+Wifi
+==========
+
+Edit board/lichee_rv/overlay_dock/etc/wpa_supplicant.conf or
+/etc/wpa_supplicant.conf once connected to the board:
+
+* Replace YOURSSID with your AP ssid
+* Replace YOURPASSWD with your AP password
+
+Bluetooth
+==========
+
+To make the device discoverable and pairable, once connected to the board:
+
+* bluetoothctl power on
+* bluetoothctl discoverable yes
+* bluetoothctl pairable yes
+
+How to write the SD card
+========================
+
+Once the build process is finished you will have an image called "sdcard.img"
+in the output/images/ directory.
+
+Copy the bootable "sdcard.img" onto an SD card with "dd":
+
+ $ sudo dd if=output/images/sdcard.img of=/dev/sdX
+
+Connect a TTL UART to the debug connector, insert the microSD card and
+plug in a USB-C cable to the PWR connector to boot the system.
diff --git a/configs/sipeed_lichee_rv_dock_defconfig b/configs/sipeed_lichee_rv_dock_defconfig
new file mode 100644
index 0000000000..6da3ae24e4
--- /dev/null
+++ b/configs/sipeed_lichee_rv_dock_defconfig
@@ -0,0 +1,40 @@
+BR2_riscv=y
+BR2_GLOBAL_PATCH_DIR="board/sipeed/lichee_rv_dock/patches"
+BR2_ROOTFS_OVERLAY="board/nezha/overlay board/sipeed/lichee_rv_dock/overlay"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/sipeed/lichee_rv_dock/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,linux,fe178cf0153d98b71cb01a46c8cc050826a17e77)/linux-fe178cf0153d98b71cb01a46c8cc050826a17e77.tar.gz"
+BR2_LINUX_KERNEL_DEFCONFIG="nezha"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1-lichee-rv-dock"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_PACKAGE_BLUEZ5_UTILS=y
+BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
+BR2_PACKAGE_RTL8723DS=y
+BR2_PACKAGE_RTL8723DS_BT=y
+BR2_PACKAGE_WPA_SUPPLICANT=y
+BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_OPENSBI=y
+BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
+BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
+BR2_TARGET_OPENSBI_PLAT="generic"
+# BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
+BR2_TARGET_SUN20I_D1_SPL=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,u-boot,d1-2022-05-26)/uboot-d1-2022-05-26.tar.gz"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="lichee_rv"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
+BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
+BR2_TARGET_UBOOT_NEEDS_OPENSBI=y
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.toc1"
+BR2_PACKAGE_HOST_GENIMAGE=y
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH v2 1/5] linux: enable CONFIG_EXTRA_FIRMWARE_DIR
2022-10-14 6:58 ` [Buildroot] [PATCH v2 1/5] linux: enable CONFIG_EXTRA_FIRMWARE_DIR Angelo Compagnucci
@ 2022-10-30 20:43 ` Thomas Petazzoni via buildroot
2022-10-30 20:52 ` Angelo Compagnucci
2022-10-30 21:23 ` Yann E. MORIN
1 sibling, 1 reply; 12+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-10-30 20:43 UTC (permalink / raw)
To: Angelo Compagnucci; +Cc: buildroot
On Fri, 14 Oct 2022 08:58:56 +0200
Angelo Compagnucci <angelo@amarulasolutions.com> wrote:
> + # The kernel CONFIG_EXTRA_FIRMWARE feature requires to have the firmware full
> + # path for locating firmware file.
> + $(call KCONFIG_SET_OPT,CONFIG_EXTRA_FIRMWARE_DIR,"$(STAGING_DIR)/lib/firmware")
Unfortunately, this is really not a good idea, especially if it is
meant to be used with your rtl8723ds-bt package. Indeed, the
rtl8723ds-bt firmware is according to your package under a PROPRIETARY
license, so not compatible with the GPL.
Except that CONFIG_EXTRA_FIRMWARE_DIR can only be used for firmware
that is GPL-compatible, as they get linked into the kernel image. What
you're proposing to do makes it illegal to distribute the resulting
kernel image. You can do it on your machine, but you're not allowed to
distribute this kernel image, which for something like Buildroot is a
bit of a problem, as you can imagine.
See
https://elixir.bootlin.com/linux/latest/source/Documentation/driver-api/firmware/built-in-fw.rst#L21
The only options for such firmware is:
(1) In the root filesystem, which means the driver needs to be a
module... but that's anyway OK as it's going to be the case as it's an
out of tree kernel driver, and therefore always compiled as a
module.
(2) In an initramfs loaded separately from the kernel.
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH v2 3/5] ackage/rtl8723ds-bt: new package
2022-10-14 6:58 ` [Buildroot] [PATCH v2 3/5] ackage/rtl8723ds-bt: new package Angelo Compagnucci
@ 2022-10-30 20:48 ` Thomas Petazzoni via buildroot
2022-10-30 20:55 ` Angelo Compagnucci
0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-10-30 20:48 UTC (permalink / raw)
To: Angelo Compagnucci; +Cc: buildroot
On Fri, 14 Oct 2022 08:58:58 +0200
Angelo Compagnucci <angelo@amarulasolutions.com> wrote:
> @@ -78,7 +78,8 @@ LINUX_DEPENDENCIES += \
> $(if $(BR2_PACKAGE_INTEL_MICROCODE),intel-microcode) \
> $(if $(BR2_PACKAGE_LINUX_FIRMWARE),linux-firmware) \
> $(if $(BR2_PACKAGE_FIRMWARE_IMX),firmware-imx) \
> - $(if $(BR2_PACKAGE_WIRELESS_REGDB),wireless-regdb)
> + $(if $(BR2_PACKAGE_WIRELESS_REGDB),wireless-regdb) \
> + $(if $(BR2_PACKAGE_RTL8723DS_BT),rtl8723ds-bt)
>
> # Starting with 4.16, the generated kconfig paser code is no longer
> # shipped with the kernel sources, so we need flex and bison, but
> diff --git a/package/Config.in b/package/Config.in
> index e3a34d6e97..4f6e508106 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -578,6 +578,7 @@ endmenu
> source "package/rtl8189fs/Config.in"
> source "package/rtl8723bu/Config.in"
> source "package/rtl8723ds/Config.in"
> + source "package/rtl8723ds-bt/Config.in"
> source "package/rtl8812au-aircrack-ng/Config.in"
> source "package/rtl8821au/Config.in"
> source "package/sane-backends/Config.in"
> diff --git a/package/rtl8723ds-bt/Config.in b/package/rtl8723ds-bt/Config.in
> new file mode 100644
> index 0000000000..ab4ba0bf11
> --- /dev/null
> +++ b/package/rtl8723ds-bt/Config.in
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_RTL8723DS_BT
> + bool "rtl8723ds-bt"
> + help
> + rtl8723ds UART attached Bluetooth driver
So here you're saying this package is for a driver.
> +define RTL8723DS_BT_LINUX_CONFIG_FIXUPS
> + $(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_DEV_BUS)
> + $(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_DEV_CTRL_TTYPORT)
> + $(call KCONFIG_ENABLE_OPT,CONFIG_BT)
> + $(call KCONFIG_ENABLE_OPT,CONFIG_BT_HCIUART)
> + $(call KCONFIG_ENABLE_OPT,CONFIG_BT_HCIUART_3WIRE)
> + $(call KCONFIG_ENABLE_OPT,CONFIG_BT_HCIUART_RTL)
> + $(call KCONFIG_APPEND_OPT,CONFIG_EXTRA_FIRMWARE,rtl_bt/rtl8723ds_fw.bin rtl_bt/rtl8723ds_config.bin)
> +endef
> +
> +define RTL8723DS_BT_INSTALL_STAGING_CMDS
> + mkdir -p $(STAGING_DIR)/lib/firmware/rtl_bt/
> + cp $(@D)/8723D/rtl8723d_fw $(STAGING_DIR)/lib/firmware/rtl_bt/rtl8723ds_fw.bin
> + cp $(@D)/8723D/rtl8723d_config $(STAGING_DIR)/lib/firmware/rtl_bt/rtl8723ds_config.bin
But here you are only installing the firmware file, and you're not
building the kernel module that is provided in this Git repository.
Is it because the driver is in the upstream kernel, and the only part
that it lacks is the firmware?
This is not really clear in your commit log nor in the Config.in help
text.
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH v2 1/5] linux: enable CONFIG_EXTRA_FIRMWARE_DIR
2022-10-30 20:43 ` Thomas Petazzoni via buildroot
@ 2022-10-30 20:52 ` Angelo Compagnucci
0 siblings, 0 replies; 12+ messages in thread
From: Angelo Compagnucci @ 2022-10-30 20:52 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot
[-- Attachment #1.1: Type: text/plain, Size: 2534 bytes --]
On Sun, Oct 30, 2022 at 9:43 PM Thomas Petazzoni <
thomas.petazzoni@bootlin.com> wrote:
> On Fri, 14 Oct 2022 08:58:56 +0200
> Angelo Compagnucci <angelo@amarulasolutions.com> wrote:
>
> > + # The kernel CONFIG_EXTRA_FIRMWARE feature requires to have the
> firmware full
> > + # path for locating firmware file.
> > + $(call
> KCONFIG_SET_OPT,CONFIG_EXTRA_FIRMWARE_DIR,"$(STAGING_DIR)/lib/firmware")
>
> Unfortunately, this is really not a good idea, especially if it is
> meant to be used with your rtl8723ds-bt package. Indeed, the
> rtl8723ds-bt firmware is according to your package under a PROPRIETARY
> license, so not compatible with the GPL.
>
Let's suppose the firware I was planning to load permits to be distributed
within the kernk, why it isn't a good idea?
I don't think technically there is some problems here, else let me
understand.
> Except that CONFIG_EXTRA_FIRMWARE_DIR can only be used for firmware
> that is GPL-compatible, as they get linked into the kernel image. What
> you're proposing to do makes it illegal to distribute the resulting
> kernel image. You can do it on your machine, but you're not allowed to
> distribute this kernel image, which for something like Buildroot is a
> bit of a problem, as you can imagine.
>
> See
>
> https://elixir.bootlin.com/linux/latest/source/Documentation/driver-api/firmware/built-in-fw.rst#L21
I don't really want to go down the rabbit hole of what is legal or not,
there are legal departments for that.
If you think the driver in question is not accptable, I'm ok with that, but
I think the mechanism should stay for all the people who need to do
something like that.
>
> The only options for such firmware is:
>
> (1) In the root filesystem, which means the driver needs to be a
> module... but that's anyway OK as it's going to be the case as it's an
> out of tree kernel driver, and therefore always compiled as a
> module.
>
> (2) In an initramfs loaded separately from the kernel.
>
Let's discuss this in the driver, I'm more than welcome to change the way I
conceived it.
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
>
--
Angelo Compagnucci
Software Engineer
angelo@amarulasolutions.com
__________________________________
Amarula Solutions SRL
Via le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 (0)42 243 5310
info@amarulasolutions.com
www.amarulasolutions.com
[`as] https://www.amarulasolutions.com|
[-- Attachment #1.2: Type: text/html, Size: 7613 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH v2 3/5] ackage/rtl8723ds-bt: new package
2022-10-30 20:48 ` Thomas Petazzoni via buildroot
@ 2022-10-30 20:55 ` Angelo Compagnucci
2022-10-30 21:21 ` Yann E. MORIN
0 siblings, 1 reply; 12+ messages in thread
From: Angelo Compagnucci @ 2022-10-30 20:55 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot
[-- Attachment #1.1: Type: text/plain, Size: 3535 bytes --]
On Sun, Oct 30, 2022 at 9:48 PM Thomas Petazzoni <
thomas.petazzoni@bootlin.com> wrote:
> On Fri, 14 Oct 2022 08:58:58 +0200
> Angelo Compagnucci <angelo@amarulasolutions.com> wrote:
>
> > @@ -78,7 +78,8 @@ LINUX_DEPENDENCIES += \
> > $(if $(BR2_PACKAGE_INTEL_MICROCODE),intel-microcode) \
> > $(if $(BR2_PACKAGE_LINUX_FIRMWARE),linux-firmware) \
> > $(if $(BR2_PACKAGE_FIRMWARE_IMX),firmware-imx) \
> > - $(if $(BR2_PACKAGE_WIRELESS_REGDB),wireless-regdb)
> > + $(if $(BR2_PACKAGE_WIRELESS_REGDB),wireless-regdb) \
> > + $(if $(BR2_PACKAGE_RTL8723DS_BT),rtl8723ds-bt)
> >
> > # Starting with 4.16, the generated kconfig paser code is no longer
> > # shipped with the kernel sources, so we need flex and bison, but
> > diff --git a/package/Config.in b/package/Config.in
> > index e3a34d6e97..4f6e508106 100644
> > --- a/package/Config.in
> > +++ b/package/Config.in
> > @@ -578,6 +578,7 @@ endmenu
> > source "package/rtl8189fs/Config.in"
> > source "package/rtl8723bu/Config.in"
> > source "package/rtl8723ds/Config.in"
> > + source "package/rtl8723ds-bt/Config.in"
> > source "package/rtl8812au-aircrack-ng/Config.in"
> > source "package/rtl8821au/Config.in"
> > source "package/sane-backends/Config.in"
> > diff --git a/package/rtl8723ds-bt/Config.in
> b/package/rtl8723ds-bt/Config.in
> > new file mode 100644
> > index 0000000000..ab4ba0bf11
> > --- /dev/null
> > +++ b/package/rtl8723ds-bt/Config.in
> > @@ -0,0 +1,6 @@
> > +config BR2_PACKAGE_RTL8723DS_BT
> > + bool "rtl8723ds-bt"
> > + help
> > + rtl8723ds UART attached Bluetooth driver
>
> So here you're saying this package is for a driver.
>
> > +define RTL8723DS_BT_LINUX_CONFIG_FIXUPS
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_DEV_BUS)
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_DEV_CTRL_TTYPORT)
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_BT)
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_BT_HCIUART)
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_BT_HCIUART_3WIRE)
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_BT_HCIUART_RTL)
> > + $(call
> KCONFIG_APPEND_OPT,CONFIG_EXTRA_FIRMWARE,rtl_bt/rtl8723ds_fw.bin
> rtl_bt/rtl8723ds_config.bin)
> > +endef
> > +
> > +define RTL8723DS_BT_INSTALL_STAGING_CMDS
> > + mkdir -p $(STAGING_DIR)/lib/firmware/rtl_bt/
> > + cp $(@D)/8723D/rtl8723d_fw
> $(STAGING_DIR)/lib/firmware/rtl_bt/rtl8723ds_fw.bin
> > + cp $(@D)/8723D/rtl8723d_config
> $(STAGING_DIR)/lib/firmware/rtl_bt/rtl8723ds_config.bin
>
> But here you are only installing the firmware file, and you're not
> building the kernel module that is provided in this Git repository.
>
> Is it because the driver is in the upstream kernel, and the only part
> that it lacks is the firmware?
>
> This is not really clear in your commit log nor in the Config.in help
> text.
>
Thi package "enables" (as in the commit log) the module, I didn't want to
word differently, because what we are really doing here is simply enabling
some kernel drivers and offering a way to download the firmware. Anyway, I
will reword it better.
>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
>
--
Angelo Compagnucci
Software Engineer
angelo@amarulasolutions.com
__________________________________
Amarula Solutions SRL
Via le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 (0)42 243 5310
info@amarulasolutions.com
www.amarulasolutions.com
[`as] https://www.amarulasolutions.com|
[-- Attachment #1.2: Type: text/html, Size: 8440 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH v2 3/5] ackage/rtl8723ds-bt: new package
2022-10-30 20:55 ` Angelo Compagnucci
@ 2022-10-30 21:21 ` Yann E. MORIN
0 siblings, 0 replies; 12+ messages in thread
From: Yann E. MORIN @ 2022-10-30 21:21 UTC (permalink / raw)
To: Angelo Compagnucci; +Cc: Thomas Petazzoni, buildroot
Angelo, All,
On 2022-10-30 21:55 +0100, Angelo Compagnucci spake thusly:
> On Sun, Oct 30, 2022 at 9:48 PM Thomas Petazzoni < [1]thomas.petazzoni@bootlin.com> wrote:
> On Fri, 14 Oct 2022 08:58:58 +0200
> Angelo Compagnucci < [2]angelo@amarulasolutions.com> wrote:
> > @@ -78,7 +78,8 @@ LINUX_DEPENDENCIES += \
> > $(if $(BR2_PACKAGE_INTEL_MICROCODE),intel-microcode) \
> > $(if $(BR2_PACKAGE_LINUX_FIRMWARE),linux-firmware) \
> > $(if $(BR2_PACKAGE_FIRMWARE_IMX),firmware-imx) \
> > - $(if $(BR2_PACKAGE_WIRELESS_REGDB),wireless-regdb)
> > + $(if $(BR2_PACKAGE_WIRELESS_REGDB),wireless-regdb) \
> > + $(if $(BR2_PACKAGE_RTL8723DS_BT),rtl8723ds-bt)
> >
> > # Starting with 4.16, the generated kconfig paser code is no longer
> > # shipped with the kernel sources, so we need flex and bison, but
> > diff --git a/package/Config.in b/package/Config.in
> > index e3a34d6e97..4f6e508106 100644
> > --- a/package/Config.in
> > +++ b/package/Config.in
> > @@ -578,6 +578,7 @@ endmenu
> > source "package/rtl8189fs/Config.in"
> > source "package/rtl8723bu/Config.in"
> > source "package/rtl8723ds/Config.in"
> > + source "package/rtl8723ds-bt/Config.in"
> > source "package/rtl8812au-aircrack-ng/Config.in"
> > source "package/rtl8821au/Config.in"
> > source "package/sane-backends/Config.in"
> > diff --git a/package/rtl8723ds-bt/Config.in b/package/rtl8723ds-bt/Config.in
> > new file mode 100644
> > index 0000000000..ab4ba0bf11
> > --- /dev/null
> > +++ b/package/rtl8723ds-bt/Config.in
> > @@ -0,0 +1,6 @@
> > +config BR2_PACKAGE_RTL8723DS_BT
> > + bool "rtl8723ds-bt"
> > + help
> > + rtl8723ds UART attached Bluetooth driver
>
> So here you're saying this package is for a driver.
>
> > +define RTL8723DS_BT_LINUX_CONFIG_FIXUPS
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_DEV_BUS)
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_DEV_CTRL_TTYPORT)
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_BT)
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_BT_HCIUART)
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_BT_HCIUART_3WIRE)
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_BT_HCIUART_RTL)
> > + $(call KCONFIG_APPEND_OPT,CONFIG_EXTRA_FIRMWARE,rtl_bt/rtl8723ds_fw.bin rtl_bt/rtl8723ds_config.bin)
> > +endef
> > +
> > +define RTL8723DS_BT_INSTALL_STAGING_CMDS
> > + mkdir -p $(STAGING_DIR)/lib/firmware/rtl_bt/
> > + cp $(@D)/8723D/rtl8723d_fw $(STAGING_DIR)/lib/firmware/rtl_bt/rtl8723ds_fw.bin
> > + cp $(@D)/8723D/rtl8723d_config $(STAGING_DIR)/lib/firmware/rtl_bt/rtl8723ds_config.bin
>
> But here you are only installing the firmware file, and you're not
> building the kernel module that is provided in this Git repository.
>
> Is it because the driver is in the upstream kernel, and the only part
> that it lacks is the firmware?
>
> This is not really clear in your commit log nor in the Config.in help
> text.
>
> Thi package "enables" (as in the commit log) the module, I didn't want to word differently, because what we are really doing here is
> simply enabling some kernel drivers and offering a way to download the firmware. Anyway, I will reword it better.
Look at the other firmware packages we have: they only install the
firmware blobs they provide.
Enabling kernel options to enable a kernel driver is what the user does
when they provide the configuration file for the kernel. We do not want
to have an option in Buildroot for each driver that can be enabled in
the kernel.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Buildroot] [PATCH v2 1/5] linux: enable CONFIG_EXTRA_FIRMWARE_DIR
2022-10-14 6:58 ` [Buildroot] [PATCH v2 1/5] linux: enable CONFIG_EXTRA_FIRMWARE_DIR Angelo Compagnucci
2022-10-30 20:43 ` Thomas Petazzoni via buildroot
@ 2022-10-30 21:23 ` Yann E. MORIN
1 sibling, 0 replies; 12+ messages in thread
From: Yann E. MORIN @ 2022-10-30 21:23 UTC (permalink / raw)
To: Angelo Compagnucci; +Cc: buildroot
Angelo, All,
On 2022-10-14 08:58 +0200, Angelo Compagnucci spake thusly:
> CONFIG_EXTRA_FIRMWARE_DIR must point to the directory where firmware
> file from CONFIG_EXTRA_FIRMWARE will be taken to be embedded to the
> kernel.
> The option is removed if CONFIG_EXTRA_FIRMWARE is not used, but it
> defaults to a sensible value when used.
>
> Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
> ---
> linux/linux.mk | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/linux/linux.mk b/linux/linux.mk
> index efdc21eff2..9a909c7d7b 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -408,6 +408,9 @@ define LINUX_KCONFIG_FIXUP_CMDS
> $(call KCONFIG_ENABLE_OPT,CONFIG_LOGO)
> $(call KCONFIG_ENABLE_OPT,CONFIG_LOGO_LINUX_CLUT224))
> $(call KCONFIG_DISABLE_OPT,CONFIG_GCC_PLUGINS)
> + # The kernel CONFIG_EXTRA_FIRMWARE feature requires to have the firmware full
> + # path for locating firmware file.
> + $(call KCONFIG_SET_OPT,CONFIG_EXTRA_FIRMWARE_DIR,"$(STAGING_DIR)/lib/firmware")
Besides what Thomas already said: firmware files are not installed in
STAGING_DIR/lib/firmware, but they are in TARGET_DIR/lib/frmware.
Also, some people already point CONFIG_EXTRA_FIRMWARE_DIR=$(INAGES_DIR)
as there are some firmware fiels copied in there already, so we do not
want to force that for them.
Regards,
Yann E. MORIN.
> $(PACKAGES_LINUX_CONFIG_FIXUPS)
> endef
>
> --
> 2.25.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2022-10-30 21:23 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-14 6:58 [Buildroot] [PATCH v2 0/5] Lichee RV and Lichee RV dock support Angelo Compagnucci
2022-10-14 6:58 ` [Buildroot] [PATCH v2 1/5] linux: enable CONFIG_EXTRA_FIRMWARE_DIR Angelo Compagnucci
2022-10-30 20:43 ` Thomas Petazzoni via buildroot
2022-10-30 20:52 ` Angelo Compagnucci
2022-10-30 21:23 ` Yann E. MORIN
2022-10-14 6:58 ` [Buildroot] [PATCH v2 2/5] package/pkg-utils: add KCONFIG_APPEND_OPT Angelo Compagnucci
2022-10-14 6:58 ` [Buildroot] [PATCH v2 3/5] ackage/rtl8723ds-bt: new package Angelo Compagnucci
2022-10-30 20:48 ` Thomas Petazzoni via buildroot
2022-10-30 20:55 ` Angelo Compagnucci
2022-10-30 21:21 ` Yann E. MORIN
2022-10-14 6:58 ` [Buildroot] [PATCH v2 4/5] configs/lichee_rv: new defconfig Angelo Compagnucci
2022-10-14 6:59 ` [Buildroot] [PATCH v2 5/5] configs/lichee_rv_dock: " Angelo Compagnucci
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox