Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. #! /bin/sh
  2. # /etc/init.d/khadas-bt-init
  3. #
  4.  
  5. do_start()
  6. {
  7. #non mainline: model=`cat /sys/bus/mmc/devices/sdio:0001/sdio:0001:1/device`
  8. model=`cat /sys/bus/mmc/devices/mmc2\:0001/mmc2\:0001\:1/device`
  9. echo 0 > /sys/class/rfkill/rfkill0/state
  10. /bin/sleep 1
  11. echo 1 > /sys/class/rfkill/rfkill0/state
  12.  
  13. # Load the firmware
  14. if [ "$model" = "0xa9bf" ]; then
  15. # VIM Pro
  16. /usr/local/bin/brcm_patchram_plus --patchram /lib/firmware/brcm/BCM4345C0.hcd --enable_hci --no2bytes --tosleep 1000 /dev/ttyAML1
  17. #non mainline: /usr/local/bin/brcm_patchram_plus --patchram /lib/firmware/brcm/BCM4345C0.hcd --enable_hci --no2bytes --tosleep 1000 /dev/ttyS1
  18. else
  19. # VIM
  20. /usr/local/bin/brcm_patchram_plus --patchram /lib/firmware/brcm/bcm43438a1.hcd --enable_hci --no2bytes --tosleep 1000 /dev/ttyAML1
  21. # non mainline: /usr/local/bin/brcm_patchram_plus --patchram /lib/firmware/brcm/bcm43438a1.hcd --enable_hci --no2bytes --tosleep 1000 /dev/ttyS1
  22. fi
  23.  
  24. # FIXME Delay
  25. /bin/sleep 1
  26.  
  27. # Attach HCI adapter
  28. #non mainline: /usr/bin/hciattach /dev/ttyS1 any
  29. /usr/bin/hciattach /dev/ttyAML1 any
  30. }
  31.  
  32.  
  33. case "$1" in
  34. start)
  35. echo "Starting khadas-bt-init"
  36. do_start
  37. break;;
  38. stop)
  39. echo "Stopping khadas-bt-init"
  40. break;;
  41. *)
  42. echo "Usage: /etc/init.d/khadas-bt-init {start|stop}"
  43. exit 1
  44. ;;
  45. esac
  46.  
  47. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement