| # Copyright 2014 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| description "Sample script to download Bluetooth firmware for BCM4354 chipset over UART interface only" |
| author "chromium-os-dev@chromium.org" |
| |
| start on starting bluetoothd |
| stop on stopped bluetoothd |
| |
| respawn |
| |
| # The below pre-start block to ensure brcm_patchram_plus is executed only |
| # when /dev/ttyUSB0 is up. This is only needed in cases where ttyUSB0 |
| # is not initialized when this script is executed (esp. when Bluetooth |
| # chipset is connected over USB port) |
| pre-start script |
| logger -t "$UPSTART_JOB" "Waiting for /dev/ttyUSB0" |
| while [ ! -e /dev/ttyUSB0 ]; do |
| sleep 1 |
| done |
| logger -t "$UPSTART_JOB" "Wait Done" |
| end script |
| |
| exec /usr/bin/brcm_patchram_plus --patchram \ |
| /lib/firmware/brcm/BCM4354_003.001.012.0208.0000_UART_eLNA.hcd \ |
| --no2bytes --enable_hci --baudrate 3000000 \ |
| --use_baudrate_for_download --tosleep=50000 /dev/ttyUSB0 |