Commit 37bac77e authored by Yang Li's avatar Yang Li Committed by Luiz Augusto von Dentz

Bluetooth: hci_uart: Add support for Amlogic HCI UART

Add a new HCI protocol HCI_UART_AML for the Amlogic Bluetooth
controller. It works on the standard H4 protocol via a 4-wire UART
interface, with baud rates up to 4 Mbps.

The controller supports two types of commands: the TCI commands and the
vendor command. The former is for initial setup including setting baud
rates, downloading fw, starting chip and etc, while the latter is for
dumping firmware versions and setting public address after firmware
updates and normal startup.

It was verified on board of T602 (S905X4 + W265S2).

dmesg:
..
[    5.313450] Bluetooth: HCI UART protocol AML registered
[    6.506052] Bluetooth: hci0: fw_version: date = 42.28, number = 0xb2fd
...
Co-developed-by: default avatarYe He <ye.he@amlogic.com>
Signed-off-by: default avatarYe He <ye.he@amlogic.com>
Signed-off-by: default avatarYang Li <yang.li@amlogic.com>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent e5e465a1
...@@ -274,6 +274,18 @@ config BT_HCIUART_MRVL ...@@ -274,6 +274,18 @@ config BT_HCIUART_MRVL
Say Y here to compile support for HCI MRVL protocol. Say Y here to compile support for HCI MRVL protocol.
config BT_HCIUART_AML
bool "Amlogic protocol support"
depends on BT_HCIUART
depends on BT_HCIUART_SERDEV
select BT_HCIUART_H4
select FW_LOADER
help
The Amlogic protocol support enables Bluetooth HCI over serial
port interface for Amlogic Bluetooth controllers.
Say Y here to compile support for HCI AML protocol.
config BT_HCIBCM203X config BT_HCIBCM203X
tristate "HCI BCM203x USB driver" tristate "HCI BCM203x USB driver"
depends on USB depends on USB
......
...@@ -51,4 +51,5 @@ hci_uart-$(CONFIG_BT_HCIUART_BCM) += hci_bcm.o ...@@ -51,4 +51,5 @@ hci_uart-$(CONFIG_BT_HCIUART_BCM) += hci_bcm.o
hci_uart-$(CONFIG_BT_HCIUART_QCA) += hci_qca.o hci_uart-$(CONFIG_BT_HCIUART_QCA) += hci_qca.o
hci_uart-$(CONFIG_BT_HCIUART_AG6XX) += hci_ag6xx.o hci_uart-$(CONFIG_BT_HCIUART_AG6XX) += hci_ag6xx.o
hci_uart-$(CONFIG_BT_HCIUART_MRVL) += hci_mrvl.o hci_uart-$(CONFIG_BT_HCIUART_MRVL) += hci_mrvl.o
hci_uart-$(CONFIG_BT_HCIUART_AML) += hci_aml.o
hci_uart-objs := $(hci_uart-y) hci_uart-objs := $(hci_uart-y)
This diff is collapsed.
...@@ -870,7 +870,9 @@ static int __init hci_uart_init(void) ...@@ -870,7 +870,9 @@ static int __init hci_uart_init(void)
#ifdef CONFIG_BT_HCIUART_MRVL #ifdef CONFIG_BT_HCIUART_MRVL
mrvl_init(); mrvl_init();
#endif #endif
#ifdef CONFIG_BT_HCIUART_AML
aml_init();
#endif
return 0; return 0;
} }
...@@ -906,7 +908,9 @@ static void __exit hci_uart_exit(void) ...@@ -906,7 +908,9 @@ static void __exit hci_uart_exit(void)
#ifdef CONFIG_BT_HCIUART_MRVL #ifdef CONFIG_BT_HCIUART_MRVL
mrvl_deinit(); mrvl_deinit();
#endif #endif
#ifdef CONFIG_BT_HCIUART_AML
aml_deinit();
#endif
tty_unregister_ldisc(&hci_uart_ldisc); tty_unregister_ldisc(&hci_uart_ldisc);
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#define HCIUARTGETFLAGS _IOR('U', 204, int) #define HCIUARTGETFLAGS _IOR('U', 204, int)
/* UART protocols */ /* UART protocols */
#define HCI_UART_MAX_PROTO 12 #define HCI_UART_MAX_PROTO 13
#define HCI_UART_H4 0 #define HCI_UART_H4 0
#define HCI_UART_BCSP 1 #define HCI_UART_BCSP 1
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#define HCI_UART_AG6XX 9 #define HCI_UART_AG6XX 9
#define HCI_UART_NOKIA 10 #define HCI_UART_NOKIA 10
#define HCI_UART_MRVL 11 #define HCI_UART_MRVL 11
#define HCI_UART_AML 12
#define HCI_UART_RAW_DEVICE 0 #define HCI_UART_RAW_DEVICE 0
#define HCI_UART_RESET_ON_INIT 1 #define HCI_UART_RESET_ON_INIT 1
...@@ -209,3 +210,8 @@ int ag6xx_deinit(void); ...@@ -209,3 +210,8 @@ int ag6xx_deinit(void);
int mrvl_init(void); int mrvl_init(void);
int mrvl_deinit(void); int mrvl_deinit(void);
#endif #endif
#ifdef CONFIG_BT_HCIUART_AML
int aml_init(void);
int aml_deinit(void);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment