ap6256-bluetooth: rename S90bluetooth to S36ap6256-bluetooth

keep the feature that loading ap6256 firmware and reset bluetooth
And run the bluetoothd through S40bluetooth in bluez5_utils package

Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
This commit is contained in:
Andy Hu
2023-11-14 10:14:51 +08:00
parent 9bf1e4c9d2
commit 1bf8e81b1e
2 changed files with 18 additions and 22 deletions
@@ -1,14 +1,15 @@
#! /bin/sh #!/bin/sh
#
# This shell script to loading the ap6256 bluetooth firmware
# and set gpio52 to reset the bluetooth hardware.
#
DESC="loading ap6256 bluetooth firmware and reset bluetooth"
set -e [ -e /lib/firmware/BCM4345C5.hcd ] || exit
DESC="bluetooth"
NAME=bluetoothd
DAEMON=/usr/sbin/$NAME
case "$1" in case "$1" in
start) start)
printf "Starting $DESC: " echo "Starting $DESC: "
echo 52 > /sys/class/gpio/export echo 52 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio52/direction echo out > /sys/class/gpio/gpio52/direction
@@ -16,25 +17,20 @@ case "$1" in
sleep 1 sleep 1
echo 1 > /sys/class/gpio/gpio52/value echo 1 > /sys/class/gpio/gpio52/value
start-stop-daemon -S -b -x $NAME
brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 1500000 --patchram /lib/firmware/BCM4345C5.hcd /dev/ttyS1 & brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 1500000 --patchram /lib/firmware/BCM4345C5.hcd /dev/ttyS1 &
echo "OK"
;; ;;
stop) stop)
printf "Stopping $DESC: " echo "Stopping $DESC: "
start-stop-daemon -K -x $NAME echo 0 > /sys/class/gpio/gpio52/value
echo 0 > /sys/class/gpio/gpio52/value echo 52 > /sys/class/gpio/unexport
echo 52 > /sys/class/gpio/unexport
killall brcm_patchram_plus killall brcm_patchram_plus
echo "OK" ;;
;;
restart|force-reload) restart|force-reload)
echo "Restarting $DESC: " echo "Restarting $DESC: "
$0 stop $0 stop
sleep 1 sleep 1
$0 start $0 start
echo "" ;;
;;
*) *)
echo "Usage: $0 {start|stop|restart|force-reload}" >&2 echo "Usage: $0 {start|stop|restart|force-reload}" >&2
@@ -10,7 +10,7 @@ ifeq ($(BR2_PACKAGE_STARFIVE_FIRMWARE_AP6256_BLUETOOTH),y)
define STARFIVE_FIRMWARE_INSTALL_AP6256_BLUETOOTH define STARFIVE_FIRMWARE_INSTALL_AP6256_BLUETOOTH
@echo "install AP6256 BLUETOOTH firmware ..." @echo "install AP6256 BLUETOOTH firmware ..."
$(INSTALL) -m 0755 -D $(STARFIVE_FIRMWARE_PKGDIR)/ap6256-bluetooth/BCM4345C5.hcd $(TARGET_DIR)/lib/firmware/ $(INSTALL) -m 0755 -D $(STARFIVE_FIRMWARE_PKGDIR)/ap6256-bluetooth/BCM4345C5.hcd $(TARGET_DIR)/lib/firmware/
$(INSTALL) -m 0755 -D $(STARFIVE_FIRMWARE_PKGDIR)/ap6256-bluetooth/S90bluetooth $(TARGET_DIR)/etc/init.d/ $(INSTALL) -m 0755 -D $(STARFIVE_FIRMWARE_PKGDIR)/ap6256-bluetooth/S36ap6256-bluetooth $(TARGET_DIR)/etc/init.d/
endef endef
endif endif