Skip to content

Commit 822d64d

Browse files
committed
Add bluetooth support for DuoS
1 parent f37dbd6 commit 822d64d

File tree

5 files changed

+31
-7
lines changed

5 files changed

+31
-7
lines changed

configs/duos/linux/defconfig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,18 @@ CONFIG_NF_CONNTRACK_BRIDGE=y
141141
CONFIG_BRIDGE=y
142142
CONFIG_NETLINK_DIAG=y
143143
CONFIG_BT=y
144+
CONFIG_BT_BREDR=y
144145
CONFIG_BT_RFCOMM=y
145146
CONFIG_BT_RFCOMM_TTY=y
146147
CONFIG_BT_BNEP=y
148+
CONFIG_BT_BNEP_MC_FILTER=y
149+
CONFIG_BT_BNEP_PROTO_FILTER=y
147150
CONFIG_BT_HIDP=y
148151
CONFIG_BT_HS=y
152+
CONFIG_BT_LE=y
153+
CONFIG_BT_DEBUGFS=y
149154
CONFIG_BT_HCIUART=y
150-
CONFIG_BT_HCIUART_BCSP=y
155+
CONFIG_BT_HCIUART_H4=y
151156
CONFIG_CFG80211=m
152157
CONFIG_MAC80211=m
153158
CONFIG_RFKILL=y

configs/duos/settings.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ DDR_CFG=ddr3_1866_x16
77
PARTITION_FILE=partition_sd.xml
88
STORAGE_TYPE=sd
99

10-
PACKAGES += " duo-pinmux wireless-regdb wpasupplicant cvi-pinmux-cv181x"
10+
PACKAGES += " duo-pinmux wireless-regdb wpasupplicant cvi-pinmux-cv181x bluez"
1111

1212
IMAGE_ADDITIONS += "aic8800-firmware"
1313
IMAGE_ADDITIONS += "ethernet-leds"
14-
IMAGE_ADDITIONS += "usb-switch"
14+
IMAGE_ADDITIONS += "usb-switch"
15+
IMAGE_ADDITIONS += "hciattach-service"

scripts/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ $(BUILDDIR)/uboot-prepare-configure-stamp: $(BUILDDIR)/uboot-prepare-patch-stamp
105105
$(BUILDDIR)/uboot-compile-stamp: $(BUILDDIR)/uboot-prepare-configure-stamp
106106
@echo "$(COLOUR_GREEN)Building U-Boot for $(BOARD)$(END_COLOUR)"
107107
@cd $(BUILDDIR)/u-boot/ && $(MAKE) -j$(NPROCS) BOARD=mars CONFIG_USE_DEFAULT_ENV=y STORAGE_TYPE=$(STORAGE_TYPE) CHIP=$(UBOOT_CHIP) CVIBOARD=$(UBOOT_BOARD) CROSS_COMPILE="/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-"
108-
cd $(BUILDDIR)/u-boot/ && $(MAKE) -j$(NPROCS) BOARD=mars CONFIG_USE_DEFAULT_ENV=y STORAGE_TYPE=$(STORAGE_TYPE) CHIP=$(UBOOT_CHIP) CVIBOARD=$(UBOOT_BOARD) CROSS_COMPILE="/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-" u-boot-initial-env
108+
@cd $(BUILDDIR)/u-boot/ && $(MAKE) -j$(NPROCS) BOARD=mars CONFIG_USE_DEFAULT_ENV=y STORAGE_TYPE=$(STORAGE_TYPE) CHIP=$(UBOOT_CHIP) CVIBOARD=$(UBOOT_BOARD) CROSS_COMPILE="/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-" u-boot-initial-env
109109
@cp $(BUILDDIR)/u-boot/u-boot.bin $(BUILDDIR)
110110
@cp $(BUILDDIR)/u-boot/u-boot.dtb $(BUILDDIR)
111-
cp $(BUILDDIR)/u-boot/u-boot-initial-env $(BUILDDIR)
111+
@cp $(BUILDDIR)/u-boot/u-boot-initial-env $(BUILDDIR)
112112
@touch $@
113113

114114
uboot: $(BUILDDIR)/uboot-compile-stamp
@@ -175,7 +175,7 @@ $(BUILDDIR)/fsbl-package-stamp: $(BUILDDIR)/fsbl-compile-stamp
175175
@cp -r /builder/deb/cvitek-fsbl/* $(BUILDDIR)/package/cvitek-fsbl-$(BOARD)-$(FSBLVERSION)/
176176
@mkdir -p $(BUILDDIR)/package/cvitek-fsbl-$(BOARD)-$(FSBLVERSION)/boot/ $(BUILDDIR)/package/cvitek-fsbl-$(BOARD)-$(FSBLVERSION)/etc/
177177
@cp $(BUILDDIR)/fip.bin $(BUILDDIR)/package/cvitek-fsbl-$(BOARD)-$(FSBLVERSION)/boot/
178-
cp $(BUILDDIR)/u-boot-initial-env $(BUILDDIR)/package/cvitek-fsbl-$(BOARD)-$(FSBLVERSION)/etc/
178+
@cp $(BUILDDIR)/u-boot-initial-env $(BUILDDIR)/package/cvitek-fsbl-$(BOARD)-$(FSBLVERSION)/etc/
179179
@sed -i 's/Version: 1.0.0/Version: $(FSBLVERSION)/' $(BUILDDIR)/package/cvitek-fsbl-$(BOARD)-$(FSBLVERSION)/DEBIAN/control
180180
@sed -i 's/Package: cvitek-fsbl/Package: cvitek-fsbl-$(BOARD)/' $(BUILDDIR)/package/cvitek-fsbl-$(BOARD)-$(FSBLVERSION)/DEBIAN/control
181181
@cd $(BUILDDIR)/package/ && dpkg-deb --build cvitek-fsbl-$(BOARD)-$(FSBLVERSION)
@@ -218,7 +218,7 @@ $(BUILDDIR)/image-customize-stamp: $(BUILDDIR)/image-addons-stamp $(BUILDDIR)/li
218218
@cp -v /usr/bin/qemu-riscv64-static /rootfs/tmp/install/
219219
@cp -v /builder/setup_rootfs.sh /rootfs/tmp/install/
220220
@cp -v $(BUILDDIR)/public-key.asc /rootfs/tmp/install/
221-
chroot /rootfs/ /tmp/install/qemu-riscv64-static /bin/sh /tmp/install/setup_rootfs.sh
221+
@chroot /rootfs/ /tmp/install/qemu-riscv64-static /bin/sh /tmp/install/setup_rootfs.sh
222222
@rm -rf /rootfs/tmp/install/
223223
@umount /rootfs/proc || true
224224
@umount /rootfs/sys || true
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
$(BUILDDIR)/hciattach-service-stamp:
2+
@echo "$(COLOUR_GREEN)Installing hciattach systemd service for $(BOARD)$(END_COLOUR)"
3+
@mkdir -p /rootfs/etc/systemd/system/
4+
@cp -a addons/hciattach-service/hciattach.service /rootfs/etc/systemd/system/
5+
@mkdir -p /rootfs/tmp/install/
6+
@echo " hciattach bluetooth" >> /rootfs/tmp/install/systemd-enable
7+
@touch $@
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=Attach Bluetooth to UART
3+
After=dev-ttyS4.device
4+
Before=bluetooth.service
5+
6+
[Service]
7+
Type=forking
8+
ExecStart=/usr/bin/hciattach -s 1500000 /dev/ttyS4 any 1500000 flow nosleep
9+
10+
[Install]
11+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)