diff mbox series

[v2,3/5] ackage/rtl8723ds-bt: new package

Message ID 20221014065900.3311604-4-angelo@amarulasolutions.com
State Rejected
Headers show
Series Lichee RV and Lichee RV dock support | expand

Commit Message

Angelo Compagnucci Oct. 14, 2022, 6:58 a.m. UTC
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

Comments

Thomas Petazzoni Oct. 30, 2022, 8:48 p.m. UTC | #1
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
Angelo Compagnucci Oct. 30, 2022, 8:55 p.m. UTC | #2
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
>
Yann E. MORIN Oct. 30, 2022, 9:21 p.m. UTC | #3
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.
diff mbox series

Patch

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))