[PATCH v2 0/2]
Subsystems (3)
v2 cover [PATCH v2 0/2]
From: Sean Wang <[email protected]>
Since v2:
- reusing 8250_of since the original driver has almost the same logic
This patchset introduces the support for MediaTek BTIF controller.
MediaTek BTIF controller is the serial interface similar to UART but it works only as the digital device which is mainly used to communicate with the connectivity module also called CONNSYS inside the SoC which could be mostly found on those MediaTek SoCs with Bluetooth feature.
And the controller is made as being compatible with the 8250 register layout so it tends to be integrated with existing 8250 core driver and have no requirement for the modem configuration additionally such as the baud rate calculation and assignment.
Sean Wang (2):
dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
serial: 8250: of: Add new port type for MediaTek BTIF controller on
MT7622/23 SoC
Documentation/devicetree/bindings/serial/8250.txt | 3 +++ drivers/tty/serial/8250/8250_of.c | 2 ++ drivers/tty/serial/8250/8250_port.c | 8 ++++++++ include/uapi/linux/serial_core.h | 3 +++ 4 files changed, 16 insertions(+)
Signature · 1 line
2.7.4
PATCH v2 1/2 dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
From: Sean Wang <[email protected]>
Document the devicetree bindings in 8250.txt for MediaTek BTIF controller which could be found on MT7622 and MT7623 SoC.
--- Documentation/devicetree/bindings/serial/8250.txt | 3 +++ 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/serial/8250.txt +3 -0
@@ -14,6 +14,9 @@ Required properties: tegra132, or tegra210. - "nxp,lpc3220-uart" - "ralink,rt2880-uart" + - For MediaTek MT7623, must contain "mediatek,mt7623-btif" + - For other MediaTek SoCs , must contain "mediatek,<chip>-btif", + "mediatek,mt7623-btif" where <chip> is mt7622. - "altr,16550-FIFO32" - "altr,16550-FIFO64" - "altr,16550-FIFO128"
Signature · 1 line
2.7.4
PATCH v2 2/2 serial: 8250: of: Add new port type for MediaTek BTIF controller on MT7622/23 SoC
In reply to [email protected]From: Sean Wang <[email protected]>
MediaTek BTIF controller is the serial interface similar to UART but it works only as the digital device which is mainly used to communicate with the connectivity module called CONNSYS inside the SoC which could be mostly found on those MediaTek SoCs with Bluetooth feature such as MT7622 and MT7623 SoCs.
And the controller is made as being compatible with the 8250 register layout with extra registers such as DMA enablement so it tends to be integrated with reusing 8250 OF driver. However, DMA mode is not being supported yet in the current driver.
--- drivers/tty/serial/8250/8250_of.c | 2 ++ drivers/tty/serial/8250/8250_port.c | 8 ++++++++ include/uapi/linux/serial_core.h | 3 +++ 3 files changed, 13 insertions(+)
drivers/tty/serial/8250/8250_of.c +2 -0
@@ -300,6 +300,8 @@ static const struct of_device_id of_platform_serial_table[] = { .data = (void *)PORT_ALTR_16550_F64, }, { .compatible = "altr,16550-FIFO128", .data = (void *)PORT_ALTR_16550_F128, }, + { .compatible = "mediatek,mt7623-btif", + .data = (void *)PORT_MTK_BTIF, }, { .compatible = "mrvl,mmp-uart", .data = (void *)PORT_XSCALE, }, { .compatible = "ti,da830-uart", .data = (void *)PORT_DA830, },
drivers/tty/serial/8250/8250_port.c +8 -0
@@ -289,6 +289,14 @@ static const struct serial8250_config uart_config[] = { .rxtrig_bytes = {1, 4, 8, 14}, .flags = UART_CAP_FIFO | UART_CAP_AFE, }, + [PORT_MTK_BTIF] = { + .name ="MediaTek BTIF" , + .fifo_size = 16, + .tx_loadsz = 16, + .fcr = UART_FCR_ENABLE_FIFO | +UART_FCR_CLEAR_RCVR |UART_FCR_CLEAR_XMIT , + .flags = UART_CAP_FIFO, + }, };/* Uart divisor latch read */
include/uapi/linux/serial_core.h +3 -0
@@ -272,4 +272,7 @@/* MPS2 UART */ #define PORT_MPS2UART 116 +/* MediaTek BTIF */ +#define PORT_MTK_BTIF 117 +#endif /* _UAPILINUX_SERIAL_CORE_H */
Signature · 1 line
2.7.4
Matthias Brugger
maintainerRe: [PATCH v2 RESEND 1/2] dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
In reply to [email protected]Quoted 15 lines · sean.wang at mediatek.com
From: Sean Wang <[email protected]>
Document the devicetree bindings in 8250.txt for MediaTek BTIF controller which could be found on MT7622 and MT7623 SoC.
Signed-off-by Sean Wang <[email protected]>--- Documentation/devicetree/bindings/serial/8250.txt | 3 +++ 1 file changed, 3 insertions(+)Documentation/devicetree/bindings/serial/8250.txt +0
-0
Documentation/devicetree/bindings/serial/8250.txt Required properties: · line 19
Quoted 6 lines
Documentation/devicetree/bindings/serial/8250.txt +3
-0@@ -14,6 +14,9 @@ Required properties: tegra132, or tegra210. - "nxp,lpc3220-uart" - "ralink,rt2880-uart" + - For MediaTek MT7623, must contain "mediatek,mt7623-btif" + - For other MediaTek SoCs , must contain "mediatek,<chip>-btif", + "mediatek,mt7623-btif" where <chip> is mt7622.
Hm, to me that's confusing. What about:
"mediatek,mt7623-btif": for MediaTek MT7623 "mediatek,mt7622-btif", "mediatek,mt7623-btif": for MediaTek MT7622
If in the future we have more SoCs that support the BTIF, we should add them like the mt7622 case.
Make sense?
Regards,
Matthias
Re: [PATCH v2 RESEND 1/2] dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
Quoted 28 lines · Matthias Brugger
Quoted 15 lines · sean.wang at mediatek.com
From: Sean Wang <[email protected]>
Document the devicetree bindings in 8250.txt for MediaTek BTIF controller which could be found on MT7622 and MT7623 SoC.
Signed-off-by Sean Wang <[email protected]>--- Documentation/devicetree/bindings/serial/8250.txt | 3 +++ 1 file changed, 3 insertions(+)Documentation/devicetree/bindings/serial/8250.txt +0
-0Documentation/devicetree/bindings/serial/8250.txt Required properties: · line 19
Quoted 6 lines
Documentation/devicetree/bindings/serial/8250.txt +3
-0@@ -14,6 +14,9 @@ Required properties: tegra132, or tegra210. - "nxp,lpc3220-uart" - "ralink,rt2880-uart" + - For MediaTek MT7623, must contain "mediatek,mt7623-btif" + - For other MediaTek SoCs , must contain "mediatek,<chip>-btif", + "mediatek,mt7623-btif" where <chip> is mt7622.Hm, to me that's confusing. What about:
"mediatek,mt7623-btif": for MediaTek MT7623 "mediatek,mt7622-btif", "mediatek,mt7623-btif": for MediaTek MT7622
Quoted 3 lines
If in the future we have more SoCs that support the BTIF, we should add them like the mt7622 case.
I had v3, but it should have similar logic and also got ack from Rob
I knew all your logic of adding binding document for all MediaTek devices, even I alway added MediaTek device in dt-bindings as the way you mentioned here, but I felt this way is fine for this kind of dedicated document.
The reason i don't add it as usual is the following. 8250.txt is common and shared among all uart like devices, so i don't want btif device occupies too much section and bloat the document when every new MediaTek SoC is introduced.
So instead I refer to existing Nvidia device added in 8250.txt which I thought its way is simple, elegant and also using pattern I can use to add btif devices.
Sean
Quoted 4 lines
Make sense?
Regards,
Matthias
Matthias Brugger
maintainerRe: [PATCH v2 RESEND 1/2] dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
Quoted 40 lines · Sean Wang
Quoted 28 lines · Matthias Brugger
Quoted 15 lines · sean.wang at mediatek.com
From: Sean Wang <[email protected]>
Document the devicetree bindings in 8250.txt for MediaTek BTIF controller which could be found on MT7622 and MT7623 SoC.
Signed-off-by Sean Wang <[email protected]>--- Documentation/devicetree/bindings/serial/8250.txt | 3 +++ 1 file changed, 3 insertions(+)Documentation/devicetree/bindings/serial/8250.txt +0
-0Documentation/devicetree/bindings/serial/8250.txt Required properties: · line 19
Quoted 6 lines
Documentation/devicetree/bindings/serial/8250.txt +3
-0@@ -14,6 +14,9 @@ Required properties: tegra132, or tegra210. - "nxp,lpc3220-uart" - "ralink,rt2880-uart" + - For MediaTek MT7623, must contain "mediatek,mt7623-btif" + - For other MediaTek SoCs , must contain "mediatek,<chip>-btif", + "mediatek,mt7623-btif" where <chip> is mt7622.Hm, to me that's confusing. What about:
"mediatek,mt7623-btif": for MediaTek MT7623 "mediatek,mt7622-btif", "mediatek,mt7623-btif": for MediaTek MT7622Quoted 3 lines
If in the future we have more SoCs that support the BTIF, we should add them like the mt7622 case.
I had v3, but it should have similar logic and also got ack from Rob
I knew all your logic of adding binding document for all MediaTek devices, even I alway added MediaTek device in dt-bindings as the way you mentioned here, but I felt this way is fine for this kind of dedicated document.
Quoted 9 lines
The reason i don't add it as usual is the following. 8250.txt is common and shared among all uart like devices, so i don't want btif device occupies too much section and bloat the document when every new MediaTek SoC is introduced.
So instead I refer to existing Nvidia device added in 8250.txt which I thought its way is simple, elegant and also using pattern I can use to add btif devices.
Working on my email backlog after vactions I didn't see that this was accepted by Rob. Sorry for the noise.
Matthias