From 1824bba224d03d8a82abb63403a82f08aa90c255 Mon Sep 17 00:00:00 2001 From: "ziv.xu" Date: Thu, 30 Mar 2023 22:42:44 +0800 Subject: [PATCH] starfive:add autoload bluetooth firmware function add autoload bluetooth firmware function Signed-off-by: ziv.xu --- .../ap6256-bluetooth/S90bluetooth | 27 +++++++++++++++++++ .../starfive-firmware/starfive-firmware.mk | 2 ++ 2 files changed, 29 insertions(+) create mode 100755 package/starfive/starfive-firmware/ap6256-bluetooth/S90bluetooth diff --git a/package/starfive/starfive-firmware/ap6256-bluetooth/S90bluetooth b/package/starfive/starfive-firmware/ap6256-bluetooth/S90bluetooth new file mode 100755 index 00000000..8c795731 --- /dev/null +++ b/package/starfive/starfive-firmware/ap6256-bluetooth/S90bluetooth @@ -0,0 +1,27 @@ +#! /bin/sh + +set -e + +DESC="bluetooth" +NAME=bluetoothd +DAEMON=/usr/sbin/$NAME + +echo 52 > /sys/class/gpio/export +echo out > /sys/class/gpio/gpio52/direction +echo 0 > /sys/class/gpio/gpio52/value +sleep 1 +echo 1 > /sys/class/gpio/gpio52/value + +case "$1" in + start) + printf "Starting $DESC: " + start-stop-daemon -S -b -x $NAME + brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 115200 --patchram /lib/firmware/BCM4345C5.hcd /dev/ttyS1 & + echo "OK" + ;; + *) + exit 1 + ;; +esac + +exit 0 diff --git a/package/starfive/starfive-firmware/starfive-firmware.mk b/package/starfive/starfive-firmware/starfive-firmware.mk index f9d3d561..98d1263d 100644 --- a/package/starfive/starfive-firmware/starfive-firmware.mk +++ b/package/starfive/starfive-firmware/starfive-firmware.mk @@ -20,6 +20,8 @@ define STARFIVE_FIRMWARE_INSTALL_TARGET_CMDS $(foreach f,$(STARFIVE_FIRMWARE_FILES), \ $(INSTALL) -m 0755 -D $(f) $(TARGET_DIR)/lib/firmware/; \ ) + $(INSTALL) -D -m 755 package/starfive/starfive-firmware/ap6256-bluetooth/S90bluetooth $(TARGET_DIR)/etc/init.d/S90bluetooth + endef $(eval $(generic-package))