[lkml]   [2016]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: [PATCH v2] Bluetooth: hci_uart: Support firmware download for Marvell
Hi Marcel,

> > +
> > + kfree(skb);
> > + BT_INFO("leave dnld_fw\n");
> > +
> > + return ret;
> > +}
> I think it would help if you explain on how the firmware download for
> your UART devices work. I have the feeling we need a bit better core
> handling in this case and not end up hacking it in this way.
> > +

I have explained our firmware download mechanism in attached text file.
I will shortly send V3 patch which address your review comments. Let me know if you have any suggestions.

Firmware download works on the feedback mechanism between
driver and the device. For every chunk of firmware downloaded,
the device will send an ACK and append the next length (in bytes)
to be downloaded. Driver will decode this info and download bytes

On power on, the device starts sending below heartbeat sequence:

heartbeat (5 bytes) : |HDR|XX|XX|XX|XX|

HDR 0xA5: Header indicating ACK

If HDR is ACK(0xA5) then rest of the bytes are decoded as below:


L1 : LSB of length of the firmware bytes to be sent from the host
L2 : MSB of length of the firmware bytes to be sent from the host
CL1: Complement of L1
CL2: Complement of L2

Driver will decode the length from above sequence and download
bytes accordingly. Device will acknowledge the same and append
lenth to be downloaded in next transmission.

HDR 0xAA: Header indicating chip id and revision
If HDR is chip info(0xAA) then rest of the bytes are decoded as below:


CHIP ID : Id of the chip
CHIP_REV : Chip revision
CCHIP_ID : Complement of chip id
CCHIP_REV: Complement of chip revision

The device will start sending above 0xAA sequence once helper
file gets downloaded. Helper file is needed to make device
work with higher baud rate.

After downloding the helper, driver will change the baudrate
in device and start downloading the firmware. This reduces the
time needed to download the firmware. For each baud rate there
exists different helper files. In the given patch we are
using helper file which enabled firmware download in 3MB speed.
 \ /
  Last update: 2016-03-01 19:01    [W:0.678 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site