Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: hci_bcm: Increase host baudrate for CYW55572 in autobaud mode

Add device specific data for max baudrate in autobaud mode. This allows the
host to use a baudrate higher than "init speed" when loading FW in autobaud
mode.

The device specific max baudrate in autobaud mode for CYW55572 is set to
921600 bps. Devices without device specific max baudrate in autobaud mode
will use init speed as before. If no device specific init speed has been
specified, it will default to the bcm_proto default 115200 bps.

The increased baud rate improves FW load time. The exact load time will
depend on the specific system and FW being used. As a rough indication,
the FW load time dropped from ~9s @ 115.2kbps to ~1.7s @ 921.6kbps in one
test.

Signed-off-by: Hakan Jansson <hakan.jansson@infineon.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Hakan Jansson and committed by
Luiz Augusto von Dentz
46459cb6 9baee415

+16 -4
+16 -4
drivers/bluetooth/hci_bcm.c
··· 53 53 * struct bcm_device_data - device specific data 54 54 * @no_early_set_baudrate: Disallow set baudrate before driver setup() 55 55 * @drive_rts_on_open: drive RTS signal on ->open() when platform requires it 56 + * @max_autobaud_speed: max baudrate supported by device in autobaud mode 56 57 */ 57 58 struct bcm_device_data { 58 59 bool no_early_set_baudrate; 59 60 bool drive_rts_on_open; 61 + u32 max_autobaud_speed; 60 62 }; 61 63 62 64 /** ··· 102 100 * @drive_rts_on_open: drive RTS signal on ->open() when platform requires it 103 101 * @pcm_int_params: keep the initial PCM configuration 104 102 * @use_autobaud_mode: start Bluetooth device in autobaud mode 103 + * @max_autobaud_speed: max baudrate supported by device in autobaud mode 105 104 */ 106 105 struct bcm_device { 107 106 /* Must be the first member, hci_serdev.c expects this. */ ··· 142 139 bool drive_rts_on_open; 143 140 bool use_autobaud_mode; 144 141 u8 pcm_int_params[5]; 142 + u32 max_autobaud_speed; 145 143 }; 146 144 147 145 /* generic bcm uart resources */ ··· 483 479 else if (bcm->dev->drive_rts_on_open) 484 480 hci_uart_set_flow_control(hu, true); 485 481 486 - hu->init_speed = bcm->dev->init_speed; 482 + if (bcm->dev->use_autobaud_mode && bcm->dev->max_autobaud_speed) 483 + hu->init_speed = min(bcm->dev->oper_speed, bcm->dev->max_autobaud_speed); 484 + else 485 + hu->init_speed = bcm->dev->init_speed; 487 486 488 487 /* If oper_speed is set, ldisc/serdev will set the baudrate 489 488 * before calling setup() ··· 592 585 return 0; 593 586 594 587 /* Init speed if any */ 595 - if (hu->init_speed) 596 - speed = hu->init_speed; 588 + if (bcm->dev && bcm->dev->init_speed) 589 + speed = bcm->dev->init_speed; 597 590 else if (hu->proto->init_speed) 598 591 speed = hu->proto->init_speed; 599 592 else ··· 1526 1519 1527 1520 data = device_get_match_data(bcmdev->dev); 1528 1521 if (data) { 1522 + bcmdev->max_autobaud_speed = data->max_autobaud_speed; 1529 1523 bcmdev->no_early_set_baudrate = data->no_early_set_baudrate; 1530 1524 bcmdev->drive_rts_on_open = data->drive_rts_on_open; 1531 1525 } ··· 1550 1542 .drive_rts_on_open = true, 1551 1543 }; 1552 1544 1545 + static struct bcm_device_data cyw55572_device_data = { 1546 + .max_autobaud_speed = 921600, 1547 + }; 1548 + 1553 1549 static const struct of_device_id bcm_bluetooth_of_match[] = { 1554 1550 { .compatible = "brcm,bcm20702a1" }, 1555 1551 { .compatible = "brcm,bcm4329-bt" }, ··· 1566 1554 { .compatible = "brcm,bcm4349-bt", .data = &bcm43438_device_data }, 1567 1555 { .compatible = "brcm,bcm43540-bt", .data = &bcm4354_device_data }, 1568 1556 { .compatible = "brcm,bcm4335a0" }, 1569 - { .compatible = "infineon,cyw55572-bt" }, 1557 + { .compatible = "infineon,cyw55572-bt", .data = &cyw55572_device_data }, 1570 1558 { }, 1571 1559 }; 1572 1560 MODULE_DEVICE_TABLE(of, bcm_bluetooth_of_match);